From 499af4c008bdffd0cd0d5d9bc4b58595cce8f366 Mon Sep 17 00:00:00 2001 From: David Russell Date: Fri, 3 Mar 2017 19:13:01 +0700 Subject: [PATCH] Added support for slide-number option in PITCHME.yaml. --- app/com/gitpitch/models/SlideshowModel.java | 7 +++++++ app/com/gitpitch/utils/YAMLOptions.java | 5 +++++ app/com/gitpitch/views/frags/SlideshowReveal.scala.html | 1 + 3 files changed, 13 insertions(+) diff --git a/app/com/gitpitch/models/SlideshowModel.java b/app/com/gitpitch/models/SlideshowModel.java index 7e778fb..1bcce5c 100644 --- a/app/com/gitpitch/models/SlideshowModel.java +++ b/app/com/gitpitch/models/SlideshowModel.java @@ -338,6 +338,13 @@ public class SlideshowModel { return (_yOpts != null) ? _yOpts.fetchHistory(params()) : false; } + /* + * Return "slide-number" defined in PITCHME.yaml. + */ + public boolean fetchSlideNumber() { + return (_yOpts != null) ? _yOpts.fetchSlideNumber(params()) : false; + } + /* * Return "mathjax" defined in PITCHME.yaml. */ diff --git a/app/com/gitpitch/utils/YAMLOptions.java b/app/com/gitpitch/utils/YAMLOptions.java index 1e0f65e..1c1c3f6 100644 --- a/app/com/gitpitch/utils/YAMLOptions.java +++ b/app/com/gitpitch/utils/YAMLOptions.java @@ -220,6 +220,10 @@ public final class YAMLOptions { return fetchBooleanOption(pp, HISTORY_OPTION, true); } + public Boolean fetchSlideNumber(PitchParams pp) { + return fetchBooleanOption(pp, SLIDE_NUMBER_OPTION); + } + public String mathConfig(PitchParams pp) { return mathEnabled(pp) ? _yProps.get(MATHJAX_OPTION) : MATHJAX_DEFAULT; @@ -357,6 +361,7 @@ public final class YAMLOptions { private static final String GATOKEN_OPTION = "gatoken"; private static final String CHARTS_OPTION = "charts"; private static final String HISTORY_OPTION = "history"; + private static final String SLIDE_NUMBER_OPTION = "slide-number"; private static final String REVEALJS_VERSION = "revealjs-version"; private static final String HSLIDE_DELIM = "horz-delim"; diff --git a/app/com/gitpitch/views/frags/SlideshowReveal.scala.html b/app/com/gitpitch/views/frags/SlideshowReveal.scala.html index 7ab6341..0bf07d3 100644 --- a/app/com/gitpitch/views/frags/SlideshowReveal.scala.html +++ b/app/com/gitpitch/views/frags/SlideshowReveal.scala.html @@ -12,6 +12,7 @@ rtl: @ssm.fetchRTL(), shuffle: @ssm.fetchShuffle(), mouseWheel: @ssm.fetchMouseWheel(), + slideNumber: @ssm.fetchSlideNumber(), history: @ssm.fetchHistory(), @if(ssm.mathEnabled()) { math: {