From f40789c835ae3842aec3a7cb85a23c77d14d0e17 Mon Sep 17 00:00:00 2001 From: Piotr Wronski Date: Mon, 2 Jun 2014 23:06:41 -0700 Subject: [PATCH] Revert "Updated application sources" This reverts commit b37c4dc99f726e5ce8883ff92b2b23ae95ce1b1a. Change-Id: I4dab5ebd7dc206d6b8ff78a7842ef780bea98f35 --- project/config.xml | 26 ++---- project/css/style.css | 4 - project/index.html | 80 +++++++++---------- project/js/config.js | 26 +++--- project/js/main.js | 213 ++++++++++++++++++++++---------------------------- 5 files changed, 147 insertions(+), 202 deletions(-) diff --git a/project/config.xml b/project/config.xml index ef1be7e..fbfac1f 100755 --- a/project/config.xml +++ b/project/config.xml @@ -1,22 +1,8 @@ - - - - - - - - - System Info - - - + + + + + System Info + diff --git a/project/css/style.css b/project/css/style.css index 0a8b9dd..6d2ee4f 100755 --- a/project/css/style.css +++ b/project/css/style.css @@ -1,7 +1,3 @@ -body { - -webkit-user-select: none; -} - li>label { color:#646464; } diff --git a/project/index.html b/project/index.html index 761c644..752ef84 100644 --- a/project/index.html +++ b/project/index.html @@ -1,54 +1,44 @@ - - - - - System info - - - - - - - - - - + + + System info + + + + + + -
- -
-

System information

-
- -
-
    -
  • Storage
  • -
  • Battery
  • -
  • CPU
  • -
  • Display
  • -
  • Device orientation
  • -
-
- -
- -
- -
-

-
- -
-
    -
-
- -
+
+
+

System information

+
+
+
    +
  • Storage
  • +
  • Battery
  • +
  • CPU
  • +
  • Display
  • +
  • Device orientation
  • +
+
+
+ +
+
+

+
+
+
    +
+
+
diff --git a/project/js/config.js b/project/js/config.js index 3782913..7581f82 100644 --- a/project/js/config.js +++ b/project/js/config.js @@ -14,20 +14,16 @@ * limitations under the License. */ -/*jslint devel: true*/ -/*global $*/ - //tizen-web-ui-fw configuration -$(document).bind('mobileinit', function () { - 'use strict'; - $.mobile.loadingMessageTextVisible = false; - $.mobile.defaultPageTransition = "none"; - // Disable context menu - $(document).bind('contextmenu', function (e) { - return false; - }); - // Disable text selection - $(document).delegate('[data-role="page"]', 'pageinit', function (e) { - $.mobile.tizen.disableSelection($(e.target)); - }); +$(document).bind("mobileinit", function() { + $.mobile.loadingMessageTextVisible = false; + $.mobile.defaultPageTransition = "none"; + // Disable context menu + $(document).bind("contextmenu", function(e) { + return false; + }); + // Disable text selection + $(document).delegate("[data-role='page']", "pageinit", function(e) { + $.mobile.tizen.disableSelection($(e.target)); + }); }); diff --git a/project/js/main.js b/project/js/main.js index 1e308b4..f9de595 100644 --- a/project/js/main.js +++ b/project/js/main.js @@ -14,159 +14,136 @@ * limitations under the License. */ -/*jslint devel: true*/ -/*global $, tizen, window*/ - -var gInfoTitle = '', gInfo = '', gBatteryListener; +var gInfoTitle = "", gInfo = "", gBatteryListener; + +$(document).delegate("#main", "pageinit", function() { + $("#storage-info").bind("vclick", function() { + getSystemProperty("STORAGE", onStorageSuccess); + return false; + }); + $("#battery-info").bind("vclick", function() { + getSystemProperty("BATTERY", onBatterySuccess); + return false; + }); + $("#cpu-info").bind("vclick", function() { + getSystemProperty("CPU", onCpuInfoSuccess); + return false; + }); + $("#display-info").bind("vclick", function() { + getSystemProperty("DISPLAY", onDisplaySuccess); + return false; + }); + + $("#orientation-info").bind("vclick", function() { + getSystemProperty("DEVICE_ORIENTATION", onOrientationSuccess); + return false; + }); + + $(window).on('tizenhwkey', function (e) { + if (e.originalEvent.keyName === "back") { + if ($.mobile.activePage.attr('id') === 'main') { + tizen.application.getCurrentApplication().exit(); + } else { + history.back(); + } + } + }); +}); -$(document).delegate('#info', 'pageinit', function () { - 'use strict'; - $('#info').bind('pagebeforeshow', function () { - $('#info-title').html(gInfoTitle); - $('#info-list').html(gInfo).trigger('create').listview('refresh'); - }); +$(document).delegate("#info", "pageinit", function() { + $("#info").bind("pagebeforeshow", function() { + $("#info-title").html(gInfoTitle); + $("#info-list").html(gInfo).trigger("create").listview("refresh"); + }); }); function onError(e) { - 'use strict'; - alert('Error: ' + e.message); + alert("Error: " + e.message); } function make2lineListItem(title, value) { - 'use strict'; - return '
  • ' - + title - + '' - + value - + '
  • '; + return '
  • ' + + title + + '' + + value + + '
  • '; } function make1lineListItem(value) { - 'use strict'; - return '
  • ' + value + '
  • '; + return '
  • ' + value + '
  • '; } function makeDividerListItem(value) { - 'use strict'; - return '
  • ' + value + '
  • '; + return '
  • ' + value + '
  • '; } function onStorageSuccess(storages) { - 'use strict'; - var i; - gInfoTitle = 'Storages (' + storages.units.length + ')'; - gInfo = ''; - for (i = 0; i < storages.units.length; i = i + 1) { - gInfo += makeDividerListItem('Storage ' + (i + 1)) - + make2lineListItem('Type', storages.units[i].type) - + make2lineListItem('Capacity', - Math.floor(storages.units[i].capacity / 1000000) + ' MB') - + make2lineListItem('Available capacity', - Math.floor(storages.units[i].availableCapacity / 1000000) - + ' MB') - + make2lineListItem('Removable', - (storages.units[i].isRemoveable === true ? 'Yes' : 'No')); - } - - $.mobile.changePage('#info'); + gInfoTitle = "Storages (" + storages.units.length + ")"; + gInfo = ""; + for (var i = 0; i < storages.units.length; i++) { + gInfo += makeDividerListItem("Storage " + (i + 1)) + + make2lineListItem("Type", storages.units[i].type) + + make2lineListItem("Capacity", Math.floor(storages.units[i].capacity / 1000000) + " MB") + + make2lineListItem("Available capacity", Math.floor(storages.units[i].availableCapacity / 1000000) + " MB") + + make2lineListItem("Removable", (storages.units[i].isRemoveable == true ? "Yes" : "No")); + } + + $.mobile.changePage("#info"); } function onBatterySuccess(battery) { - 'use strict'; - gInfoTitle = 'Battery'; - gInfo = make2lineListItem('Level', battery.level) - + make2lineListItem('Charging', - (battery.isCharging === true ? 'Yes' : 'No')); + gInfoTitle = "Battery"; + gInfo = make2lineListItem("Level", battery.level) + + make2lineListItem("Charging", (battery.isCharging == true ? "Yes" : "No")); - $.mobile.changePage('#info'); + $.mobile.changePage("#info"); } function onCpuInfoSuccess(cpu) { - 'use strict'; - gInfoTitle = 'CPU'; - gInfo = make2lineListItem('Load', cpu.load); + gInfoTitle = "CPU"; + gInfo = make2lineListItem("Load", cpu.load); - $.mobile.changePage('#info'); + $.mobile.changePage("#info"); } function onDisplaySuccess(display) { - 'use strict'; - gInfoTitle = 'Display'; - gInfo = makeDividerListItem('Resolution') - + make2lineListItem('Width', display.resolutionWidth) - + make2lineListItem('Height', display.resolutionHeight) - + makeDividerListItem('Dots per inch') - + make2lineListItem('Horizontal', display.dotsPerInchWidth) - + make2lineListItem('Vertical', display.dotsPerInchHeight) - + makeDividerListItem('Physical size') - + make2lineListItem('Width', display.physicalWidth) - + make2lineListItem('Height', display.physicalHeight) - + makeDividerListItem('Brightness') - + make1lineListItem(display.brightness); - - $.mobile.changePage('#info'); + gInfoTitle = "Display"; + gInfo = makeDividerListItem("Resolution") + + make2lineListItem("Width", display.resolutionWidth) + + make2lineListItem("Height", display.resolutionHeight) + + makeDividerListItem("Dots per inch") + + make2lineListItem("Horizontal", display.dotsPerInchWidth) + + make2lineListItem("Vertical", display.dotsPerInchHeight) + + makeDividerListItem("Physical size") + + make2lineListItem("Width", display.physicalWidth) + + make2lineListItem("Height", display.physicalHeight) + + makeDividerListItem("Brightness") + + make1lineListItem(display.brightness); + + $.mobile.changePage("#info"); } function onDeviceSuccess(device) { - 'use strict'; - gInfoTitle = 'Device'; - gInfo = make2lineListItem('IMEI', device.imei) - + make2lineListItem('Model', device.model) - + make2lineListItem('Version', device.version) - + make2lineListItem('Vendor', device.vendor); - - $.mobile.changePage('#info'); + gInfoTitle = "Device"; + gInfo = make2lineListItem("IMEI", device.imei) + + make2lineListItem("Model", device.model) + + make2lineListItem("Version", device.version) + + make2lineListItem("Vendor", device.vendor); + + $.mobile.changePage("#info"); } function onOrientationSuccess(orientation) { - 'use strict'; - gInfoTitle = 'Device orientation'; - gInfo = make2lineListItem('Status', orientation.status); + gInfoTitle = "Device orientation"; + gInfo = make2lineListItem("Status", orientation.status); - $.mobile.changePage('#info'); + $.mobile.changePage("#info"); } function getSystemProperty(property, onSuccess) { - 'use strict'; - try { - tizen.systeminfo.getPropertyValue(property, onSuccess, onError); - } catch (e) { - alert('Exception: ' + e.message); - } + try { + tizen.systeminfo.getPropertyValue(property, onSuccess, onError); + } catch (e) { + alert("Exception: " + e.message); + } } - -$(document).delegate('#main', 'pageinit', function () { - 'use strict'; - $('#storage-info').bind('vclick', function () { - getSystemProperty('STORAGE', onStorageSuccess); - return false; - }); - $('#battery-info').bind('vclick', function () { - getSystemProperty('BATTERY', onBatterySuccess); - return false; - }); - $('#cpu-info').bind('vclick', function () { - getSystemProperty('CPU', onCpuInfoSuccess); - return false; - }); - $('#display-info').bind('vclick', function () { - getSystemProperty('DISPLAY', onDisplaySuccess); - return false; - }); - - $('#orientation-info').bind('vclick', function () { - getSystemProperty('DEVICE_ORIENTATION', onOrientationSuccess); - return false; - }); - - $(window).on('tizenhwkey', function (e) { - if (e.originalEvent.keyName === 'back') { - if ($.mobile.activePage.attr('id') === 'main') { - tizen.application.getCurrentApplication().exit(); - } else { - history.back(); - } - } - }); -}); - -- 2.7.4