[ExercisePlanner]Updated Private -> RSA
authorji.ji <ji.ji@samsung.com>
Tue, 9 Jul 2013 10:20:49 +0000 (19:20 +0900)
committerji.ji <ji.ji@samsung.com>
Tue, 9 Jul 2013 10:20:49 +0000 (19:20 +0900)
Change-Id: I74dd8ce4c826d83685bd6853776e52bb65d16a74

css/style.css
index.html
js/UI.js
js/UI.simpleTemplate.js
js/app.js
js/app.timeRange.js

index 6cfacb8..c1679df 100644 (file)
@@ -343,3 +343,16 @@ div.period {
        from {-webkit-transform: rotate(0deg);}
        to {-webkit-transform: rotate(359deg);}
 }
+
+.timeRangeButtons .enableStatusButton {
+       min-width: 95px;
+}
+
+#frontPageContent {
+       padding: 15px;
+       max-width: 450px;
+}
+ul.times .ui-btn-picker {
+       width: 150px;
+       line-height: 70px;
+}
index b497e6e..795adf6 100644 (file)
@@ -6,7 +6,7 @@
 <meta name="description" content="Alerts" />
 <meta name="viewport" content="width=480, user-scalable=no" />
 
-<title>ExercisePlanner</title>
+<title>Exercise planner</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>
@@ -30,9 +30,9 @@
 </head>
 
 <body>
-       <div data-role="page" id="one" data-add-back-btn="footer" data-footer-exist="true">
-               <div data-role="content" data-scroll="none" class="screen">
-                       <div id="logo">Exercise Planner</div>
+       <div data-role="page" id="one" data-footer-exist="true">
+               <div data-role="content" data-scroll="none" class="screen" id="frontPageContent">
+                       <div id="logo">Exercise planner</div>
                        <div id="status"></div>
                        <div class="schedule"></div>
                        <div id="communicate"></div>
@@ -59,9 +59,9 @@
                </div>
        </div>
 
-       <div data-role="page" id="two" data-add-back-btn="footer">
+       <div data-role="page" id="two">
                <div data-role="header" data-position="fixed">
-                       <h1>Exercise Planner &gt; Options</h1>
+                       <h1>Exercise planner &#8811; options</h1>
                </div>
 
                <div data-role="content">
                </div>
        </div>
 
-       <div data-role="page" id="selectExercises" data-add-back-btn="footer">
+       <div data-role="page" id="selectExercises">
                <div data-role="header" data-position="fixed">
-                       <h2>ExercisePlanner &gt; Select Workouts</h2>
+                       <h2>Exercise planner &#8811; select workouts</h2>
                </div>
 
                <div data-role="content">
                        </div>
                </div>
 
-               <div data-role="footer" data-position="fixed"></div>
        </div>
 
-       <div data-role="page" id="customExercises" data-add-back-btn="footer">
+       <div data-role="page" id="customExercises">
                <div data-role="header" data-position="fixed">
-                       <h1>ExercisePlanner &gt; Add Custom Workout</h1>
+                       <h1>Exercise planner &#8811; add custom workout</h1>
                </div>
 
                <div data-role="content">
                        </div>
                </div>
 
-               <div data-role="footer" data-position="fixed"></div>
        </div>
 
-       <div data-role="page" id="rangesOfTimes" data-add-back-btn="footer">
+       <div data-role="page" id="rangesOfTimes">
                <div data-role="header">
                        <h1>Add Time</h1>
                </div>
                                id="updateTime" value="add" />
                </div>
 
-               <div data-role="footer"></div>
        </div>
 
        <div id="progress">
index 0ae6fb4..13d2b34 100644 (file)
--- a/js/UI.js
+++ b/js/UI.js
@@ -81,14 +81,17 @@ function UI() {
                        }
                });
                $('#availableTime :jqmData(name=delete)').on('tap', function (e) {
+                       var value = $(this).data('val');
                        e.stopPropagation();
                        if (self.app.config.trainingEnabled) {
                                alert('You should stop the training first');
                                return;
                        }
-                       if (confirm('Are you sure?')) {
-                               self.app.deleteTimeRange($(this).data('val'));
-                       }
+                       setTimeout(function () {
+                               if (confirm('Are you sure?')) {
+                                       self.app.deleteTimeRange(value);
+                               }
+                       }, 20);
                });
        };
 
@@ -223,6 +226,11 @@ function UI() {
                for (i = 0; i < errors.length; i += 1) {
                        alert(errors[i].name);
                }
+               this.unblockButtons();
+       };
+
+       UI.prototype.unblockButtons = function () {
+               $('#btnNewExercise').data('disabled', false);
        };
 
        UI.prototype.showAlarmInMonitor = function (data) {
@@ -396,7 +404,13 @@ function UI() {
                                self.app.changeTypeOfPeriods('weekend');
                        });
 
-                       $('#addTimeRange').on('tap', self.editTimeRange.bind(self, -1));
+                       $('#addTimeRange').on('tap', function (e) {
+                               if (self.app.config.trainingEnabled) {
+                                       alert('You should stop the training first');
+                               } else {
+                                       self.editTimeRange(-1, e);
+                               }
+                       });
 
                        self.app.updateTimesRanges();
                        self.configToUI();
@@ -412,20 +426,27 @@ function UI() {
                });
 
                $('#customExercises').on('pageinit', function (page, options) {
-                       $('#btnNewExercise').on('tap', self.addExercise.bind(self));
+                       $('#btnNewExercise').on('tap', function (e) {
+                               e.preventDefault();
+                               e.stopPropagation();
+                               if ($(this).data('disabled') !== true) {
+                                       $(this).data('disabled', true);
+                                       self.addExercise();
+                               }
+                       });
                });
 
                $('#customExercises').on('pageshow', function (page, options) {
-                       self.fixPageHeight('#customExercises');
+                       self.unblockButtons();
 
                        $('#newExerciseName').val('');
-                       $('#newExerciseName').trigger('focus');
                });
 
                $('#rangesOfTimes').on('pageinit', function (page, options) {
                        $("#updateTime").on("click", function (e) {
                                e.preventDefault();
                                e.stopPropagation();
+                               self.startProgress('Saving');
                                self.editTimeRangeAction(self.app.currentEditingTimePeriodId);
                        });
                });
index 1b5f89c..b3b70f9 100644 (file)
@@ -6,7 +6,7 @@
                        + ' (Duration: ' + obj.duration + 'h) ' + obj.style + '</div>'
                        + '<div class="timeRangeButtons">'
                        + '<div data-role="button" data-inline="true" data-name="edit" data-val="' + obj.nr + '">Edit</div>'
-                       + '<div data-role="button" data-inline="true" data-name="disable" data-val="' + obj.nr + '">'
+                       + '<div data-role="button" class="enableStatusButton" data-inline="true" data-name="disable" data-val="' + obj.nr + '">'
                        + ((obj.enabled) ? 'Dis' : 'En') + 'able</div>'
                        + '<div data-role="button" data-inline="true" data-name="delete" data-val="' + obj.nr + '">Delete</div>'
                        + '<div class="activeStatus' + ((obj.enabled) ? '' : ' activeStatusDisable') + '" data-inline="true">' + ((obj.enabled) ? 'En' : 'Dis') + 'abled</div>'
index 071a3c6..d66e17f 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -444,7 +444,6 @@ var ExercisePlanner = function () {
                this.config.currentTypeOfPeriods = (this.todayIsWorkday()) ? 'workday' : 'weekend';
 
                this.generateAlarms();
-
                this.ui.initialize(onUiInitialize);
        };
 }());
index 0cb045e..10b3680 100644 (file)
@@ -62,7 +62,6 @@
                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;