From b17c2404b1b6c1b7dfc35f424eb047cd080e8e17 Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Tue, 21 Mar 2017 20:44:12 +0800 Subject: Fix duplicated loading of reveal markdown plugin --- public/js/slide.js | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'public') diff --git a/public/js/slide.js b/public/js/slide.js index 84e098c7..9dfda65b 100644 --- a/public/js/slide.js +++ b/public/js/slide.js @@ -1,5 +1,5 @@ /* eslint-env browser, jquery */ -/* global serverurl, Reveal */ +/* global serverurl, Reveal, RevealMarkdown */ require('../css/extra.css') require('../css/site.css') @@ -39,19 +39,6 @@ const deps = [{ condition () { return !document.body.classList } -}, { - src: `${serverurl}/js/reveal-markdown.js`, - callback () { - const slideOptions = { - separator: '^(\r\n?|\n)---(\r\n?|\n)$', - verticalSeparator: '^(\r\n?|\n)----(\r\n?|\n)$' - } - const slides = window.RevealMarkdown.slidify(body, slideOptions) - $('.slides').html(slides) - window.RevealMarkdown.initialize() - removeDOMEvents($('.slides')) - $('.slides').show() - } }, { src: `${serverurl}/build/reveal.js/plugin/notes/notes.js`, async: true, @@ -60,6 +47,16 @@ const deps = [{ } }] +const slideOptions = { + separator: '^(\r\n?|\n)---(\r\n?|\n)$', + verticalSeparator: '^(\r\n?|\n)----(\r\n?|\n)$' +} +const slides = RevealMarkdown.slidify(body, slideOptions) +$('.slides').html(slides) +RevealMarkdown.initialize() +removeDOMEvents($('.slides')) +$('.slides').show() + // default options to init reveal.js const defaultOptions = { controls: true, -- cgit v1.2.3