--- /dev/null
+<?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>
<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>
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) {
// 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);
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) {
});
$('#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');
});
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');
});
});
$('#rangesOfTimes').on('pageshow', function (page, options) {
+ self.fixPageHeight('#rangesOfTimes');
+
$('#updateTime').data('button').refresh();
self.fillTimeRangeForm(self.app.currentEditingTimePeriod);
});
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();
+ };
}());