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;
+}
<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>
</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>
</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 > Options</h1>
+ <h1>Exercise planner ≫ 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 > Select Workouts</h2>
+ <h2>Exercise planner ≫ 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 > Add Custom Workout</h1>
+ <h1>Exercise planner ≫ 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">
}
});
$('#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);
});
};
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) {
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();
});
$('#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);
});
});
+ ' (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>'
this.config.currentTypeOfPeriods = (this.todayIsWorkday()) ? 'workday' : 'weekend';
this.generateAlarms();
-
this.ui.initialize(onUiInitialize);
};
}());
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;