From 9e5b8e83b0d5e715b7f2718f725a5d687ffd25cf Mon Sep 17 00:00:00 2001 From: Piotr Wronski Date: Mon, 2 Jun 2014 23:13:14 -0700 Subject: [PATCH] Revert "Updated application sources" This reverts commit 9f534dbf61a97a5340d85c28062a157528a08cd2. Change-Id: I4fefc0c20d43915a37b4f0aaa87b98232df9cccc --- project/.project | 108 +++++++++++++++++++++++----------------------- project/NOTICE | 1 + project/config.xml | 38 ++++++---------- project/css/style.css | 111 ++++++++++++++++++++++++----------------------- project/index.html | 33 ++++++-------- project/js/main.js | 117 ++++++++++++++++++++------------------------------ 6 files changed, 182 insertions(+), 226 deletions(-) diff --git a/project/.project b/project/.project index 225950d..b5f20b0 100644 --- a/project/.project +++ b/project/.project @@ -1,57 +1,57 @@ - Compass - - - - - - org.eclipse.wst.common.project.facet.core.builder - - - - - org.eclipse.wst.jsdt.core.javascriptValidator - - - - - json.validation.builder - - - - - org.tizen.web.jslint.nature.JSLintBuilder - - - - - org.tizen.web.css.nature.CSSBuilder - - - - - org.eclipse.wst.validation.validationbuilder - - - - - org.tizen.web.project.builder.WebBuilder - - - usedLibraryType - WebUIFramework - - - - - - json.validation.nature - org.tizen.web.jslint.nature.JSLintNature - org.tizen.web.css.nature.CSSNature - org.eclipse.wst.jsdt.core.jsNature - org.eclipse.wst.common.project.facet.core.nature - org.eclipse.wst.common.modulecore.ModuleCoreNature - org.tizen.web.project.builder.WebNature - + Compass + + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.wst.jsdt.core.javascriptValidator + + + + + json.validation.builder + + + + + org.tizen.web.jslint.nature.JSLintBuilder + + + + + org.tizen.web.css.nature.CSSBuilder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + org.tizen.web.project.builder.WebBuilder + + + usedLibraryType + WebUIFramework + + + + + + json.validation.nature + org.tizen.web.jslint.nature.JSLintNature + org.tizen.web.css.nature.CSSNature + org.eclipse.wst.jsdt.core.jsNature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.tizen.web.project.builder.WebNature + diff --git a/project/NOTICE b/project/NOTICE index e5d95db..092bc04 100644 --- a/project/NOTICE +++ b/project/NOTICE @@ -1,3 +1,4 @@ Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. Except as noted, this software is licensed under Flora License, Version 1.1 Please, see the LICENSE.Flora file for Flora License, Version 1.1 terms and conditions. + diff --git a/project/config.xml b/project/config.xml index e66a939..7bd0b13 100644 --- a/project/config.xml +++ b/project/config.xml @@ -1,28 +1,14 @@ - - - - - - - - - Compass - - - - - + + + + + Compass + + diff --git a/project/css/style.css b/project/css/style.css index df7c43c..a8a46e8 100644 --- a/project/css/style.css +++ b/project/css/style.css @@ -1,69 +1,68 @@ html, body { - margin: 0px; - padding: 0px; - overflow: hidden; - background: black; - -webkit-user-select: none; + margin: 0px; + padding: 0px; + overflow: hidden; + background: black; } #application { - position: absolute; - margin: 0px; - padding: 0px; - left: 0px; - top: 0px; - right: 0px; - bottom: 0px; - background-image: url('../images/compass_bg_new.png'); - background-repeat: no-repeat; - background-position: right top; - overflow: hidden; + position: absolute; + margin: 0px; + padding: 0px; + left: 0px; + top: 0px; + right: 0px; + bottom: 0px; + background-image: url('../images/compass_bg_new.png'); + background-repeat: no-repeat; + background-position: right top; + overflow: hidden; } -#rotation { - position: absolute; - left: 44px; - top: 351px; - background-image: url('../images/compass_rotation.png'); - background-repeat: no-repeat; - width: 392px; - height: 392px; - -webkit-transition: all 0.7s ease-out; - -webkit-transform: rotate(0deg); +#rotation{ + position: absolute; + left: 44px; + top: 351px; + background-image: url('../images/compass_rotation.png'); + background-repeat: no-repeat; + width: 392px; + height: 392px; + -webkit-transition: all 0.7s ease-out; + -webkit-transform: rotate(0deg); } -#shadow { - position: absolute; - left: 44px; - top: 351px; - background-image:url('../images/compass_cover.png'); - background-repeat: no-repeat; - width: 392px; - height: 392px; +#shadow{ + position: absolute; + left: 44px; + top: 351px; + background-image:url('../images/compass_cover.png'); + background-repeat: no-repeat; + width: 392px; + height: 392px; } -#direction { - position: absolute; - left: 44px; - top: 95px ; - width: 392px; - height: 37px; - text-align: center; - font-weight: bold; - color: #FFFFFF; - font-family: sans-serif; - font-size: 30pt; +#direction{ + position: absolute; + left: 44px; + top: 95px ; + width: 392px; + height: 37px; + text-align: center; + font-weight: bold; + color: #FFFFFF; + font-family: verdana; + font-size: 30pt; } -#angle { - position: absolute; - left: 44px; - top: 120px ; - width: 392px; - height: 70px; - text-align: center; - font-weight: bold; - color: #FFFFFF; - font-family: sans-serif; - font-size: 55pt; +#angle{ + position: absolute; + left: 44px; + top: 120px ; + width: 392px; + height: 70px; + text-align: center; + font-weight: bold; + color: #FFFFFF; + font-family: verdana; + font-size: 55pt; } diff --git a/project/index.html b/project/index.html index 0318ae2..9660f44 100644 --- a/project/index.html +++ b/project/index.html @@ -1,26 +1,19 @@ - - - - - Compass - - - - - - + + +Compass + + + - -
-
-
-
-
-
- +
+
+
+
+
+
- + \ No newline at end of file diff --git a/project/js/main.js b/project/js/main.js index b004055..368a30d 100644 --- a/project/js/main.js +++ b/project/js/main.js @@ -16,89 +16,66 @@ /*global document, window, tizen, $*/ -// application data: -var lastAngle = -1, // last measurement - rotation = 0; // compass rotation +var angleMemory = -1, + rotation = 0; -/** - * Function handles new orientation data received from the device. - * - * @param eventData deviceorientation event containing new orientation data - */ -function onDeviceOrientation(eventData) { - 'use strict'; - // check if the angle has changed from the previous measurement - if (eventData.alpha !== lastAngle) { - var angle = eventData.alpha, - deltaAngle, - text = ''; +function onDeviceOrientation(dataEvent) { + "use strict"; + if (dataEvent.alpha !== angleMemory) { + var angle = dataEvent.alpha, + deltaAngle, + text = ''; - // find direction from given angle - if (angle < 68 || angle > 292) { - text += 'NORTH'; - } else if (angle > 112 && angle < 248) { - text += 'SOUTH'; - } - if (angle > 22 && angle < 158) { - text += 'EAST'; - } else if (angle > 202 && angle < 338) { - text += 'WEST'; - } + if (angle < 68 || angle > 292) { + text += 'NORTH'; + } else if (angle > 112 && angle < 248) { + text += 'SOUTH'; + } + if (angle > 22 && angle < 158) { + text += 'EAST'; + } else if (angle > 202 && angle < 338) { + text += 'WEST'; + } - // check angle change and calculate the rotation of the compass - deltaAngle = lastAngle - angle; - if (Math.abs(deltaAngle) > 180) { - if (deltaAngle > 0) { - rotation -= ((360 - lastAngle) + angle); - } else { - rotation += (lastAngle + (360 - angle)); - } - } else { - rotation += deltaAngle; - } + deltaAngle = angleMemory - angle; + if (Math.abs(deltaAngle) > 180) { + if (deltaAngle > 0) { + rotation -= ((360 - angleMemory) + angle); + } else { + rotation += (angleMemory + (360 - angle)); + } + } else { + rotation += deltaAngle; + } - // save current measurement - lastAngle = angle; + angleMemory = angle; - // update the direction and angle labels - $('#direction').text(text); - $('#angle').html(Math.round(angle) + 'o'); - // rotate the compass image - $('#rotation').css('-webkit-transform', 'rotate(' + rotation + 'deg)'); - } + $('#direction').text(text); + $("#angle").html(Math.round(angle) + "o"); + $('#rotation').css('-webkit-transform', 'rotate(' + rotation + 'deg)'); + } } -/** - * Function for binding device orientation changes to handler. - */ function startSensor() { - 'use strict'; - // bind device orientation changes to handler function - window.addEventListener('deviceorientation', onDeviceOrientation, false); + "use strict"; + window.addEventListener("deviceorientation", onDeviceOrientation, false); } -/** - * Function binding UI events. - */ -function bindEvents() { - 'use strict'; - window.addEventListener('tizenhwkey', function (e) { - if (e.keyName === 'back') { - tizen.application.getCurrentApplication().exit(); - } - }); +function hdExitButton() { + "use strict"; + window.addEventListener('tizenhwkey', function(e) { + if (e.keyName == "back") { + tizen.application.getCurrentApplication().exit(); + } + }); } -/** - * Function for initializing the application. - */ function init() { - 'use strict'; - // bind UI events - bindEvents(); - // begin reading compass - startSensor(); + "use strict"; + hdExitButton(); + startSensor(); } -// initialize application when the document is ready + + $(document).ready(init); -- 2.7.4