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

When exiting a presentation, show a pop-up

parent 21d5dc63
......@@ -1796,6 +1796,24 @@
"confirm": "Konto",
"cancel": "Schließen"
}
},
"presentation": {
"end": {
"title": "Willst du die Präsentation beenden?",
"text": "Eine Fortführung der Präsentation aktiviert den Vollbildmodus.",
"button": {
"cancel": "Nein, ich präsentiere weiter!",
"confirm": "Präsentation beenden!"
}
},
"continue": {
"title": "Die Präsentation wurde unterbrochen!",
"text": "Eine Fortführung der Präsentation aktiviert den Vollbildmodus.",
"button": {
"cancel": "Präsentation beenden!",
"confirm": "Präsentation fortführen!"
}
}
}
}
}
......@@ -1938,6 +1938,24 @@
"confirm": "Profile",
"cancel": "Close"
}
},
"presentation": {
"end": {
"title": "Stop the presentation?",
"text": "",
"button": {
"cancel": "I want to continue!",
"confirm": "Stop the presentation!"
}
},
"continue": {
"title": "Stop the presentation?",
"text": "",
"button": {
"cancel": "Stop the presentation!",
"confirm": "I want to continue!"
}
}
}
}
}
......@@ -7,6 +7,7 @@ import * as screenfull from "screenfull";
import {CardIndex} from "./cardIndex";
import {Cards} from "./cards";
import {Cardsets} from "./cardsets";
import {SweetAlertMessages} from "./sweetAlert";
let keyEventsUnlocked = true;
let lastActiveCardString = "lastActiveCard";
......@@ -231,7 +232,7 @@ export let CardNavigation = class CardNavigation {
screenfull.on('change', () => {
if (screenfull.element === null && Session.get('fullscreen')) {
if (Route.isPresentation()) {
$(".endPresentation").click();
SweetAlertMessages.continuePresentation();
} else {
$(".toggleFullscreen").click();
}
......
import {Meteor} from "meteor/meteor";
import swal from "sweetalert2";
import * as screenfull from 'screenfull';
export let SweetAlertMessages = class SweetAlertMessages {
static completeProfile () {
......@@ -19,4 +20,46 @@ export let SweetAlertMessages = class SweetAlertMessages {
}
});
}
static continuePresentation () {
swal({
title: TAPi18n.__('sweetAlert.presentation.continue.title'),
html: TAPi18n.__('sweetAlert.presentation.continue.text'),
type: "warning",
showCancelButton: true,
confirmButtonText: TAPi18n.__('sweetAlert.presentation.continue.button.confirm'),
cancelButtonText: TAPi18n.__('sweetAlert.presentation.continue.button.cancel'),
allowOutsideClick: false
}).then((result) => {
if (result.value) {
screenfull.request();
} else {
screenfull.exit();
Router.go('cardsetdetailsid', {
_id: Router.current().params._id
});
}
});
}
static exitPresentation () {
swal({
title: TAPi18n.__('sweetAlert.presentation.end.title'),
html: TAPi18n.__('sweetAlert.presentation.end.text'),
type: "warning",
showCancelButton: true,
confirmButtonText: TAPi18n.__('sweetAlert.presentation.end.button.confirm'),
cancelButtonText: TAPi18n.__('sweetAlert.presentation.end.button.cancel'),
allowOutsideClick: false
}).then((result) => {
if (result.value) {
screenfull.exit();
Router.go('cardsetdetailsid', {
_id: Router.current().params._id
});
} else {
screenfull.request();
}
});
}
};
import "./endPresentation.html";
import {Route} from "../../../../api/route";
import {SweetAlertMessages} from "../../../../api/sweetAlert";
/*
* ############################################################################
......@@ -12,9 +13,7 @@ Template.cardSidebarItemEndPresentation.events({
if (Route.isMakingOf()) {
Router.go('home');
} else {
Router.go('cardsetdetailsid', {
_id: Router.current().params._id
});
SweetAlertMessages.exitPresentation();
}
}
});
......@@ -84,6 +84,9 @@ Template.pomodoroTimerModal.events({
PomodoroTimer.updateSettingsBtn();
},
'click #startPom': function () {
if (Route.isPresentation()) {
CardVisuals.toggleFullscreen();
}
PomodoroTimer.start();
},
'click #cancelPomodoroBtn': 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