Fixed constants module

This commit is contained in:
benweet 2013-11-09 00:09:42 +00:00
parent b20ea7949f
commit d3069049b2
4 changed files with 19 additions and 20 deletions

View File

@ -76,4 +76,6 @@ define([], function() {
"night": "Night", "night": "Night",
"school": "School", "school": "School",
}; };
return constants;
}); });

View File

@ -221,20 +221,6 @@ define([
previewContentsElt = document.getElementById('preview-contents'); previewContentsElt = document.getElementById('preview-contents');
$previewContentsElt = $(previewContentsElt); $previewContentsElt = $(previewContentsElt);
if(window.viewerMode === false) {
// Create accordion in settings dialog
var accordionHtml = _.chain(extensionList).sortBy(function(extension) {
return extension.extensionName.toLowerCase();
}).reduce(function(html, extension) {
return html + (extension.settingsBlock ? _.template(settingsExtensionsAccordionHTML, {
extensionId: extension.extensionId,
extensionName: extension.extensionName,
isOptional: extension.isOptional,
settingsBlock: extension.settingsBlock
}) : "");
}, "").value();
document.querySelector('.accordion-extensions').innerHTML = accordionHtml;
// Create a button from an extension listener // Create a button from an extension listener
var createBtn = function(listener) { var createBtn = function(listener) {
var buttonGrpElt = crel('div', { var buttonGrpElt = crel('div', {
@ -250,6 +236,20 @@ define([
return buttonGrpElt; return buttonGrpElt;
}; };
if(window.viewerMode === false) {
// Create accordion in settings dialog
var accordionHtml = _.chain(extensionList).sortBy(function(extension) {
return extension.extensionName.toLowerCase();
}).reduce(function(html, extension) {
return html + (extension.settingsBlock ? _.template(settingsExtensionsAccordionHTML, {
extensionId: extension.extensionId,
extensionName: extension.extensionName,
isOptional: extension.isOptional,
settingsBlock: extension.settingsBlock
}) : "");
}, "").value();
document.querySelector('.accordion-extensions').innerHTML = accordionHtml;
// Create extension buttons // Create extension buttons
logger.log("onCreateButton"); logger.log("onCreateButton");
var onCreateButtonListenerList = getExtensionListenerList("onCreateButton"); var onCreateButtonListenerList = getExtensionListenerList("onCreateButton");

View File

@ -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);

View File

@ -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'