Commit 9eb259ce authored by Curtis Adam's avatar Curtis Adam

Add a sidebar button to enable the pomodoro timer inside the presentation view...

Add a sidebar button to enable the pomodoro timer inside the presentation view and disable most of the sweet alert messages in this new mode
parent 72021252
......@@ -79,6 +79,14 @@
"totalTime": "Set the pomodoro Session to __time__ for getting stuff done!",
"work": "Work during Bonus-Pomodoro: <span class=\"pomodoroHighlight\">__minutes__</span>",
"break": "Break during Bonus-Pomodoro: <span class=\"pomodoroHighlight\">__minutes__</span>"
},
"presentation": {
"title": "Wie lange willst du präsentieren?",
"work": " Präsentatieren: <span class=\"pomodoroHighlight\">__minutes__</span> pro Präsentation",
"break": " Pausieren: <span class=\"pomodoroHighlight\">__minutes__</span> pro Präsentation",
"button": {
"start": "Präsentation starten!"
}
}
},
"sweetAlert": {
......@@ -177,6 +185,24 @@
}
}
}
},
"presentation": {
"break": {
"start": {
"title": "Pause beginnt!",
"text": "Bist du bereit für erholsame <span class=\"pomodoroHighlight\"> __pomodoroBreak__ Minuten</span> Pause?",
"button": {
"confirm": "Ja, Pause starten!"
}
},
"end": {
"title": "Die Pause ist vorbei!",
"text": "Wir hoffen, dass du erfrischt aus der Pause zurück bist. Jetzt ist es an der Zeit, weiter zu lernen. <br><br>Bereit für die nächsten <span class=\"pomodoroHighlight\"> __pomodoroLength__ Minuten</span>?",
"button": {
"confirm": "Weiter präsentieren!"
}
}
}
}
}
},
......@@ -1150,6 +1176,7 @@
"copy": "Erstelle eine Kopie dieser Karte",
"zoomText": "Ändere die Schriftgröße der Karte",
"zoomTextReset": "Zurücksetzen",
"pomodoro": "Wechsel zwischen Minutensprunguhr | Pomodoro-Timer",
"markdeepEditor": {
"help": "Zeige alle Formatierungsoptionen von Markdeep",
"center": "Zentriere den Karteninhalt vertikal",
......
......@@ -79,6 +79,14 @@
"totalTime": "Set the pomodoro Session to __time__ for getting stuff done!",
"work": "Work during Bonus-Pomodoro: <span class=\"pomodoroHighlight\">__minutes__</span>",
"break": "Break during Bonus-Pomodoro: <span class=\"pomodoroHighlight\">__minutes__</span>"
},
"presentation": {
"title": "Choose your goal!",
"work": "Work for: <span class=\"pomodoroHighlight\">__minutes__</span> each pomodoro",
"break": "Relax for: <span class=\"pomodoroHighlight\">__minutes__</span> each pomodoro",
"button": {
"start": "Let's go!"
}
}
},
"sweetAlert": {
......@@ -177,6 +185,24 @@
}
}
}
},
"presentation": {
"break": {
"start": {
"title": "Good job!",
"text": "You have completed <span class=\"pomodoroHighlight\"> __pomodoroTotal__ __pomodoro__</span> of work! Are you ready for a relaxing <span class=\"pomodoroHighlight\"> __pomodoroBreak__ minutes</span> of whatever the heck you feel like?",
"button": {
"confirm": "Yes, I can't wait!"
}
},
"end": {
"title": "Break's over!",
"text": "Hope that break left you feeling refreshed! Now it's time to get back to accomplishing your goals. Ready for <span class=\"pomodoroHighlight\"> __pomodoroLength__ more minutes</span> of work?",
"button": {
"confirm": "Let me at it!"
}
}
}
}
}
},
......@@ -1149,6 +1175,7 @@
"copy": "",
"zoomText": "",
"zoomTextReset": "Zurücksetzen",
"pomodoro": "",
"markdeepEditor": {
"help": "",
"center": " ",
......
This diff is collapsed.
<template name="flashcardHeaderPresentationLeft">
<div class="col-xs-3 cardHeaderLeft" data-cardtype="{{cardType}}">
<div class="cardHeaderGroup">
{{> cardHeaderItemClock}}
{{#if pomodoroActive}}
{{> pomodoroTimer}}
{{else}}
{{> cardHeaderItemClock}}
{{/if}}
</div>
</div>
</template>
......
import "./left.html";
import {MarkdeepEditor} from "../../../../api/markdeepEditor";
import {PomodoroTimer} from "../../../../api/pomodoroTimer";
/*
* ############################################################################
* flashcardHeaderPresentationLeft
* ############################################################################
*/
Template.flashcardHeaderPresentationLeft.helpers({
pomodoroActive: function () {
return PomodoroTimer.isPresentationPomodoroActive();
}
});
/*
* ############################################################################
......
<template name="cardSidebarItemPomodoroButton">
<img class="card-button cardHeaderItem showPomodoroButton {{#if pomodoroActive}}pressed{{/if}}"
data-type="cardNavigation"
title="{{_ "card.tooltip.pomodoro"}}" src="/img/pomodoro/pomodoro.svg"/>
</template>
import "./pomodoroButton.html";
import {PomodoroTimer} from "../../../../api/pomodoroTimer";
/*
* ############################################################################
* cardSidebarItemPomodoroButton
* ############################################################################
*/
Template.cardSidebarItemPomodoroButton.events({
"click .showPomodoroButton": function () {
PomodoroTimer.setPresentationPomodoro();
}
});
Template.cardSidebarItemPomodoroButton.helpers({
pomodoroActive: function () {
return PomodoroTimer.isPresentationPomodoroActive();
}
});
......@@ -89,6 +89,7 @@
{{> cardSidebarLeftNavigation}}
{{/if}}
{{> cardSidebarItemCardList}}
{{> cardSidebarItemPomodoroButton}}
{{> flashcardSidebarDictionary}}
</template>
......
......@@ -14,6 +14,7 @@ import "./item/leftRightNavigation.js";
import "./item/copy.js";
import "./item/delete.js";
import "./item/edit.js";
import "./item/pomodoroButton.js";
import {CardNavigation} from "../../../api/cardNavigation";
......
......@@ -36,12 +36,14 @@
<audio id="bell" preload="auto">
<source src="/audio/Schulgong.mp3" type="audio/mp3"/>
</audio>
<audio id="failure" preload="auto">
<source src="/audio/fail.mp3" type="audio/mp3"/>
</audio>
<audio id="success" preload="auto">
<source src="/audio/success.mp3" type="audio/mp3"/>
</audio>
{{#unless isActiveRoute regex='presentation'}}
<audio id="failure" preload="auto">
<source src="/audio/fail.mp3" type="audio/mp3"/>
</audio>
<audio id="success" preload="auto">
<source src="/audio/success.mp3" type="audio/mp3"/>
</audio>
{{/unless}}
</div>
</template>
......@@ -63,12 +65,18 @@
</form>
</div>
<div class="modal-footer">
<button type="button" id="settingsBtn" class="btn btn-info btn-raised fa fa-gear hvr-bounce-in"
style="float:left;">
{{_ "pomodoro.form.user.button.settings"}}
</button>
{{#unless isActiveRoute regex='presentation'}}
<button type="button" id="settingsBtn" class="btn btn-info btn-raised fa fa-gear hvr-bounce-in"
style="float:left;">
{{_ "pomodoro.form.user.button.settings"}}
</button>
{{/unless}}
<button type="button" id="startPom" class="btn btn-success btn-raised" data-dismiss="modal">
{{_ "pomodoro.form.user.button.start"}}
{{#if isActiveRoute regex='presentation'}}
{{_ "pomodoro.form.presentation.button.start"}}
{{else}}
{{_ "pomodoro.form.user.button.start"}}
{{/if}}
</button>
</div>
</div>
......@@ -77,26 +85,26 @@
</template>
<template name="pomodoroTimerModalContent">
<div id="goalDiv" class="form-group row">
<label class="col-xs-12 control-label" id="pomNumLabel" for="pomNumSlider"></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>
{{#unless isActiveRoute regex='presentation'}}
<div id="goalDiv" class="form-group row">
<label class="col-xs-12 control-label" id="pomNumLabel" for="pomNumSlider"></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>
{{/unless}}
<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-book"></i>
<span id="workSliderLabel"></span>
</label>
<input class="numSlider col-xs-12" type="range" min="15" max="45" value="25" id="workSlider"
step="5">
<input class="numSlider col-xs-12" type="range" id="workSlider">
</div>
<div class="form-group row">
<label for="breakSlider" class="col-xs-12 control-label" style="float:left;"><i class="fa fa-coffee"></i>
<span id="breakSliderLabel"></span>
</label>
<input class="numSlider col-xs-12" type="range" min="5" max="15" value="5" id="breakSlider"
step="5">
<input class="numSlider col-xs-12" type="range" id="breakSlider">
</div>
{{#unless isiOS}}
<div class="form-group row">
......@@ -110,20 +118,22 @@
<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.form.sounds.success"}}</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.form.sounds.abort"}}</label><br>
<audio id="failurePreview" style="width: 260px" controls controlsList="nodownload noremoteplayback">
<source src="/audio/fail.mp3" type="audio/mpeg">
</audio>
</div>
{{#unless isActiveRoute regex='presentation'}}
<div class="form-group row">
<input type="checkbox" id="sound2" value="Complete" checked>
<label for="sound2" class="control-label">{{_ "pomodoro.form.sounds.success"}}</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.form.sounds.abort"}}</label><br>
<audio id="failurePreview" style="width: 260px" controls controlsList="nodownload noremoteplayback">
<source src="/audio/fail.mp3" type="audio/mpeg">
</audio>
</div>
{{/unless}}
{{/unless}}
</div>
</template>
......@@ -5,6 +5,7 @@ import {PomodoroTimer} from "../../api/pomodoroTimer";
import {NavigatorCheck} from "../../api/navigatorCheck";
import {Bonus} from "../../api/bonus";
import {Route} from "../../api/route";
import {CardVisuals} from "../../api/cardVisuals";
/*
* ############################################################################
......@@ -23,6 +24,12 @@ Template.pomodoroTimer.onCreated(function () {
}
});
Template.pomodoroTimer.onRendered(function () {
if (Route.isPresentation() || Route.isBox() || Route.isMemo()) {
CardVisuals.resizeFlashcard();
}
});
Template.pomodoroTimer.helpers({
getHourRotation: function () {
return 'rotate(' + PomodoroTimer.getHourRotation() + ' 50 50)';
......@@ -84,7 +91,7 @@ Template.pomodoroTimerModal.events({
Template.pomodoroTimerModalContent.helpers({
isHiddenByDefault: function () {
return !Route.isCardset();
return !Route.isCardset() && !Route.isPresentation();
}
});
Template.pomodoroTimerModalContent.events({
......
......@@ -23,6 +23,7 @@
<template name="presentationView">
{{#if isActiveRoute regex='presentation'}}
{{> presentationHelpModal}}
{{> pomodoroTimerModal}}
{{/if}}
{{#if isActiveRoute regex='demolist|presentationlist|makinglist'}}
<div class="{{#if isActiveRoute regex='demolist'}}row demo-padding{{else}}col-xs-12{{/if}}">
......
......@@ -8,6 +8,7 @@ import "./modal/presentationHelp.js";
import {CardNavigation} from "../../api/cardNavigation";
import {Cardsets} from "../../api/cardsets";
import {Cards} from "../../api/cards";
import {PomodoroTimer} from "../../api/pomodoroTimer";
Meteor.subscribe("cardsets");
Session.set('animationPlaying', false);
......@@ -22,6 +23,7 @@ Session.set('animationPlaying', false);
Template.presentationView.onCreated(function () {
Session.set('activeCard', undefined);
CardNavigation.toggleVisibility(true);
PomodoroTimer.setPresentationPomodoro(true);
});
Template.presentationView.onRendered(function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment