Updated Private -> RSA
authorji.ji <ji.ji@samsung.com>
Wed, 26 Jun 2013 10:08:42 +0000 (19:08 +0900)
committerji.ji <ji.ji@samsung.com>
Wed, 26 Jun 2013 10:08:42 +0000 (19:08 +0900)
Change-Id: I84b0f31bf16330931c9ee1de1015bb07a787c69b

.gitingore [new file with mode: 0644]
.project [new file with mode: 0755]
config.xml
css/style.css
index.html
js/UI.js
js/app.timeRange.js

diff --git a/.gitingore b/.gitingore
new file mode 100644 (file)
index 0000000..9f778b1
--- /dev/null
@@ -0,0 +1,2 @@
+*.wgt
+.build
diff --git a/.project b/.project
new file mode 100755 (executable)
index 0000000..b2cd8a9
--- /dev/null
+++ b/.project
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>ExercisePlanner</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.wst.common.project.facet.core.builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>json.validation.builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.tizen.web.jslint.nature.JSLintBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.tizen.web.css.nature.CSSBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.wst.validation.validationbuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.tizen.web.project.builder.WebBuilder</name>
+                       <arguments>
+                               <dictionary>
+                                       <key>usedLibraryType</key>
+                                       <value>WebUIFramework</value>
+                               </dictionary>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>json.validation.nature</nature>
+               <nature>org.tizen.web.jslint.nature.JSLintNature</nature>
+               <nature>org.tizen.web.css.nature.CSSNature</nature>
+               <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
+               <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+               <nature>org.tizen.web.project.builder.WebNature</nature>
+       </natures>
+</projectDescription>
index 7ae0917..6a09b54 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://sample-web-application.tizen.org/ExercisePlanner" version="2.1.0" viewmodes="maximized">
-       <tizen:application id="zED1oRD3Hv.ExercisePlanner" package="zED1oRD3Hv" required_version="2.1"/>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://sample-web-application.tizen.org/ExercisePlanner" version="2.2.0" viewmodes="maximized">
+       <tizen:application id="zED1oRD3Hv.ExercisePlanner" package="zED1oRD3Hv" required_version="2.2"/>
        <content src="index.html"/>
        <icon src="icon.png"/>
        <name>ExercisePlanner</name>
index 5328f2d..6cfacb8 100644 (file)
        display: none;
 }
 
+.typeOfPeriods, .typeOfPeriods ul li {
+       height:60px;
+}
+
 .strength {
        margin: 0 0 20px 0;
 }
@@ -120,6 +124,7 @@ h2.ui-title {
        width:99%;
        text-overflow: ellipsis;
 }
+
 /**
  * Removing disturbing paddings from wide button
  **/
@@ -134,6 +139,11 @@ h2.ui-title {
 }
 
 /**
+* Removing unnecessary line before the first button
+**/
+#workdaysType span.ui-btn-inner.ui-btn-hastxt {
+    border-left: none;
+}
 
 old styles;
 
@@ -294,11 +304,42 @@ div.period {
        padding-left: 10px;
 }
 
-.ui-header .ui-title,
-.ui-footer .ui-btn-text {
-       text-transform: uppercase;
-}
-
 .center {
        text-align: center;
 }
+
+#progress {
+       display: none;
+       z-index: 1001;
+       position: absolute;
+       top: 0;
+       left: 0;
+       height: 100%;
+       width: 100%;
+       background-color: rgba(0, 2, 0, 0.7);
+}
+#progresscenter {
+       position:absolute;
+       width:100%;
+       top: 40%;
+}
+#progresstitle {
+       color:#FFF;
+       text-align:center;
+       margin-bottom: 20px;
+}
+#progressbar {
+       display:none;
+}
+#loader {
+       margin: 0 auto;
+       width:35px;
+       height: 35px;
+}
+#loader-image {
+       -webkit-animation: rotation 2s infinite linear;
+}
+@-webkit-keyframes rotation {
+       from {-webkit-transform: rotate(0deg);}
+       to {-webkit-transform: rotate(359deg);}
+}
index e1b39c3..b497e6e 100644 (file)
 
 <body>
        <div data-role="page" id="one" data-add-back-btn="footer" data-footer-exist="true">
-               <div data-role="content" data-scroll="none">
-                       <div class="screen">
-                               <div id="logo">EXERCISE PLANNER</div>
-                               <div id="status"></div>
-                               <div class="schedule"></div>
-                               <div id="communicate"></div>
-                               <div id="sentence"></div>
-                               <div id="signature"></div>
-                       </div>
+               <div data-role="content" data-scroll="none" class="screen">
+                       <div id="logo">Exercise Planner</div>
+                       <div id="status"></div>
+                       <div class="schedule"></div>
+                       <div id="communicate"></div>
+                       <div id="sentence"></div>
+                       <div id="signature"></div>
                </div>
 
                <div data-role="footer" data-position="fixed">
                </div>
 
                <div data-role="footer" data-position="fixed">
-                       <div data-role="tabbar" data-style="toolbar">
+                       <div id="selectExercisesBar" data-role="tabbar" data-style="toolbar">
                                <ul>
                                        <li><a href="#selectExercises">Select Workouts</a></li>
                                </ul>
                <div data-role="footer"></div>
        </div>
 
+       <div id="progress">
+               <div id="progresscenter">
+                       <div id="progresstitle"></div>
+                       <div id="progressbar"></div>
+                       <div id="loader"><img id="loader-image" src="/usr/share/tizen-web-ui-fw/latest/themes/tizen-white/images/ajax-loader.png"/></div>
+               </div>
+       </div>
+
 </body>
 </html>
index 530f0df..0ae6fb4 100644 (file)
--- a/js/UI.js
+++ b/js/UI.js
@@ -304,6 +304,16 @@ function UI() {
                        self.app.appStartStop();
                });
 
+               document.addEventListener('tizenhwkey', function(e) {
+                       if (e.keyName == 'back') {
+                               if ($.mobile.activePage.attr('id') === 'one') {
+                                       tizen.application.getCurrentApplication().exit();
+                               } else {
+                                       history.back();
+                               }
+                       }
+               });
+
                $('#one').on(
                        'pageshow',
                        function (page, options) {
@@ -322,19 +332,15 @@ function UI() {
 
                                // workaround for scroll lock;
                                $.mobile.activePage.css('position', 'fixed');
+
+                               if ($('a.ui-btn-back').is(':hidden')) {
+                                       $('div#mainControl').removeClass('ui-tabbar-margin-back');
+                               }
                        }
                );
 
                $('#two').on('pageshow', function (page, options) {
-
-                       //FIXME (two scrollbar workaround)
-                       setTimeout(
-                               function () {
-                                       var newHeight = $('#two').find('[data-role="content"]').prop('style').height;
-                                       $('#two').css({'min-height': newHeight, 'height': newHeight});
-                               },
-                               0
-                       );
+                       self.fixPageHeight('#two');
 
                        if (self.graphSchedule.ui) {
                                $('#two .scheduleOptions').append(self.graphSchedule.ui);
@@ -342,12 +348,21 @@ function UI() {
                                self.graphSchedule.setVisibleWeekend(true);
                                self.graphSchedule.setVisibleWorkdays(true);
                        }
+
+                       if ($('a.ui-btn-back').is(':hidden')) {
+                               $('div#selectExercisesBar').removeClass('ui-tabbar-margin-back');
+                       }
                });
 
                $('#two').on('pageinit', function (page, options) {
                        $('.ui-radio input', $('#frequency')).change(function (ev) {
-                               self.app.setFrequency(this.value);
-                               self.updateMainUI();
+                               var that = this;
+                               self.startProgress();
+                               setTimeout(function (){
+                                       self.app.setFrequency(that.value);
+                                       self.updateMainUI();
+                                       self.endProgress();
+                               }, 100);
                        });
 
                        $('.ui-radio input', $('#strength')).change(function (ev) {
@@ -364,10 +379,20 @@ function UI() {
                        });
 
                        $('#workdaysType').on('tap', function (ev) {
+                               var that = $(this).children("a");
+                               setTimeout(function(){
+                                       that.removeClass("ui-btn-active");
+                               }, 400);
+
                                self.app.changeTypeOfPeriods('workday');
                        });
 
                        $('#weekendType').on('tap', function (ev) {
+                               var that = $(this).children("a");
+                               setTimeout(function(){
+                                       that.removeClass("ui-btn-active");
+                               }, 400);
+
                                self.app.changeTypeOfPeriods('weekend');
                        });
 
@@ -382,11 +407,17 @@ function UI() {
                        self.configToUI();
                });
 
+               $('#selectExercises').on('pageshow', function (page, options) {
+                       self.fixPageHeight('#selectExercises');
+               });
+
                $('#customExercises').on('pageinit', function (page, options) {
                        $('#btnNewExercise').on('tap', self.addExercise.bind(self));
                });
 
                $('#customExercises').on('pageshow', function (page, options) {
+                       self.fixPageHeight('#customExercises');
+
                        $('#newExerciseName').val('');
                        $('#newExerciseName').trigger('focus');
                });
@@ -400,6 +431,8 @@ function UI() {
                });
 
                $('#rangesOfTimes').on('pageshow', function (page, options) {
+                       self.fixPageHeight('#rangesOfTimes');
+
                        $('#updateTime').data('button').refresh();
                        self.fillTimeRangeForm(self.app.currentEditingTimePeriod);
                });
@@ -441,9 +474,30 @@ function UI() {
                this.fixContentHeight();
        };
 
+       UI.prototype.fixPageHeight = function (element) {
+               //FIXME (two scrollbar workaround)
+               setTimeout(
+                       function () {
+                               var newHeight = $(element).find('[data-role="content"]').prop('style').height;
+                               $(element).css({'min-height': newHeight, 'height': newHeight});
+                       },
+                       0
+               );
+       };
+
        UI.prototype.fixContentHeight = function () {
                var contentHeight = screen.availHeight - $('div[data-role="header"]').outerHeight() - $('div[data-role="footer"]').outerHeight();
                $('div[data-role="content"]').css('height', contentHeight);
        };
 
+       UI.prototype.startProgress = function (title) {
+               title = title || "Updating schedule";
+               $("#progress").show();
+               $("#progresstitle").text(title);
+               $("#progressbar").progressbar({value: false});
+       };
+
+       UI.prototype.endProgress = function () {
+               $("#progress").fadeOut();
+       };
 }());
index cd418d9..0cb045e 100644 (file)
@@ -62,6 +62,7 @@
                var index = -1,
                        errors = this.checkNewTimeRange(timeRange.start, timeRange.duration, timeRange.style);
 
+               this.ui.startProgress("Adding time");
                // new timeRanges has nr === -1; this mean we must get max number from config
                if (nr === -1) {
                        nr = this.getMaxNrOfTimeRange() + 1;
@@ -88,6 +89,7 @@
                this.generateAlarms();
                this.updateGraph();
 
+               this.ui.endProgress();
                return true;
        };