Updated application sources 72/22372/1
authorPawel Sierszen <p.sierszen@samsung.com>
Mon, 2 Jun 2014 12:52:25 +0000 (14:52 +0200)
committerPawel Sierszen <p.sierszen@samsung.com>
Mon, 2 Jun 2014 12:52:25 +0000 (14:52 +0200)
Change-Id: I942b821e069ed23edb3f051718e5addd38f28fa6
Signed-off-by: Pawel Sierszen <p.sierszen@samsung.com>
project/config.xml
project/css/style.css
project/index.html
project/js/config.js
project/js/main.js

index fbfac1f..ef1be7e 100755 (executable)
@@ -1,8 +1,22 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://yourdomain/Systeminfo" version="0.1.7" viewmodes="maximized">
-       <tizen:application id="nGZWgKPPAa.Systeminfo" package="nGZWgKPPAa" required_version="2.2"/>
-       <content src="index.html"/>
-       <icon src="icon.png"/>
-       <name>System Info</name>
-       <feature name="http://tizen.org/feature/screen.size.normal.720.1280"/>
+<widget
+    xmlns="http://www.w3.org/ns/widgets"
+    xmlns:tizen="http://tizen.org/ns/widgets"
+    id="http://sample-web-application.tizen.org/SystemInfo"
+    version="2.2.0"
+    viewmodes="maximized">
+
+    <tizen:application
+        id="nGZWgKPPAa.Systeminfo"
+        package="nGZWgKPPAa"
+        required_version="2.2" />
+
+    <content src="index.html" />
+
+    <icon src="icon.png" />
+
+    <name>System Info</name>
+
+    <feature name="http://tizen.org/feature/screen.size.normal.720.1280" />
+
 </widget>
index 6d2ee4f..0a8b9dd 100755 (executable)
@@ -1,3 +1,7 @@
+body {
+       -webkit-user-select: none;
+}
+
 li>label {
        color:#646464;
 }
index 752ef84..761c644 100644 (file)
@@ -1,44 +1,54 @@
 <!DOCTYPE html>
 <html>
 <head>
-       <meta charset="utf-8"/>
-       <meta name="description" content="System info API Tutorial"/>
-       <title>System info</title>
-       <script src="tizen-web-ui-fw/latest/js/jquery.min.js"></script>
-       <script src="./js/config.js"></script>
-       <script src="tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
-       <script src="tizen-web-ui-fw/latest/js/tizen-web-ui-fw.min.js"
-                       data-framework-viewport-scale="false"
-                       data-framework-theme="tizen-white"></script>
-       <script type="text/javascript" src="./js/main.js"></script>
-       <link rel="stylesheet" type="text/css" href="./css/style.css"/>
+
+    <meta charset="utf-8"/>
+    <meta name="viewport" content="width=360, user-scalable=no"/>
+
+    <title>System info</title>
+    <meta name="description" content="System info API Tutorial"/>
+
+    <script src="/usr/share/tizen-web-ui-fw/latest/js/jquery.min.js"></script>
+    <script src="./js/config.js"></script>
+    <script src="/usr/share/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+    <script src="/usr/share/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.min.js" data-framework-viewport-scale="false" data-framework-theme="tizen-white"></script>
+
+    <link rel="stylesheet" type="text/css" href="./css/style.css"/>
+    <script type="text/javascript" src="./js/main.js"></script>
+
 </head>
 <body>
 
-       <div data-role="page" id="main">
-               <div data-role="header" data-position="fixed">
-                       <h1>System information</h1>
-               </div>
-               <div data-role="content">
-                       <ul data-role="listview">
-                               <li id="storage-info">Storage</li>
-                               <li id="battery-info">Battery</li>
-                               <li id="cpu-info">CPU</li>
-                               <li id="display-info">Display</li>
-                               <li id="orientation-info">Device orientation</li>
-                       </ul>
-               </div>
-       </div>
-
-       <div data-role="page" id="info">
-               <div data-role="header" data-position="fixed">
-                       <h1 id="info-title"></h1>
-               </div>
-               <div data-role="content">
-                       <ul data-role="listview" id="info-list">
-                       </ul>
-               </div>
-       </div>
+    <div data-role="page" id="main">
+
+        <div data-role="header" data-position="fixed">
+            <h1>System information</h1>
+        </div>
+
+        <div data-role="content">
+            <ul data-role="listview">
+                <li id="storage-info">Storage</li>
+                <li id="battery-info">Battery</li>
+                <li id="cpu-info">CPU</li>
+                <li id="display-info">Display</li>
+                <li id="orientation-info">Device orientation</li>
+            </ul>
+        </div>
+
+    </div>
+
+    <div data-role="page" id="info">
+
+        <div data-role="header" data-position="fixed">
+            <h1 id="info-title"></h1>
+        </div>
+
+        <div data-role="content">
+            <ul data-role="listview" id="info-list">
+            </ul>
+        </div>
+
+    </div>
 
 </body>
 </html>
index 7581f82..3782913 100644 (file)
  *      limitations under the License.
  */
 
+/*jslint devel: true*/
+/*global $*/
+
 //tizen-web-ui-fw configuration
-$(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));
-       });
+$(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));
+    });
 });
index f9de595..1e308b4 100644 (file)
  *      limitations under the License.
  */
 
-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();
-                       }
-               }
-       });
-});
+/*jslint devel: true*/
+/*global $, tizen, window*/
+
+var gInfoTitle = '', gInfo = '', gBatteryListener;
 
-$(document).delegate("#info", "pageinit", function() {
-       $("#info").bind("pagebeforeshow", function() {
-               $("#info-title").html(gInfoTitle);
-               $("#info-list").html(gInfo).trigger("create").listview("refresh");
-       });
+$(document).delegate('#info', 'pageinit', function () {
+    'use strict';
+    $('#info').bind('pagebeforeshow', function () {
+        $('#info-title').html(gInfoTitle);
+        $('#info-list').html(gInfo).trigger('create').listview('refresh');
+    });
 });
 
 function onError(e) {
-       alert("Error: " + e.message);
+    'use strict';
+    alert('Error: ' + e.message);
 }
 
 function make2lineListItem(title, value) {
-       return '<li class="ui-li-has-multiline ui-li-text-ellipsis">'
-                       + title
-                       + '<span class="ui-li-text-sub">'
-                       + value
-                       + '</span></li>';
+    'use strict';
+    return '<li class="ui-li-has-multiline ui-li-text-ellipsis">'
+        + title
+        + '<span class="ui-li-text-sub">'
+        + value
+        + '</span></li>';
 }
 
 function make1lineListItem(value) {
-       return '<li>' + value + '</li>';
+    'use strict';
+    return '<li>' + value + '</li>';
 }
 
 function makeDividerListItem(value) {
-       return '<li data-role="list-divider">' + value + '</li>';
+    'use strict';
+    return '<li data-role="list-divider">' + value + '</li>';
 }
 
 function onStorageSuccess(storages) {
-       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");
+    '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');
 }
 
 function onBatterySuccess(battery) {
-       gInfoTitle = "Battery";
-       gInfo = make2lineListItem("Level", battery.level)
-                       + make2lineListItem("Charging", (battery.isCharging == true ? "Yes" : "No"));
+    'use strict';
+    gInfoTitle = 'Battery';
+    gInfo = make2lineListItem('Level', battery.level)
+        + make2lineListItem('Charging',
+            (battery.isCharging === true ? 'Yes' : 'No'));
 
-       $.mobile.changePage("#info");
+    $.mobile.changePage('#info');
 }
 
 function onCpuInfoSuccess(cpu) {
-       gInfoTitle = "CPU";
-       gInfo = make2lineListItem("Load", cpu.load);
+    'use strict';
+    gInfoTitle = 'CPU';
+    gInfo = make2lineListItem('Load', cpu.load);
 
-       $.mobile.changePage("#info");
+    $.mobile.changePage('#info');
 }
 
 function onDisplaySuccess(display) {
-       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");
+    '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');
 }
 
 function onDeviceSuccess(device) {
-       gInfoTitle = "Device";
-       gInfo = make2lineListItem("IMEI", device.imei)
-                       + make2lineListItem("Model", device.model)
-                       + make2lineListItem("Version", device.version)
-                       + make2lineListItem("Vendor", device.vendor);
-
-       $.mobile.changePage("#info");
+    'use strict';
+    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) {
-       gInfoTitle = "Device orientation";
-       gInfo = make2lineListItem("Status", orientation.status);
+    'use strict';
+    gInfoTitle = 'Device orientation';
+    gInfo = make2lineListItem('Status', orientation.status);
 
-       $.mobile.changePage("#info");
+    $.mobile.changePage('#info');
 }
 
 function getSystemProperty(property, onSuccess) {
-       try {
-               tizen.systeminfo.getPropertyValue(property, onSuccess, onError);
-       } catch (e) {
-               alert("Exception: " + e.message);
-       }
+    'use strict';
+    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();
+            }
+        }
+    });
+});
+