[SensorBall]Updated Private -> RSA
authorji.ji <ji.ji@samsung.com>
Tue, 9 Jul 2013 10:21:56 +0000 (19:21 +0900)
committerji.ji <ji.ji@samsung.com>
Tue, 9 Jul 2013 10:21:56 +0000 (19:21 +0900)
Change-Id: I0f7d9d7eaf978841baef924ca063232d28abfabb

config.xml
css/style.css
images/background1.jpg [new file with mode: 0644]
images/background2.jpg [new file with mode: 0644]
images/background3.jpg [new file with mode: 0644]
index.html
js/main.js

index ea9e208..a5c0e7e 100644 (file)
@@ -3,7 +3,7 @@
        <tizen:application id="RiIuG1b0CV.SensorBall" package="RiIuG1b0CV" required_version="2.2"/>
        <content src="index.html"/>
        <icon src="icon.png"/>
-       <name>SensorBall</name>
+       <name>Sensor ball</name>
        <tizen:privilege name="http://tizen.org/privilege/application.launch"/>
        <tizen:setting screen-orientation="portrait" context-menu="disable" background-support="disable" encryption="disable" install-location="auto"/>
 </widget>
index aa3f6bf..9146e9b 100644 (file)
@@ -12,15 +12,16 @@ body {
 }
 
 .background1 {
-       background-image: url('../images/background1.png');
+       background-image: url('../images/background1.jpg');
 }
 
 .background2 {
-       background-image: url('../images/background2.png');
+       background-image: url('../images/background2.jpg');
 }
 
 .background3 {
-       background-image: url('../images/background3.png');
+       background-image: url('../images/background3.jpg');
+       background-color: #000;
        overflow: hidden;
 }
 
@@ -44,4 +45,8 @@ body {
 #main {
        width: 100%;
        height: 100%;
-}
\ No newline at end of file
+}
+
+.ui-tabbar-margin-back {
+       margin-right:0 !important;
+}
diff --git a/images/background1.jpg b/images/background1.jpg
new file mode 100644 (file)
index 0000000..691b581
Binary files /dev/null and b/images/background1.jpg differ
diff --git a/images/background2.jpg b/images/background2.jpg
new file mode 100644 (file)
index 0000000..dd4fa6b
Binary files /dev/null and b/images/background2.jpg differ
diff --git a/images/background3.jpg b/images/background3.jpg
new file mode 100644 (file)
index 0000000..1348b1d
Binary files /dev/null and b/images/background3.jpg differ
index 21be125..60e0e54 100644 (file)
@@ -9,7 +9,7 @@
        var h = screen.availHeight;
        viewport_meta.setAttribute('content', 'width=' + w + ', height=' + h + ',user-scalable=no');
 </script>
-<title>SensorBall</title>
+<title>Sensor ball</title>
 <script src="/usr/share/tizen-web-ui-fw/latest/js/jquery.min.js"></script>
 <script
        src="/usr/share/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
@@ -21,9 +21,9 @@
 <script type="text/javascript" src="./js/main.js"></script>
 </head>
 <body>
-       <div data-role="page" id="mainPage" data-add-back-btn="true">
+       <div data-role="page" id="mainPage">
                <div data-role="header" data-position="fixed">
-                       <h1>Sensor Ball</h1>
+                       <h1>Sensor ball</h1>
                </div>
                <div data-role="content" class="background background1"
                        data-scroll="none">
index 131148f..ab18530 100644 (file)
@@ -45,6 +45,7 @@ var app = {
        repulse: 0.6,
        cdd: -0.3,
 
+       timeout: null,
        current: 'ball',
        event: null,
        animationInterval: 40,
@@ -357,7 +358,10 @@ var app = {
                }
 
                // animation - go to next step;
-               setTimeout(this.fun.bind(this), this.animationInterval);
+               if (this.timeout !== null) {
+                       clearTimeout(this.timeout);
+               }
+               this.timeout = setTimeout(this.fun.bind(this), this.animationInterval);
        },
 
        /**
@@ -479,16 +483,12 @@ $(document).ready(function () {
 
        app.fun();
 
-       document.addEventListener('tizenhwkey', function(e) {
-               if (e.keyName == "back") {
+       $(window).on('tizenhwkey', function (e) {
+               if (e.originalEvent.keyName === "back") {
                        tizen.application.getCurrentApplication().exit();
                }
        });
 
-       $('.ui-btn-back').bind('touchstart', function (event) {
-               tizen.application.getCurrentApplication().exit();
-       });
-
        $('#btnBall').bind('tap', function (event) {
                $('#sun').remove();
                app.startBall();
@@ -506,10 +506,11 @@ $(document).ready(function () {
 
        $('#mainPage').on('pageshow', function () {
                app.startBall();
+       });
 
-               // fix for hidden back batton
-               if ($('a.ui-btn-back').is(':hidden')) {
-                       $('#footerControls').removeClass('ui-tabbar-margin-back');
+       document.addEventListener('webkitvisibilitychange', function (event) {
+               if (document.webkitVisibilityState === 'visible') {
+                       app.fun();
                }
        });