Fixed constants module
This commit is contained in:
parent
b20ea7949f
commit
d3069049b2
@ -76,4 +76,6 @@ define([], function() {
|
|||||||
"night": "Night",
|
"night": "Night",
|
||||||
"school": "School",
|
"school": "School",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
return constants;
|
||||||
});
|
});
|
||||||
|
@ -221,6 +221,21 @@ define([
|
|||||||
previewContentsElt = document.getElementById('preview-contents');
|
previewContentsElt = document.getElementById('preview-contents');
|
||||||
$previewContentsElt = $(previewContentsElt);
|
$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) {
|
if(window.viewerMode === false) {
|
||||||
// Create accordion in settings dialog
|
// Create accordion in settings dialog
|
||||||
var accordionHtml = _.chain(extensionList).sortBy(function(extension) {
|
var accordionHtml = _.chain(extensionList).sortBy(function(extension) {
|
||||||
@ -235,21 +250,6 @@ define([
|
|||||||
}, "").value();
|
}, "").value();
|
||||||
document.querySelector('.accordion-extensions').innerHTML = accordionHtml;
|
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
|
// Create extension buttons
|
||||||
logger.log("onCreateButton");
|
logger.log("onCreateButton");
|
||||||
var onCreateButtonListenerList = getExtensionListenerList("onCreateButton");
|
var onCreateButtonListenerList = getExtensionListenerList("onCreateButton");
|
||||||
|
@ -8,7 +8,7 @@ define([
|
|||||||
'google-code-prettify',
|
'google-code-prettify',
|
||||||
'highlightjs',
|
'highlightjs',
|
||||||
'pagedown-extra',
|
'pagedown-extra',
|
||||||
], function($, _, utils, Extension, markdownExtraSettingsBlockHTML, prettyPrint, hljs) {
|
], function($, _, utils, Extension, markdownExtraSettingsBlockHTML, prettify, hljs) {
|
||||||
|
|
||||||
var markdownExtra = new Extension("markdownExtra", "Markdown Extra", true);
|
var markdownExtra = new Extension("markdownExtra", "Markdown Extra", true);
|
||||||
markdownExtra.settingsBlock = markdownExtraSettingsBlockHTML;
|
markdownExtra.settingsBlock = markdownExtraSettingsBlockHTML;
|
||||||
@ -71,7 +71,7 @@ define([
|
|||||||
}
|
}
|
||||||
else if(markdownExtra.config.highlighter == "prettify") {
|
else if(markdownExtra.config.highlighter == "prettify") {
|
||||||
options.highlighter = "prettify";
|
options.highlighter = "prettify";
|
||||||
editor.hooks.chain("onPreviewRefresh", prettyPrint);
|
editor.hooks.chain("onPreviewRefresh", prettify.prettyPrint);
|
||||||
}
|
}
|
||||||
Markdown.Extra.init(converter, options);
|
Markdown.Extra.init(converter, options);
|
||||||
|
|
||||||
|
@ -85,9 +85,6 @@ requirejs.config({
|
|||||||
highlightjs: {
|
highlightjs: {
|
||||||
exports: 'hljs'
|
exports: 'hljs'
|
||||||
},
|
},
|
||||||
'google-code-prettify': {
|
|
||||||
exports: 'prettyPrint'
|
|
||||||
},
|
|
||||||
'bootstrap-tour': {
|
'bootstrap-tour': {
|
||||||
deps: ['bootstrap'],
|
deps: ['bootstrap'],
|
||||||
exports: 'Tour'
|
exports: 'Tour'
|
||||||
|
Loading…
Reference in New Issue
Block a user