2 * Copyright (c) 2013, Intel Corporation.
4 * This program is licensed under the terms and conditions of the
5 * Apache License, version 2.0. The full text of the Apache License is at
6 * http://www.apache.org/licenses/LICENSE-2.0
12 function connected() {
13 console.log('Settings daemon connected');
16 function disconnected(e) {
17 console.log('Settings daemon disconnected...');
19 showMsg('Error', 'Cannot connect to settings daemon');
26 console.log('Settings started...');
27 $('#quit').on('click', function() {
28 console.log('Settings exiting...');
29 tizen.application.getCurrentApplication().exit();
32 wsAPI.connect('ws://localhost:16000/', 'http-only', connected, disconnected);
36 $('#main').on('pageshow', function(event, data) {
37 /* TODO: unsubscribe events if neccessary */
38 if (data.prevPage.attr('id') === 'page_connman') {
39 console.log('Connman settings exited');
40 wsAPI.unsubscribeEvents(connmanEventReceived);
41 } else if (data.prevPage.attr('id') === 'page_bluetooth') {
42 console.log('Bluetooth settings exited');
43 wsAPI.unsubscribeEvents(bluetoothEventReceived);
44 } else if (data.prevPage.attr('id') === 'page_datetime') {
45 console.log('Date and Time settings exited');
46 } else if (data.prevPage.attr('id') === 'page_locale') {
47 console.log('Locale settings exited');
51 /* Different sub panels */
57 showMsg('Error', 'Javascript Exception Caught: ' + e);
61 $(document).ready(function() {