uploads
This commit is contained in:
parent
c77fa82d5a
commit
d4cb98bb94
53
editormd.js
53
editormd.js
@ -496,6 +496,8 @@
|
||||
var _this = this;
|
||||
var settings = this.settings;
|
||||
var loadPath = settings.path;
|
||||
|
||||
var cdnjs = "https://cdnjs.cloudflare.com/ajax/libs";
|
||||
|
||||
var loadFlowChartOrSequenceDiagram = function() {
|
||||
|
||||
@ -508,19 +510,19 @@
|
||||
|
||||
if (settings.flowChart || settings.sequenceDiagram)
|
||||
{
|
||||
editormd.loadScript(loadPath + "raphael.min", function() {
|
||||
editormd.loadScript(cdnjs + "/raphael/2.2.7/raphael.min", function() {
|
||||
|
||||
editormd.loadScript(loadPath + "underscore.min", function() {
|
||||
editormd.loadScript(cdnjs + "/underscore.js/1.9.1/underscore-min", function() {
|
||||
|
||||
if (!settings.flowChart && settings.sequenceDiagram)
|
||||
{
|
||||
editormd.loadScript(loadPath + "sequence-diagram.min", function() {
|
||||
editormd.loadScript(cdnjs + "/js-sequence-diagrams/1.0.6/sequence-diagram-min", function() {
|
||||
_this.loadedDisplay();
|
||||
});
|
||||
}
|
||||
else if (settings.flowChart && !settings.sequenceDiagram)
|
||||
{
|
||||
editormd.loadScript(loadPath + "flowchart.min", function() {
|
||||
editormd.loadScript(cdnjs + "/flowchart/1.11.3/flowchart.min", function() {
|
||||
editormd.loadScript(loadPath + "jquery.flowchart.min", function() {
|
||||
_this.loadedDisplay();
|
||||
});
|
||||
@ -528,9 +530,9 @@
|
||||
}
|
||||
else if (settings.flowChart && settings.sequenceDiagram)
|
||||
{
|
||||
editormd.loadScript(loadPath + "flowchart.min", function() {
|
||||
editormd.loadScript(cdnjs + "/flowchart/1.11.3/flowchart.min", function() {
|
||||
editormd.loadScript(loadPath + "jquery.flowchart.min", function() {
|
||||
editormd.loadScript(loadPath + "sequence-diagram.min", function() {
|
||||
editormd.loadScript(cdnjs + "/js-sequence-diagrams/1.0.6/sequence-diagram-min", function() {
|
||||
_this.loadedDisplay();
|
||||
});
|
||||
});
|
||||
@ -577,13 +579,13 @@
|
||||
|
||||
_this.setToolbar();
|
||||
|
||||
editormd.loadScript(loadPath + "marked.min", function() {
|
||||
editormd.loadScript(cdnjs + "/marked/0.5.1/marked.min", function() {
|
||||
|
||||
editormd.$marked = marked;
|
||||
|
||||
if (settings.previewCodeHighlight)
|
||||
{
|
||||
editormd.loadScript(loadPath + "prettify.min", function() {
|
||||
editormd.loadScript(cdnjs + "/prettify/r298/prettify.min", function() {
|
||||
loadFlowChartOrSequenceDiagram();
|
||||
});
|
||||
}
|
||||
@ -714,6 +716,7 @@
|
||||
styleSelectedText : settings.styleSelectedText,
|
||||
autoCloseBrackets : settings.autoCloseBrackets,
|
||||
showTrailingSpace : settings.showTrailingSpace,
|
||||
inputStyle : 'textarea',
|
||||
highlightSelectionMatches : ( (!settings.matchWordHighlight) ? false : { showToken: (settings.matchWordHighlight === "onselected") ? false : /\w/ } )
|
||||
};
|
||||
|
||||
@ -1247,7 +1250,8 @@
|
||||
var toolbarIcons = this.toolbarIcons = toolbar.find("." + classPrefix + "menu > li > a");
|
||||
var toolbarIconHandlers = this.getToolbarHandles();
|
||||
|
||||
toolbarIcons.bind(editormd.mouseOrTouch("click", "touchend"), function(event) {
|
||||
//-- toolbarIcons.bind(editormd.mouseOrTouch("click", "touchend"), function(event) {
|
||||
toolbarIcons.on(editormd.mouseOrTouch("click", "touchend"), function(event) {
|
||||
|
||||
var icon = $(this).children(".fa");
|
||||
var name = icon.attr("name");
|
||||
@ -1766,7 +1770,7 @@
|
||||
if (!settings.syncScrolling) {
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
cm.on("change", function(_cm, changeObj) {
|
||||
|
||||
if (settings.watch)
|
||||
@ -2030,8 +2034,9 @@
|
||||
{
|
||||
this.htmlTextarea.text(newMarkdownDoc);
|
||||
}
|
||||
|
||||
if(settings.watch || (!settings.watch && state.preview))
|
||||
|
||||
//-- if(settings.watch || (!settings.watch && state.preview))
|
||||
if(settings.watch || (!settings.watch || state.preview))
|
||||
{
|
||||
previewContainer.html(newMarkdownDoc);
|
||||
|
||||
@ -3364,13 +3369,15 @@
|
||||
|
||||
// Emoji graphics files url path
|
||||
editormd.emoji = {
|
||||
path : "http://www.emoji-cheat-sheet.com/graphics/emojis/",
|
||||
//-- path : "http://www.emoji-cheat-sheet.com/graphics/emojis/",
|
||||
path : "https://www.webfx.com/tools/emoji-cheat-sheet/graphics/emojis/",
|
||||
ext : ".png"
|
||||
};
|
||||
|
||||
// Twitter Emoji (Twemoji) graphics files url path
|
||||
editormd.twemoji = {
|
||||
path : "http://twemoji.maxcdn.com/36x36/",
|
||||
//-- path : "http://twemoji.maxcdn.com/36x36/",
|
||||
path : "https://twemoji.maxcdn.com/36x36/",
|
||||
ext : ".png"
|
||||
};
|
||||
|
||||
@ -3464,6 +3471,10 @@
|
||||
return "<img src=\"" + editormd.twemoji.path + twe + editormd.twemoji.ext + "\" title=\"twemoji-" + twe + "\" alt=\"twemoji-" + twe + "\" class=\"emoji twemoji\" />";
|
||||
}
|
||||
}
|
||||
else if (name === "thinking") // cavern emoji
|
||||
{
|
||||
return "<img src=\"theme/thinking.png\" class=\"emoji\" title=\":thinking:\" alt=\":thinking:\" />";
|
||||
}
|
||||
else
|
||||
{
|
||||
var src = (name === "+1") ? "plus1" : name;
|
||||
@ -3521,7 +3532,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
var out = "<a href=\"" + href + "\"";
|
||||
var out = "<a href=\"" + href.replace(/@/g, "%40") + "\"";
|
||||
|
||||
if (atLinkReg.test(title) || atLinkReg.test(text))
|
||||
{
|
||||
@ -3577,7 +3588,7 @@
|
||||
|
||||
var headingHTML = "<h" + level + " id=\"h"+ level + "-" + this.options.headerPrefix + id +"\">";
|
||||
|
||||
headingHTML += "<a name=\"" + text + "\" class=\"reference-link\"></a>";
|
||||
headingHTML += "<a name=\"" + _.escape(text) + "\" class=\"reference-link\"></a>";
|
||||
headingHTML += "<span class=\"header-link octicon octicon-link\"></span>";
|
||||
headingHTML += (hasLinkReg) ? this.atLink(this.emoji(linkText)) : this.atLink(this.emoji(text));
|
||||
headingHTML += "</h" + level + ">";
|
||||
@ -3809,7 +3820,7 @@
|
||||
editormd.filterHTMLTags = function(html, filters) {
|
||||
|
||||
if (typeof html !== "string") {
|
||||
html = new String(html);
|
||||
html = new String(html).valueOf();
|
||||
}
|
||||
|
||||
if (typeof filters !== "string") {
|
||||
@ -3956,7 +3967,7 @@
|
||||
smartypants : true
|
||||
};
|
||||
|
||||
markdownDoc = new String(markdownDoc);
|
||||
markdownDoc = new String(markdownDoc).valueOf();
|
||||
|
||||
var markdownParsed = marked(markdownDoc, markedOptions);
|
||||
|
||||
@ -4178,8 +4189,10 @@
|
||||
// 使用国外的CDN,加载速度有时会很慢,或者自定义URL
|
||||
// You can custom KaTeX load url.
|
||||
editormd.katexURL = {
|
||||
css : "//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min",
|
||||
js : "//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min"
|
||||
//-- css : "//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min",
|
||||
//-- js : "//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min"
|
||||
css : "https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.9.0/katex.min",
|
||||
js : "https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.9.0/katex.min"
|
||||
};
|
||||
|
||||
editormd.kaTeXLoaded = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user