Fix duplicated loading of reveal markdown plugin

This commit is contained in:
Wu Cheng-Han 2017-03-21 20:44:12 +08:00
parent 10a7a9b37e
commit b17c2404b1

View file

@ -1,5 +1,5 @@
/* eslint-env browser, jquery */ /* eslint-env browser, jquery */
/* global serverurl, Reveal */ /* global serverurl, Reveal, RevealMarkdown */
require('../css/extra.css') require('../css/extra.css')
require('../css/site.css') require('../css/site.css')
@ -39,19 +39,6 @@ const deps = [{
condition () { condition () {
return !document.body.classList 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`, src: `${serverurl}/build/reveal.js/plugin/notes/notes.js`,
async: true, 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 // default options to init reveal.js
const defaultOptions = { const defaultOptions = {
controls: true, controls: true,