From: ji.ji Date: Wed, 26 Jun 2013 10:08:42 +0000 (+0900) Subject: Updated Private -> RSA X-Git-Tag: 2.2_release~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1d9a2756a36a6b21d1af6db880bc0ad10f4df7cc;p=samples%2Fweb%2FExercisePlanner.git Updated Private -> RSA Change-Id: I84b0f31bf16330931c9ee1de1015bb07a787c69b --- diff --git a/.gitingore b/.gitingore new file mode 100644 index 0000000..9f778b1 --- /dev/null +++ b/.gitingore @@ -0,0 +1,2 @@ +*.wgt +.build diff --git a/.project b/.project new file mode 100755 index 0000000..b2cd8a9 --- /dev/null +++ b/.project @@ -0,0 +1,56 @@ + + + ExercisePlanner + + + + + + 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.tizen.web.project.builder.WebNature + + diff --git a/config.xml b/config.xml index 7ae0917..6a09b54 100644 --- a/config.xml +++ b/config.xml @@ -1,6 +1,6 @@ - - + + ExercisePlanner diff --git a/css/style.css b/css/style.css index 5328f2d..6cfacb8 100644 --- a/css/style.css +++ b/css/style.css @@ -82,6 +82,10 @@ 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);} +} diff --git a/index.html b/index.html index e1b39c3..b497e6e 100644 --- a/index.html +++ b/index.html @@ -31,15 +31,13 @@
-
-
- -
-
-
-
-
-
+
+ +
+
+
+
+
@@ -134,7 +132,7 @@
-
+
@@ -225,5 +223,13 @@
+
+
+
+
+
+
+
+ diff --git a/js/UI.js b/js/UI.js index 530f0df..0ae6fb4 100644 --- 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(); + }; }()); diff --git a/js/app.timeRange.js b/js/app.timeRange.js index cd418d9..0cb045e 100644 --- a/js/app.timeRange.js +++ b/js/app.timeRange.js @@ -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; };