diff --git a/public/res/constants.js b/public/res/constants.js index 6ad98878..87adf483 100644 --- a/public/res/constants.js +++ b/public/res/constants.js @@ -76,4 +76,6 @@ define([], function() { "night": "Night", "school": "School", }; + + return constants; }); diff --git a/public/res/eventMgr.js b/public/res/eventMgr.js index 6eec8b71..1c78a242 100644 --- a/public/res/eventMgr.js +++ b/public/res/eventMgr.js @@ -221,6 +221,21 @@ define([ previewContentsElt = document.getElementById('preview-contents'); $previewContentsElt = $(previewContentsElt); + // Create a button from an extension listener + var createBtn = function(listener) { + var buttonGrpElt = crel('div', { + class: 'btn-group' + }); + var btnElt = listener(); + if(_.isString(btnElt)) { + buttonGrpElt.innerHTML = btnElt; + } + else if(_.isElement(btnElt)) { + buttonGrpElt.appendChild(btnElt); + } + return buttonGrpElt; + }; + if(window.viewerMode === false) { // Create accordion in settings dialog var accordionHtml = _.chain(extensionList).sortBy(function(extension) { @@ -235,21 +250,6 @@ define([ }, "").value(); document.querySelector('.accordion-extensions').innerHTML = accordionHtml; - // Create a button from an extension listener - var createBtn = function(listener) { - var buttonGrpElt = crel('div', { - class: 'btn-group' - }); - var btnElt = listener(); - if(_.isString(btnElt)) { - buttonGrpElt.innerHTML = btnElt; - } - else if(_.isElement(btnElt)) { - buttonGrpElt.appendChild(btnElt); - } - return buttonGrpElt; - }; - // Create extension buttons logger.log("onCreateButton"); var onCreateButtonListenerList = getExtensionListenerList("onCreateButton"); diff --git a/public/res/extensions/markdownExtra.js b/public/res/extensions/markdownExtra.js index d0f6c28e..03bb69c5 100644 --- a/public/res/extensions/markdownExtra.js +++ b/public/res/extensions/markdownExtra.js @@ -8,7 +8,7 @@ define([ 'google-code-prettify', 'highlightjs', 'pagedown-extra', -], function($, _, utils, Extension, markdownExtraSettingsBlockHTML, prettyPrint, hljs) { +], function($, _, utils, Extension, markdownExtraSettingsBlockHTML, prettify, hljs) { var markdownExtra = new Extension("markdownExtra", "Markdown Extra", true); markdownExtra.settingsBlock = markdownExtraSettingsBlockHTML; @@ -71,7 +71,7 @@ define([ } else if(markdownExtra.config.highlighter == "prettify") { options.highlighter = "prettify"; - editor.hooks.chain("onPreviewRefresh", prettyPrint); + editor.hooks.chain("onPreviewRefresh", prettify.prettyPrint); } Markdown.Extra.init(converter, options); diff --git a/public/res/main.js b/public/res/main.js index 5b10b238..0d431c60 100644 --- a/public/res/main.js +++ b/public/res/main.js @@ -85,9 +85,6 @@ requirejs.config({ highlightjs: { exports: 'hljs' }, - 'google-code-prettify': { - exports: 'prettyPrint' - }, 'bootstrap-tour': { deps: ['bootstrap'], exports: 'Tour'