diff options
author | Wu Cheng-Han | 2016-08-14 15:02:05 +0800 |
---|---|---|
committer | Wu Cheng-Han | 2016-08-14 15:02:05 +0800 |
commit | be81ee22ecc1af1db6d24a44109594d30461d8c9 (patch) | |
tree | fdf863eaab4a2fbc5ebf2608e04fe7dc535a5683 /public/js | |
parent | e08152ed03639cfa0592678840b4b8d0b98aa19b (diff) |
Update slide mode, now respect all meta settings and update default styles
Diffstat (limited to 'public/js')
-rw-r--r-- | public/js/slide.js | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/public/js/slide.js b/public/js/slide.js index 996610fb..fe3cb1e8 100644 --- a/public/js/slide.js +++ b/public/js/slide.js @@ -45,7 +45,29 @@ var defaultOptions = { }; // options from yaml meta -var options = JSON.parse($("#options").text()); +var meta = JSON.parse($("#meta").text()); +var options = meta.slideOptions || {}; + +var view = $('.reveal'); + +//text language +if (meta.lang && typeof meta.lang == "string") { + view.attr('lang', meta.lang); +} else { + view.removeAttr('lang'); +} +//text direction +if (meta.dir && typeof meta.dir == "string" && meta.dir == "rtl") { + options.rtl = true; +} else { + options.rtl = false; +} +//breaks +if (typeof meta.breaks === 'boolean' && !meta.breaks) { + md.options.breaks = false; +} else { + md.options.breaks = true; +} // options from URL query string var queryOptions = Reveal.getQueryHash() || {}; |