From 787d2cc27bc1b3f7ba4cd25d14aa5cea4c38a337 Mon Sep 17 00:00:00 2001 From: David Russell Date: Wed, 1 Mar 2017 17:56:25 +0700 Subject: [PATCH] Added support for history 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 beef5d8..7e778fb 100644 --- a/app/com/gitpitch/models/SlideshowModel.java +++ b/app/com/gitpitch/models/SlideshowModel.java @@ -331,6 +331,13 @@ public class SlideshowModel { return (_yOpts != null) ? _yOpts.mathEnabled(params()) : false; } + /* + * Return "history" defined in PITCHME.yaml. + */ + public boolean fetchHistory() { + return (_yOpts != null) ? _yOpts.fetchHistory(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 f197719..1e0f65e 100644 --- a/app/com/gitpitch/utils/YAMLOptions.java +++ b/app/com/gitpitch/utils/YAMLOptions.java @@ -216,6 +216,10 @@ public final class YAMLOptions { return (mathjax != null); } + public Boolean fetchHistory(PitchParams pp) { + return fetchBooleanOption(pp, HISTORY_OPTION, true); + } + public String mathConfig(PitchParams pp) { return mathEnabled(pp) ? _yProps.get(MATHJAX_OPTION) : MATHJAX_DEFAULT; @@ -352,6 +356,7 @@ public final class YAMLOptions { private static final String FOOTNOTE_OPTION = "footnote"; 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 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 67df223..7ab6341 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(), + history: @ssm.fetchHistory(), @if(ssm.mathEnabled()) { math: { @if(offline) {