aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorFlorian Haas <xahteiwi@gmail.com>2019-05-11 22:23:28 +0200
committerFlorian Haas <xahteiwi@gmail.com>2019-05-22 21:44:44 +0200
commit23c12d73321469743424264d9625eab72d8eb179 (patch)
tree46d443bc5ccd20514455315d887903b5f27e67b3 /plugin
parent078ba6205066fcedeec59dbb6dd16d039558adb4 (diff)
downloadfosdem-2021-minimalism-presentation-23c12d73321469743424264d9625eab72d8eb179.tar
fosdem-2021-minimalism-presentation-23c12d73321469743424264d9625eab72d8eb179.tar.gz
Notes: Weakly enforce a minimum allocated pacing time per slide
When using the totalTime-based pacing calculation, a presenter may inadvertently set totalTime and per-slide data-timing attributes in such a way that the pacing time for some slides is impossibly low or even negative. Add a check to ensure that the pacing on a slide never falls below a configurable minimum, defaulting to 0. Display an alert if the pacing for any slide(s) falls below the threshold.
Diffstat (limited to 'plugin')
-rw-r--r--plugin/notes/notes.html6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugin/notes/notes.html b/plugin/notes/notes.html
index b5635bc..fdb81ad 100644
--- a/plugin/notes/notes.html
+++ b/plugin/notes/notes.html
@@ -540,6 +540,7 @@
callRevealApi( 'getSlidesAttributes', [], function ( slideAttributes ) {
callRevealApi( 'getConfig', [], function ( config ) {
var totalTime = config.totalTime;
+ var minTimePerSlide = config.minimumTimePerSlide || 0;
var defaultTiming = config.defaultTiming;
if ((defaultTiming == null) && (totalTime == null)) {
callback(null);
@@ -574,6 +575,11 @@
// And now we replace every zero-value timing with that average
timings = timings.map( function(x) { return (x==0 ? timePerSlide : x) } );
}
+ var slidesUnderMinimum = timings.filter( function(x) { return (x < minTimePerSlide) } ).length
+ if ( slidesUnderMinimum ) {
+ message = "The pacing time for " + slidesUnderMinimum + " slide(s) is under the configured minimum of " + minTimePerSlide + " seconds. Check the data-timing attribute on individual slides, or consider increasing the totalTime or minimumTimePerSlide configuration options (or removing some slides).";
+ alert(message);
+ }
callback( timings );
} );
} );