Commit e7b15bbb authored by Curtis Adam's avatar Curtis Adam

Add an option to set a fixed pomodoro for an active bonus

parent 30039aa3
......@@ -423,10 +423,6 @@ $themes: (
$pomodoro_timer_arc: map-get($map, "pomodoro_timer_arc");
$pomodoro_timer_arc_progress: map-get($map, "pomodoro_timer_arc_progress");
$pomodoro_timer_arc_break: map-get($map, "pomodoro_timer_arc_break");
$pomodoro_timer_bold_text: map-get($map, "pomodoro_timer_bold_text");
$pomodoro_timer_label: map-get($map, "pomodoro_timer_label");
$pomodoro_timer_text: map-get($map, "pomodoro_timer_text");
$pomodoro_timer_title: map-get($map, "pomodoro_timer_title");
.star-ratings .current-rating {
color: $current_rating !important;
}
......@@ -2466,14 +2462,6 @@ $themes: (
//pomodoro
.pomodoroTimer {
.pomodoroInstructions {
color: $pomodoro_timer_text !important;
}
h3 {
color: $pomodoro_timer_title !important;
}
a:visited {
color: $hyperlink !important;
}
......@@ -2505,14 +2493,6 @@ $themes: (
.progressArc {
stroke: $pomodoro_timer_arc_progress !important;
}
b {
color: $pomodoro_timer_bold_text !important;
}
label {
color: $pomodoro_timer_label !important;
}
}
}
}
......@@ -432,10 +432,6 @@
"pomodoro_timer_hand_min":white,
"pomodoro_timer_arc":$thm_orange,
"pomodoro_timer_arc_progress":$thm_red,
"pomodoro_timer_arc_break":$thm_dark_blue,
"pomodoro_timer_bold_text": $thm_red,
"pomodoro_timer_label": $thm_dark_blue,
"pomodoro_timer_text": white,
"pomodoro_timer_title": $thm_orange
"pomodoro_timer_arc_break":$thm_dark_blue
);
}
......@@ -434,10 +434,6 @@
"pomodoro_timer_hand_min":white,
"pomodoro_timer_arc":$thm_orange,
"pomodoro_timer_arc_progress":$thm_red,
"pomodoro_timer_arc_break":$thm_dark_blue,
"pomodoro_timer_bold_text": $thm_red,
"pomodoro_timer_label": $thm_dark_blue,
"pomodoro_timer_text": white,
"pomodoro_timer_title": $thm_orange
"pomodoro_timer_arc_break":$thm_dark_blue
);
}
import {Session} from "meteor/session";
import {Cardsets} from "./cardsets";
import {PomodoroTimer} from "./pomodoroTimer";
let minWorkloadCap = 1;
let defaultMaxWorkload = 30;
......@@ -155,13 +156,27 @@ export let BonusForm = class BonusForm {
}
static startBonus () {
Meteor.call("activateBonus", Session.get('activeCardset')._id, this.getMaxWorkload(), this.getDaysBeforeReset(), this.getDateStart(), this.getDateEnd(), this.getIntervals(), this.getRegistrationPeriod());
Meteor.call("activateBonus", Session.get('activeCardset')._id, this.getMaxWorkload(), this.getDaysBeforeReset(), this.getDateStart(), this.getDateEnd(), this.getIntervals(), this.getRegistrationPeriod(), function (error, result) {
if (result) {
Session.set('activeCardset', Cardsets.findOne(result));
Meteor.call("updateBonusPomodoroTimer", Session.get('activeCardset')._id, PomodoroTimer.getGoalPoms(), PomodoroTimer.getPomLength(), PomodoroTimer.getBreakLength(), PomodoroTimer.getSoundConfig(), function (error, result) {
if (result) {
Session.set('activeCardset', Cardsets.findOne(result));
}
});
}
});
}
static updateBonus () {
Meteor.call("updateBonus", Session.get('activeCardset')._id, this.getMaxWorkload(), this.getDaysBeforeReset(), this.getDateStart(), this.getDateEnd(), this.getIntervals(), this.getRegistrationPeriod(), function (error, result) {
if (result) {
Session.set('activeCardset', Cardsets.findOne(result));
Meteor.call("updateBonusPomodoroTimer", Session.get('activeCardset')._id, PomodoroTimer.getGoalPoms(), PomodoroTimer.getPomLength(), PomodoroTimer.getBreakLength(), PomodoroTimer.getSoundConfig(), function (error, result) {
if (result) {
Session.set('activeCardset', Cardsets.findOne(result));
}
});
}
});
}
......
......@@ -210,6 +210,11 @@ const CardsetsSchema = new SimpleSchema({
},
noDifficulty: {
type: Boolean
},
pomodoroTimer: {
type: Object,
optional: true,
blackbox: true
}
});
......@@ -473,6 +478,7 @@ Meteor.methods({
registrationPeriod: registrationPeriod
}
});
return cardset._id;
} else {
throw new Meteor.Error("not-authorized");
}
......
......@@ -220,6 +220,7 @@ if (Meteor.isServer) {
* */
updateLearnerCount: function (cardset_id) {
check(cardset_id, String);
// Make sure the user is logged in
if (!Meteor.isServer) {
throw new Meteor.Error("not-authorized");
} else {
......@@ -229,6 +230,37 @@ if (Meteor.isServer) {
}
});
}
},
/** Updates the pomodoro settings for a cardsets bonus mode
* @param {string} cardset_id - The cardset id of the cardset that is getting updated
* @param {Number} pomodoroTimerQuantity - The amount of pomodoro runs for bonus users
* @param {Number} pomodoroTimerWorkLength - How many minutes are bonus users supposed to work
* @param {Number} pomodoroTimerBreakLength - How long is the break
* @param {[Boolean]} pomodoroTimerSoundConfig - Which sounds are enabled
* */
updateBonusPomodoroTimer: function (cardset_id, pomodoroTimerQuantity, pomodoroTimerWorkLength, pomodoroTimerBreakLength, pomodoroTimerSoundConfig) {
check(cardset_id, String);
check(pomodoroTimerQuantity, Number);
check(pomodoroTimerWorkLength, Number);
check(pomodoroTimerBreakLength, Number);
check(pomodoroTimerSoundConfig, [Boolean]);
if (!Meteor.userId() || Roles.userIsInRole(this.userId, ["firstLogin", "blocked"])) {
throw new Meteor.Error("not-authorized");
}
let cardset = Cardsets.findOne({_id: cardset_id}, {fields: {_id: 1, owner: 1}});
if (cardset.owner === Meteor.userId() || Roles.userIsInRole(this.userId, ["admin", "editor"])) {
Cardsets.update({_id: cardset._id}, {
$set: {
'pomodoroTimer.quantity': pomodoroTimerQuantity,
'pomodoroTimer.workLength': pomodoroTimerWorkLength,
'pomodoroTimer.breakLength': pomodoroTimerBreakLength,
'pomodoroTimer.soundConfig': pomodoroTimerSoundConfig
}
});
return cardset._id;
} else {
throw new Meteor.Error("not-authorized");
}
}
});
}
import {Session} from "meteor/session";
import {Bonus} from "./bonus.js";
import {Cardsets} from "./cardsets.js";
import {Route} from "./route.js";
Session.set('pomodoroBreakActive', false);
/*This is a ton of script, mostly popups, so strap in for a wild ride!*/
/*endPom is the angle of the minute hand at which the work period will end.*/
let endPom = 0;
let defaultEndPom = 0;
let endPom = defaultEndPom;
/*the angle at which the break will end*/
let endBreak = 0;
let defaultEndBreak = 0;
let endBreak = defaultEndBreak;
/*the number of cycles completed since beginning the session*/
let totalPoms = 0;
let defaultTotalPoms = 0;
let totalPoms = defaultTotalPoms;
/*what goal was set in the session begin popup. default one.*/
let goalPoms = 1;
let defaultGoalPoms = 1;
let goalPoms = defaultGoalPoms;
/*this is the beginning of the red progress tracking arc*/
let pomBeginAngle = 0;
let breakBeginAngle = 0;
/*how long to work in each cycle*/
let pomLength = 25;
let defaultPomLength = 25;
let pomLength = defaultPomLength;
/*how long to break each cycle*/
let breakLength = 5;
let defaultBreakLength = 5;
let breakLength = defaultBreakLength;
/*is it running?*/
let pomRunning = false;
let breakRunning = false;
let defaultPomRunning = false;
let pomRunning = defaultPomRunning;
let defaultBreakRunning = false;
let breakRunning = defaultBreakRunning;
let isClockInBigmode = false;
let cloudShown = true;
//which pomodoro sound
let isBellSoundEnabled = true;
let isSuccessSoundEnabled = true;
let isFailSoundEnabled = true;
let DefaultIsBellSoundEnabled = true;
let DefaultIsSuccessSoundEnabled = true;
let DefaultIsFailSoundEnabled = true;
let isBellSoundEnabled = DefaultIsBellSoundEnabled;
let isSuccessSoundEnabled = DefaultIsSuccessSoundEnabled;
let isFailSoundEnabled = DefaultIsFailSoundEnabled;
let bellSound = new Audio('/audio/Schulgong.mp3');
let failSound = new Audio('/audio/fail.mp3');
......@@ -332,22 +345,22 @@ export let PomodoroTimer = class PomodoroTimer {
});
}
} else {
/*and if you're not currently in a session, this activates the starting pop up*/
$("#pomodoroTimerModal").modal();
if (!Bonus.isInBonus(Router.current().params._id)) {
/*and if you're not currently in a session, this activates the starting pop up*/
$("#pomodoroTimerModal").modal();
}
}
}
/*gets the goal number of pomodoros*/
static updatePomNumSlider () {
$('#pomQuantity').val($('#pomNumSlider').val());
$('#pomodoroCount').html($('#pomNumSlider').val());
goalPoms = $('#pomNumSlider').val();
this.updateTimeParagraph();
}
static updatePomQuantity () {
$('#pomNumSlider').val($('#pomQuantity').val());
goalPoms = $('#pomQuantity').val();
this.updateTimeParagraph();
static getGoalPoms () {
return parseInt($('#pomNumSlider').val());
}
/*hides the goal box, shows the place where you can change the pomodoro length*/
......@@ -362,49 +375,81 @@ export let PomodoroTimer = class PomodoroTimer {
}
/*when you update the work slider or input box or the break ones, it updates the total time and makes sure you didn't go over 60 minutes total work and break time per cycle. I could probably refactor all the following code. Someday!*/
static updateWorkLength () {
$('#workSlider').val($('#workLength').val());
pomLength = parseInt($('#workLength').val(), 10);
if (pomLength + breakLength > 60) {
breakLength = 60 - pomLength;
$('#playLength').val(breakLength);
$('#playSlider').val(breakLength);
}
this.updateTimeParagraph();
}
static updateWorkSlider () {
$('#workLength').val($('#workSlider').val());
$('#workLength').html($('#workSlider').val());
pomLength = parseInt($('#workSlider').val(), 10);
if (pomLength + breakLength > 60) {
breakLength = 60 - pomLength;
$('#playLength').val(breakLength);
$('#playSlider').val(breakLength);
$('#breakLength').html(breakLength);
$('#breakSlider').val(breakLength);
}
this.updateTimeParagraph();
}
static updatePlayLength () {
$('#playSlider').val($('#playLength').val());
breakLength = parseInt($('#playLength').val(), 10);
static getPomLength () {
return parseInt($('#workSlider').val(), 10);
}
static updateBreakSlider () {
$('#breakLength').html($('#breakSlider').val());
breakLength = parseInt($('#breakSlider').val(), 10);
if (pomLength + breakLength > 60) {
pomLength = 60 - breakLength;
$('#workLength').val(pomLength);
$('#workLength').html(pomLength);
$('#workSlider').val(pomLength);
}
this.updateTimeParagraph();
}
static updatePlaySlider () {
$('#playLength').val($('#playSlider').val());
breakLength = parseInt($('#playSlider').val(), 10);
if (pomLength + breakLength > 60) {
pomLength = 60 - breakLength;
$('#workLength').val(pomLength);
$('#workSlider').val(pomLength);
static getBreakLength () {
return parseInt($('#breakSlider').val(), 10);
}
static getSoundConfig () {
return [isBellSoundEnabled, isSuccessSoundEnabled, isFailSoundEnabled];
}
static initializeModalContent () {
$('#pomNumSlider').val(goalPoms);
this.updatePomNumSlider();
$('#workSlider').val(pomLength);
this.updateWorkSlider();
$('#breakSlider').val(breakLength);
this.updateBreakSlider();
}
static initializeVariables () {
Session.set('pomodoroBreakActive', false);
totalPoms = defaultTotalPoms;
endPom = defaultEndPom;
endBreak = defaultEndBreak;
pomRunning = defaultPomRunning;
breakRunning = defaultBreakRunning;
if (((Route.isBox() || Route.isMemo()) && Bonus.isInBonus(Router.current().params._id)) || Route.isCardset()) {
let cardset = Cardsets.findOne({_id: Router.current().params._id});
if (cardset.pomodoroTimer !== undefined) {
goalPoms = cardset.pomodoroTimer.quantity;
pomLength = cardset.pomodoroTimer.workLength;
breakLength = cardset.pomodoroTimer.breakLength;
isBellSoundEnabled = cardset.pomodoroTimer.soundConfig[0];
isSuccessSoundEnabled = cardset.pomodoroTimer.soundConfig[1];
isFailSoundEnabled = cardset.pomodoroTimer.soundConfig[2];
} else {
goalPoms = defaultGoalPoms;
pomLength = defaultPomLength;
breakLength = defaultBreakLength;
isBellSoundEnabled = DefaultIsBellSoundEnabled;
isSuccessSoundEnabled = DefaultIsSuccessSoundEnabled;
isFailSoundEnabled = DefaultIsFailSoundEnabled;
}
} else {
goalPoms = defaultGoalPoms;
pomLength = defaultPomLength;
breakLength = defaultBreakLength;
isBellSoundEnabled = DefaultIsBellSoundEnabled;
isSuccessSoundEnabled = DefaultIsSuccessSoundEnabled;
isFailSoundEnabled = DefaultIsFailSoundEnabled;
}
this.updateTimeParagraph();
}
/*any way you close the modal, by clicking the close button, confirm button, or clicking outside the box, starts a session. Makes it faster when you just want to start working. This initializes the end positions of all the arcs, and changes the instructions at the top of the screen.*/
......
......@@ -647,6 +647,22 @@ Meteor.startup(function () {
);
}
cardsets = Cardsets.find({pomodoroTimer: {$exists: false}, learningActive: true}).fetch();
for (let i = 0; i < cardsets.length; i++) {
Cardsets.update({
_id: cardsets[i]._id
},
{
$set: {
'pomodoroTimer.quantity': 3,
'pomodoroTimer.workLength': 15,
'pomodoroTimer.breakLength': 5,
'pomodoroTimer.soundConfig': [true, true, true]
}
}
);
}
let wozniak;
wozniak = Wozniak.find({skipped: {$exists: true}}).fetch();
for (let i = 0; i < wozniak.length; i++) {
......
......@@ -10,13 +10,14 @@
</h4>
</div>
<div class="modal-body">
<div class="form-horizontal">
<div class="form">
{{> bonusFormMaxWorkload}}
{{> bonusFormDaysBeforeReset}}
{{> bonusFormStartDate}}
{{> bonusFormEndDate}}
{{> bonusFormRegistrationPeriod}}
{{> bonusFormIntervals}}
{{> pomodoroTimerModalContent}}
</div>
</div>
<div class="modal-footer">
......@@ -35,7 +36,7 @@
</template>
<template name="bonusFormMaxWorkload">
<div class="form-group">
<div class="form-group row">
<label class="col-md-3 control-label">{{_ "bonus.form.maxWorkload.label"}}</label>
<div class="col-md-9">
<input type="number" min="1" max="100" data-bind="value:replyNumber"
......@@ -48,7 +49,7 @@
</template>
<template name="bonusFormDaysBeforeReset">
<div class="form-group">
<div class="form-group row">
<label class="col-md-3 control-label">{{_ "bonus.form.daysBeforeReset.label"}}</label>
<div class="col-md-9">
<input type="number" min="1" max="100" data-bind="value:replyNumber"
......@@ -61,7 +62,7 @@
</template>
<template name="bonusFormStartDate">
<div class="form-group">
<div class="form-group row">
<label class="col-md-3 control-label">{{_ "bonus.form.startDate.label"}}</label>
<div class="col-md-9">
<input type="date" class="form-control" id="dateBonusStart"
......@@ -71,7 +72,7 @@
</template>
<template name="bonusFormEndDate">
<div class="form-group">
<div class="form-group row">
<label class="col-md-3 control-label">{{_ "bonus.form.endDate.label"}}</label>
<div class="col-md-9">
<input type="date" class="form-control" id="dateBonusEnd"
......@@ -81,7 +82,7 @@
</template>
<template name="bonusFormIntervals">
<div class="form-group">
<div class="form-group row">
<label class="col-md-3 control-label">{{_ "bonus.form.intervals.label"}}</label>
<div class="col-md-9 form-inline">
<input type="number" min="1" max="999" data-bind="value:replyNumber"
......@@ -109,7 +110,7 @@
</template>
<template name="bonusFormRegistrationPeriod">
<div class="form-group">
<div class="form-group row">
<label class="col-md-3 control-label">{{_ "bonus.form.registrationPeriod.label"}}</label>
<div class="col-md-9 form-inline">
<input type="date" class="form-control" id="dateRegistrationPeriod"
......
......@@ -2,6 +2,7 @@ import {Session} from "meteor/session";
import {BonusForm} from "../../api/bonusForm";
import "./bonusForm.html";
import {Meteor} from "meteor/meteor";
import {PomodoroTimer} from "../../api/pomodoroTimer";
/*
* ############################################################################
......@@ -13,9 +14,13 @@ Template.bonusForm.onRendered(function () {
BonusForm.cleanModal();
$('#bonusFormModal').on('show.bs.modal', function () {
BonusForm.cleanModal();
PomodoroTimer.initializeVariables();
PomodoroTimer.initializeModalContent();
});
$('#bonusFormModal').on('hidden.bs.modal', function () {
BonusForm.cleanModal();
PomodoroTimer.initializeVariables();
PomodoroTimer.initializeModalContent();
});
});
......
......@@ -59,53 +59,7 @@
<div class="modal-body">
<form id="input" autocomplete="off">
<div class="form-group">
<div id="goalDiv">
<label for="pomQuantity">How many
<a href="/learning#Pomodoro" data-toggle="tooltip"
title='A "Pomodoro" is a work / break cycle. Default: 25 mins work and 5 mins break. After 4 pomodoros: 15 mins break.' target="_blank">
<b>pomodoros<i>🍅</i></b></a> will you
do?</label>
<input type="number" class="form-control quantity" id="pomQuantity" min="1" max="16"
value=1>
<input class="numSlider" type=range min=1 max=16 value=1 id="pomNumSlider" step=1>
<p id="workTime"></p>
</div>
<div id="settings" class="pomodoroBackground" style="display: none; background-image: url('/img/pomodoro.png')">
<label for="workLength" style="float:left;"><i class="fa fa-briefcase"></i>
Work</label>
<input type="number" class="form-control quantity" id="workLength" min="15" max="45"
value="25">
<input class="numSlider" type="range" min="15" max="45" value="25" id="workSlider"
step="1">
<label for="playLength" style="float:left;"><i class="fa fa-coffee"></i>
Relax</label>
<input type="number" class="form-control quantity" id="playLength" min="5" max="30"
value="5">
<input class="numSlider" type="range" min="5" max="30" value="5" id="playSlider"
step="1">
{{#unless isiOS}}
<label for="" style=" padding-top: 20px; padding-bottom: 10px"><i class="fa fa-music"></i>
Sounds</label><br>
<input type="checkbox" id="sound1" value="Clock" checked>
<label for="sound1">{{_ "pomodoro.schoolBell"}}</label><br>
<audio id="bellPreview" style="width: 260px;" controls controlsList="nodownload noremoteplayback">
<source src="/audio/Schulgong.mp3" type="audio/mpeg">
</audio><br>
<input type="checkbox" id="sound2" value="Complete" checked>
<label for="sound2">{{_ "pomodoro.learningSession"}}</label><br>
<audio id="successPreview" style="width: 260px" controls controlsList="nodownload noremoteplayback">
<source src="/audio/success.mp3" type="audio/mpeg">
</audio><br>
<input type="checkbox" id="sound3" value="Cancel" checked>
<label for="sound3">{{_ "pomodoro.cancelSession"}}</label><br>
<audio id="failurePreview" style="width: 260px" controls controlsList="nodownload noremoteplayback">
<source src="/audio/fail.mp3" type="audio/mpeg">
</audio><br>
{{/unless}}
</div>
{{> pomodoroTimerModalContent}}
</div>
</form>
</div>
......@@ -121,3 +75,57 @@
</div>
</div>
</template>
<template name="pomodoroTimerModalContent">
<div id="goalDiv" class="form-group row">
<label class="col-xs-12 control-label" for="pomNumSlider">I want to do <span id="pomodoroCount"></span>
<a href="/learning#Pomodoro" data-toggle="tooltip"
title='A "Pomodoro" is a work / break cycle. Default: 25 mins work and 5 mins break. After 4 pomodoros: 15 mins break.'
target="_blank">
<b>pomodoros<i>🍅</i></b></a>!</label>
<input class="numSlider col-xs-12" type=range min=1 max=16 value=1 id="pomNumSlider" step=1>
<label id="workTime" class="col-xs-12 control-label"></label>
</div>
<div id="settings" class="pomodoroBackground"
style="{{#if isHiddenByDefault}}display: none;{{/if}}">
<div class="form-group row">
<label for="workSlider" class="col-xs-12 control-label" style="float:left;"><i class="fa fa-briefcase"></i>
Work for: <b><span id="workLength"></span> Minutes</b> each pomodoro</label>
<input class="numSlider col-xs-12" type="range" min="15" max="45" value="25" id="workSlider"
step="1">
</div>
<div class="form-group row">
<label for="breakSlider" class="col-xs-12 control-label" style="float:left;"><i class="fa fa-coffee"></i>
Relax for: <b><span id="breakLength"></span> Minutes</b> each pomodoro</label>
<input class="numSlider col-xs-12" type="range" min="5" max="30" value="5" id="breakSlider"
step="1">
</div>
{{#unless isiOS}}
<div class="form-group row">
<label for="" class="control-label"><i class="fa fa-music"></i>
Sounds</label>
</div>
<div class="form-group row">
<input type="checkbox" id="sound1" value="Clock" checked>
<label for="sound1" class="control-label">{{_ "pomodoro.schoolBell"}}</label><br>
<audio id="bellPreview" style="width: 260px;" controls controlsList="nodownload noremoteplayback">
<source src="/audio/Schulgong.mp3" type="audio/mpeg">
</audio>
</div>
<div class="form-group row">
<input type="checkbox" id="sound2" value="Complete" checked>
<label for="sound2" class="control-label">{{_ "pomodoro.learningSession"}}</label><br>
<audio id="successPreview" style="width: 260px" controls controlsList="nodownload noremoteplayback">
<source src="/audio/success.mp3" type="audio/mpeg">
</audio>
</div>
<div class="form-group row">
<input type="checkbox" id="sound3" value="Cancel" checked>
<label for="sound3" class="control-label">{{_ "pomodoro.cancelSession"}}</label><br>
<audio id="failurePreview" style="width: 260px" controls controlsList="nodownload noremoteplayback">
<source src="/audio/fail.mp3" type="audio/mpeg">
</audio>
</div>
{{/unless}}
</div>
</template>
......@@ -3,6 +3,7 @@ import "./pomodoroTimer.html";
import {Template} from "meteor/templating";
import {PomodoroTimer} from "../../api/pomodoroTimer";
import {NavigatorCheck} from "../../api/navigatorCheck";
import {Bonus} from "../../api/bonus";
import {Route} from "../../api/route";
/*
......@@ -10,13 +11,13 @@ import {Route} from "../../api/route";
* pomodoroTimer
* ############################################################################
*/
let promodoroInterval;
let pomodoroInterval;
Template.pomodoroTimer.onCreated(function () {
/*This initializes the tooltip over "pomodoro" in the startup modal.*/
$('[data-toggle="tooltip"]').tooltip();
if (promodoroInterval === undefined) {
promodoroInterval = setInterval(function () {
if (pomodoroInterval === undefined) {
pomodoroInterval = setInterval(function () {
PomodoroTimer.interval();
}, 1000);
}
......@@ -43,39 +44,58 @@ Template.pomodoroTimer.events({
* ############################################################################
*/
Template.pomodoroTimerModal.onCreated(function () {
PomodoroTimer.initializeVariables();
});
Template.pomodoroTimerModal.onRendered(function () {
if (Route.isBox() || Route.isMemo()) {
$('#pomodoroTimerModal').modal('show');
if (Bonus.isInBonus(Router.current().params._id)) {
PomodoroTimer.start();
} else {
$('#pomodoroTimerModal').modal('show');
}
}
$('#pomodoroTimerModal').on('show.bs.modal', function () {
PomodoroTimer.initializeModalContent();
});
});
Template.pomodoroTimerModal.helpers({
Template.pomodoroTimerModalContent.helpers({
isiOS: function () {
return NavigatorCheck.isIOS();
}
});
Template.pomodoroTimerModal.events({
'input #pomNumSlider': function () {
PomodoroTimer.updatePomNumSlider();
},
'input #pomQuantity': function () {
PomodoroTimer.updatePomQuantity();
},
'click #settingsBtn': function () {
PomodoroTimer.updateSettingsBtn();
},
'input #workLength': function () {
PomodoroTimer.updateWorkLength();
'click #startPom': function () {
PomodoroTimer.start();
}
});
/*
* ############################################################################
* pomodoroTimerModalContent
* ############################################################################
*/
Template.pomodoroTimerModalContent.helpers({
isHiddenByDefault: function () {
return !Route.isCardset();
}
});
Template.pomodoroTimerModalContent.events({
'input #pomNumSlider': function () {
PomodoroTimer.updatePomNumSlider();
},
'input #workSlider': function () {
PomodoroTimer.updateWorkSlider();
},
'input #playLength': function () {
PomodoroTimer.updatePlayLength();
},
'input #playSlider': function () {
PomodoroTimer.updatePlaySlider();
'input #breakSlider': function () {
PomodoroTimer.updateBreakSlider();
},
'change #sound1': function () {
PomodoroTimer.clockHandler(0);
......@@ -85,8 +105,5 @@ Template.pomodoroTimerModal.events({
},
'change #sound3': function () {
PomodoroTimer.clockHandler(2);
},
'click #startPom': function () {
PomodoroTimer.start();
}
});
......@@ -3,26 +3,6 @@
@import "../main/main.scss";
.pomodoroTimer {
.pomodoroInstructions {
/*have to make it important to override the bootstrap css*/
font-size: 100%;
padding: 0;
font-weight: bold;
text-shadow: black 0.1em 0.1em 0.2em;