|
|
|
@ -7,7 +7,7 @@
|
|
|
|
|
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.SimpleMDE = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
|
|
|
|
|
(function (global){
|
|
|
|
|
|
|
|
|
|
; Typo = global.Typo = require("/Users/vladson/projects/simplemde-markdown-editor/node_modules/codemirror-spell-checker/src/js/typo.js");
|
|
|
|
|
; Typo = global.Typo = require("C:\\Users\\Jamie Wohletz\\Documents\\Code\\simplemde-markdown-editor\\node_modules\\codemirror-spell-checker\\src\\js\\typo.js");
|
|
|
|
|
CodeMirror = global.CodeMirror = require("codemirror");
|
|
|
|
|
; var __browserify_shim_require__=require;(function browserifyShim(module, define, require) {
|
|
|
|
|
// Initialize data globally to reduce memory consumption
|
|
|
|
@ -105,7 +105,7 @@ if(!String.prototype.includes) {
|
|
|
|
|
}).call(global, module, undefined, undefined);
|
|
|
|
|
|
|
|
|
|
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
|
|
|
},{"/Users/vladson/projects/simplemde-markdown-editor/node_modules/codemirror-spell-checker/src/js/typo.js":2,"codemirror":6}],2:[function(require,module,exports){
|
|
|
|
|
},{"C:\\Users\\Jamie Wohletz\\Documents\\Code\\simplemde-markdown-editor\\node_modules\\codemirror-spell-checker\\src\\js\\typo.js":2,"codemirror":7}],2:[function(require,module,exports){
|
|
|
|
|
(function (global){
|
|
|
|
|
; var __browserify_shim_require__=require;(function browserifyShim(module, exports, require, define, browserify_shim__define__module__export__) {
|
|
|
|
|
'use strict';
|
|
|
|
@ -922,7 +922,69 @@ Typo.prototype = {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
},{"../../lib/codemirror":6}],4:[function(require,module,exports){
|
|
|
|
|
},{"../../lib/codemirror":7}],4:[function(require,module,exports){
|
|
|
|
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
|
|
|
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
|
|
|
|
|
|
|
|
|
(function(mod) {
|
|
|
|
|
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
|
|
|
|
mod(require("../../lib/codemirror"));
|
|
|
|
|
else if (typeof define == "function" && define.amd) // AMD
|
|
|
|
|
define(["../../lib/codemirror"], mod);
|
|
|
|
|
else // Plain browser env
|
|
|
|
|
mod(CodeMirror);
|
|
|
|
|
})(function(CodeMirror) {
|
|
|
|
|
CodeMirror.defineOption("placeholder", "", function(cm, val, old) {
|
|
|
|
|
var prev = old && old != CodeMirror.Init;
|
|
|
|
|
if (val && !prev) {
|
|
|
|
|
cm.on("blur", onBlur);
|
|
|
|
|
cm.on("change", onChange);
|
|
|
|
|
onChange(cm);
|
|
|
|
|
} else if (!val && prev) {
|
|
|
|
|
cm.off("blur", onBlur);
|
|
|
|
|
cm.off("change", onChange);
|
|
|
|
|
clearPlaceholder(cm);
|
|
|
|
|
var wrapper = cm.getWrapperElement();
|
|
|
|
|
wrapper.className = wrapper.className.replace(" CodeMirror-empty", "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (val && !cm.hasFocus()) onBlur(cm);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function clearPlaceholder(cm) {
|
|
|
|
|
if (cm.state.placeholder) {
|
|
|
|
|
cm.state.placeholder.parentNode.removeChild(cm.state.placeholder);
|
|
|
|
|
cm.state.placeholder = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function setPlaceholder(cm) {
|
|
|
|
|
clearPlaceholder(cm);
|
|
|
|
|
var elt = cm.state.placeholder = document.createElement("pre");
|
|
|
|
|
elt.style.cssText = "height: 0; overflow: visible";
|
|
|
|
|
elt.className = "CodeMirror-placeholder";
|
|
|
|
|
var placeHolder = cm.getOption("placeholder")
|
|
|
|
|
if (typeof placeHolder == "string") placeHolder = document.createTextNode(placeHolder)
|
|
|
|
|
elt.appendChild(placeHolder)
|
|
|
|
|
cm.display.lineSpace.insertBefore(elt, cm.display.lineSpace.firstChild);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function onBlur(cm) {
|
|
|
|
|
if (isEmpty(cm)) setPlaceholder(cm);
|
|
|
|
|
}
|
|
|
|
|
function onChange(cm) {
|
|
|
|
|
var wrapper = cm.getWrapperElement(), empty = isEmpty(cm);
|
|
|
|
|
wrapper.className = wrapper.className.replace(" CodeMirror-empty", "") + (empty ? " CodeMirror-empty" : "");
|
|
|
|
|
|
|
|
|
|
if (empty) setPlaceholder(cm);
|
|
|
|
|
else clearPlaceholder(cm);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function isEmpty(cm) {
|
|
|
|
|
return (cm.lineCount() === 1) && (cm.getLine(0) === "");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
},{"../../lib/codemirror":7}],5:[function(require,module,exports){
|
|
|
|
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
|
|
|
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
|
|
|
|
|
|
|
|
@ -975,7 +1037,7 @@ Typo.prototype = {
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
},{"../../lib/codemirror":6}],5:[function(require,module,exports){
|
|
|
|
|
},{"../../lib/codemirror":7}],6:[function(require,module,exports){
|
|
|
|
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
|
|
|
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
|
|
|
|
|
|
|
|
@ -1062,7 +1124,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
},{"../../lib/codemirror":6}],6:[function(require,module,exports){
|
|
|
|
|
},{"../../lib/codemirror":7}],7:[function(require,module,exports){
|
|
|
|
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
|
|
|
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
|
|
|
|
|
|
|
|
@ -2316,13 +2378,14 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
on(te, "paste", function(e) {
|
|
|
|
|
if (handlePaste(e, cm)) return true;
|
|
|
|
|
if (signalDOMEvent(cm, e) || handlePaste(e, cm)) return
|
|
|
|
|
|
|
|
|
|
cm.state.pasteIncoming = true;
|
|
|
|
|
input.fastPoll();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function prepareCopyCut(e) {
|
|
|
|
|
if (signalDOMEvent(cm, e)) return
|
|
|
|
|
if (cm.somethingSelected()) {
|
|
|
|
|
lastCopied = cm.getSelections();
|
|
|
|
|
if (input.inaccurateSelection) {
|
|
|
|
@ -2350,7 +2413,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|
|
|
|
on(te, "copy", prepareCopyCut);
|
|
|
|
|
|
|
|
|
|
on(display.scroller, "paste", function(e) {
|
|
|
|
|
if (eventInWidget(display, e)) return;
|
|
|
|
|
if (eventInWidget(display, e) || signalDOMEvent(cm, e)) return;
|
|
|
|
|
cm.state.pasteIncoming = true;
|
|
|
|
|
input.focus();
|
|
|
|
|
});
|
|
|
|
@ -2635,7 +2698,9 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|
|
|
|
var div = input.div = display.lineDiv;
|
|
|
|
|
disableBrowserMagic(div);
|
|
|
|
|
|
|
|
|
|
on(div, "paste", function(e) { handlePaste(e, cm); })
|
|
|
|
|
on(div, "paste", function(e) {
|
|
|
|
|
if (!signalDOMEvent(cm, e)) handlePaste(e, cm);
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
on(div, "compositionstart", function(e) {
|
|
|
|
|
var data = e.data;
|
|
|
|
@ -2678,6 +2743,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function onCopyCut(e) {
|
|
|
|
|
if (signalDOMEvent(cm, e)) return
|
|
|
|
|
if (cm.somethingSelected()) {
|
|
|
|
|
lastCopied = cm.getSelections();
|
|
|
|
|
if (e.type == "cut") cm.replaceSelection("", null, "cut");
|
|
|
|
@ -3220,7 +3286,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|
|
|
|
|
|
|
|
|
// Give beforeSelectionChange handlers a change to influence a
|
|
|
|
|
// selection update.
|
|
|
|
|
function filterSelectionChange(doc, sel) {
|
|
|
|
|
function filterSelectionChange(doc, sel, options) {
|
|
|
|
|
var obj = {
|
|
|
|
|
ranges: sel.ranges,
|
|
|
|
|
update: function(ranges) {
|
|
|
|
@ -3228,7 +3294,8 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|
|
|
|
for (var i = 0; i < ranges.length; i++)
|
|
|
|
|
this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),
|
|
|
|
|
clipPos(doc, ranges[i].head));
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
origin: options && options.origin
|
|
|
|
|
};
|
|
|
|
|
signal(doc, "beforeSelectionChange", doc, obj);
|
|
|
|
|
if (doc.cm) signal(doc.cm, "beforeSelectionChange", doc.cm, obj);
|
|
|
|
@ -3254,7 +3321,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|
|
|
|
|
|
|
|
|
function setSelectionNoUndo(doc, sel, options) {
|
|
|
|
|
if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange"))
|
|
|
|
|
sel = filterSelectionChange(doc, sel);
|
|
|
|
|
sel = filterSelectionChange(doc, sel, options);
|
|
|
|
|
|
|
|
|
|
var bias = options && options.bias ||
|
|
|
|
|
(cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);
|
|
|
|
@ -8151,7 +8218,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|
|
|
|
if (nextChange == pos) { // Update current marker set
|
|
|
|
|
spanStyle = spanEndStyle = spanStartStyle = title = css = "";
|
|
|
|
|
collapsed = null; nextChange = Infinity;
|
|
|
|
|
var foundBookmarks = [];
|
|
|
|
|
var foundBookmarks = [], endStyles
|
|
|
|
|
for (var j = 0; j < spans.length; ++j) {
|
|
|
|
|
var sp = spans[j], m = sp.marker;
|
|
|
|
|
if (m.type == "bookmark" && sp.from == pos && m.widgetNode) {
|
|
|
|
@ -8164,7 +8231,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|
|
|
|
if (m.className) spanStyle += " " + m.className;
|
|
|
|
|
if (m.css) css = (css ? css + ";" : "") + m.css;
|
|
|
|
|
if (m.startStyle && sp.from == pos) spanStartStyle += " " + m.startStyle;
|
|
|
|
|
if (m.endStyle && sp.to == nextChange) spanEndStyle += " " + m.endStyle;
|
|
|
|
|
if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to)
|
|
|
|
|
if (m.title && !title) title = m.title;
|
|
|
|
|
if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))
|
|
|
|
|
collapsed = sp;
|
|
|
|
@ -8172,6 +8239,9 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|
|
|
|
nextChange = sp.from;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (endStyles) for (var j = 0; j < endStyles.length; j += 2)
|
|
|
|
|
if (endStyles[j + 1] == nextChange) spanEndStyle += " " + endStyles[j]
|
|
|
|
|
|
|
|
|
|
if (collapsed && (collapsed.from || 0) == pos) {
|
|
|
|
|
buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,
|
|
|
|
|
collapsed.marker, collapsed.from == null);
|
|
|
|
@ -8519,10 +8589,11 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|
|
|
|
extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);
|
|
|
|
|
}),
|
|
|
|
|
extendSelections: docMethodOp(function(heads, options) {
|
|
|
|
|
extendSelections(this, clipPosArray(this, heads, options));
|
|
|
|
|
extendSelections(this, clipPosArray(this, heads), options);
|
|
|
|
|
}),
|
|
|
|
|
extendSelectionsBy: docMethodOp(function(f, options) {
|
|
|
|
|
extendSelections(this, map(this.sel.ranges, f), options);
|
|
|
|
|
var heads = map(this.sel.ranges, f);
|
|
|
|
|
extendSelections(this, clipPosArray(this, heads), options);
|
|
|
|
|
}),
|
|
|
|
|
setSelections: docMethodOp(function(ranges, primary, options) {
|
|
|
|
|
if (!ranges.length) return;
|
|
|
|
@ -9939,12 +10010,12 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|
|
|
|
|
|
|
|
|
// THE END
|
|
|
|
|
|
|
|
|
|
CodeMirror.version = "5.9.1";
|
|
|
|
|
CodeMirror.version = "5.10.1";
|
|
|
|
|
|
|
|
|
|
return CodeMirror;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
},{}],7:[function(require,module,exports){
|
|
|
|
|
},{}],8:[function(require,module,exports){
|
|
|
|
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
|
|
|
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
|
|
|
|
|
|
|
|
@ -10076,7 +10147,7 @@ CodeMirror.defineMode("gfm", function(config, modeConfig) {
|
|
|
|
|
CodeMirror.defineMIME("text/x-gfm", "gfm");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
},{"../../addon/mode/overlay":5,"../../lib/codemirror":6,"../markdown/markdown":8}],8:[function(require,module,exports){
|
|
|
|
|
},{"../../addon/mode/overlay":6,"../../lib/codemirror":7,"../markdown/markdown":9}],9:[function(require,module,exports){
|
|
|
|
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
|
|
|
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
|
|
|
|
|
|
|
|
@ -10699,7 +10770,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function footnoteLink(stream, state) {
|
|
|
|
|
if (stream.match(/^[^\]]*\]:/, false)) {
|
|
|
|
|
if (stream.match(/^([^\]\\]|\\.)*\]:/, false)) {
|
|
|
|
|
state.f = footnoteLinkInside;
|
|
|
|
|
stream.next(); // Consume [
|
|
|
|
|
if (modeCfg.highlightFormatting) state.formatting = "link";
|
|
|
|
@ -10718,7 +10789,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|
|
|
|
return returnType;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
stream.match(/^[^\]]+/, true);
|
|
|
|
|
stream.match(/^([^\]\\]|\\.)+/, true);
|
|
|
|
|
|
|
|
|
|
return tokenTypes.linkText;
|
|
|
|
|
}
|
|
|
|
@ -10881,7 +10952,7 @@ CodeMirror.defineMIME("text/x-markdown", "markdown");
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
},{"../../lib/codemirror":6,"../meta":9,"../xml/xml":10}],9:[function(require,module,exports){
|
|
|
|
|
},{"../../lib/codemirror":7,"../meta":10,"../xml/xml":11}],10:[function(require,module,exports){
|
|
|
|
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
|
|
|
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
|
|
|
|
|
|
|
|
@ -10912,6 +10983,7 @@ CodeMirror.defineMIME("text/x-markdown", "markdown");
|
|
|
|
|
{name: "Common Lisp", mime: "text/x-common-lisp", mode: "commonlisp", ext: ["cl", "lisp", "el"], alias: ["lisp"]},
|
|
|
|
|
{name: "Cypher", mime: "application/x-cypher-query", mode: "cypher", ext: ["cyp", "cypher"]},
|
|
|
|
|
{name: "Cython", mime: "text/x-cython", mode: "python", ext: ["pyx", "pxd", "pxi"]},
|
|
|
|
|
{name: "Crystal", mime: "text/x-crystal", mode: "crystal", ext: ["cr"]},
|
|
|
|
|
{name: "CSS", mime: "text/css", mode: "css", ext: ["css"]},
|
|
|
|
|
{name: "CQL", mime: "text/x-cassandra", mode: "sql", ext: ["cql"]},
|
|
|
|
|
{name: "D", mime: "text/x-d", mode: "d", ext: ["d"]},
|
|
|
|
@ -10939,6 +11011,7 @@ CodeMirror.defineMIME("text/x-markdown", "markdown");
|
|
|
|
|
{name: "Groovy", mime: "text/x-groovy", mode: "groovy", ext: ["groovy"]},
|
|
|
|
|
{name: "HAML", mime: "text/x-haml", mode: "haml", ext: ["haml"]},
|
|
|
|
|
{name: "Haskell", mime: "text/x-haskell", mode: "haskell", ext: ["hs"]},
|
|
|
|
|
{name: "Haskell (Literate)", mime: "text/x-literate-haskell", mode: "haskell-literate", ext: ["lhs"]},
|
|
|
|
|
{name: "Haxe", mime: "text/x-haxe", mode: "haxe", ext: ["hx"]},
|
|
|
|
|
{name: "HXML", mime: "text/x-hxml", mode: "haxe", ext: ["hxml"]},
|
|
|
|
|
{name: "ASP.NET", mime: "application/x-aspx", mode: "htmlembedded", ext: ["aspx"], alias: ["asp", "aspx"]},
|
|
|
|
@ -10952,6 +11025,7 @@ CodeMirror.defineMIME("text/x-markdown", "markdown");
|
|
|
|
|
mode: "javascript", ext: ["js"], alias: ["ecmascript", "js", "node"]},
|
|
|
|
|
{name: "JSON", mimes: ["application/json", "application/x-json"], mode: "javascript", ext: ["json", "map"], alias: ["json5"]},
|
|
|
|
|
{name: "JSON-LD", mime: "application/ld+json", mode: "javascript", ext: ["jsonld"], alias: ["jsonld"]},
|
|
|
|
|
{name: "JSX", mime: "text/jsx", mode: "jsx", ext: ["jsx"]},
|
|
|
|
|
{name: "Jinja2", mime: "null", mode: "jinja2"},
|
|
|
|
|
{name: "Julia", mime: "text/x-julia", mode: "julia", ext: ["jl"]},
|
|
|
|
|
{name: "Kotlin", mime: "text/x-kotlin", mode: "clike", ext: ["kt"]},
|
|
|
|
@ -11080,7 +11154,7 @@ CodeMirror.defineMIME("text/x-markdown", "markdown");
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
},{"../lib/codemirror":6}],10:[function(require,module,exports){
|
|
|
|
|
},{"../lib/codemirror":7}],11:[function(require,module,exports){
|
|
|
|
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
|
|
|
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
|
|
|
|
|
|
|
|
@ -11094,54 +11168,56 @@ CodeMirror.defineMIME("text/x-markdown", "markdown");
|
|
|
|
|
})(function(CodeMirror) {
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
CodeMirror.defineMode("xml", function(config, parserConfig) {
|
|
|
|
|
var indentUnit = config.indentUnit;
|
|
|
|
|
var multilineTagIndentFactor = parserConfig.multilineTagIndentFactor || 1;
|
|
|
|
|
var multilineTagIndentPastTag = parserConfig.multilineTagIndentPastTag;
|
|
|
|
|
if (multilineTagIndentPastTag == null) multilineTagIndentPastTag = true;
|
|
|
|
|
|
|
|
|
|
var Kludges = parserConfig.htmlMode ? {
|
|
|
|
|
autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,
|
|
|
|
|
'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,
|
|
|
|
|
'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,
|
|
|
|
|
'track': true, 'wbr': true, 'menuitem': true},
|
|
|
|
|
implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,
|
|
|
|
|
'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,
|
|
|
|
|
'th': true, 'tr': true},
|
|
|
|
|
contextGrabbers: {
|
|
|
|
|
'dd': {'dd': true, 'dt': true},
|
|
|
|
|
'dt': {'dd': true, 'dt': true},
|
|
|
|
|
'li': {'li': true},
|
|
|
|
|
'option': {'option': true, 'optgroup': true},
|
|
|
|
|
'optgroup': {'optgroup': true},
|
|
|
|
|
'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,
|
|
|
|
|
'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,
|
|
|
|
|
'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,
|
|
|
|
|
'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,
|
|
|
|
|
'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},
|
|
|
|
|
'rp': {'rp': true, 'rt': true},
|
|
|
|
|
'rt': {'rp': true, 'rt': true},
|
|
|
|
|
'tbody': {'tbody': true, 'tfoot': true},
|
|
|
|
|
'td': {'td': true, 'th': true},
|
|
|
|
|
'tfoot': {'tbody': true},
|
|
|
|
|
'th': {'td': true, 'th': true},
|
|
|
|
|
'thead': {'tbody': true, 'tfoot': true},
|
|
|
|
|
'tr': {'tr': true}
|
|
|
|
|
},
|
|
|
|
|
doNotIndent: {"pre": true},
|
|
|
|
|
allowUnquoted: true,
|
|
|
|
|
allowMissing: true,
|
|
|
|
|
caseFold: true
|
|
|
|
|
} : {
|
|
|
|
|
autoSelfClosers: {},
|
|
|
|
|
implicitlyClosed: {},
|
|
|
|
|
contextGrabbers: {},
|
|
|
|
|
doNotIndent: {},
|
|
|
|
|
allowUnquoted: false,
|
|
|
|
|
allowMissing: false,
|
|
|
|
|
caseFold: false
|
|
|
|
|
};
|
|
|
|
|
var alignCDATA = parserConfig.alignCDATA;
|
|
|
|
|
var htmlConfig = {
|
|
|
|
|
autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,
|
|
|
|
|
'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,
|
|
|
|
|
'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,
|
|
|
|
|
'track': true, 'wbr': true, 'menuitem': true},
|
|
|
|
|
implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,
|
|
|
|
|
'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,
|
|
|
|
|
'th': true, 'tr': true},
|
|
|
|
|
contextGrabbers: {
|
|
|
|
|
'dd': {'dd': true, 'dt': true},
|
|
|
|
|
'dt': {'dd': true, 'dt': true},
|
|
|
|
|
'li': {'li': true},
|
|
|
|
|
'option': {'option': true, 'optgroup': true},
|
|
|
|
|
'optgroup': {'optgroup': true},
|
|
|
|
|
'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,
|
|
|
|
|
'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,
|
|
|
|
|
'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,
|
|
|
|
|
'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,
|
|
|
|
|
'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},
|
|
|
|
|
'rp': {'rp': true, 'rt': true},
|
|
|
|
|
'rt': {'rp': true, 'rt': true},
|
|
|
|
|
'tbody': {'tbody': true, 'tfoot': true},
|
|
|
|
|
'td': {'td': true, 'th': true},
|
|
|
|
|
'tfoot': {'tbody': true},
|
|
|
|
|
'th': {'td': true, 'th': true},
|
|
|
|
|
'thead': {'tbody': true, 'tfoot': true},
|
|
|
|
|
'tr': {'tr': true}
|
|
|
|
|
},
|
|
|
|
|
doNotIndent: {"pre": true},
|
|
|
|
|
allowUnquoted: true,
|
|
|
|
|
allowMissing: true,
|
|
|
|
|
caseFold: true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var xmlConfig = {
|
|
|
|
|
autoSelfClosers: {},
|
|
|
|
|
implicitlyClosed: {},
|
|
|
|
|
contextGrabbers: {},
|
|
|
|
|
doNotIndent: {},
|
|
|
|
|
allowUnquoted: false,
|
|
|
|
|
allowMissing: false,
|
|
|
|
|
caseFold: false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CodeMirror.defineMode("xml", function(editorConf, config_) {
|
|
|
|
|
var indentUnit = editorConf.indentUnit
|
|
|
|
|
var config = {}
|
|
|
|
|
var defaults = config_.htmlMode ? htmlConfig : xmlConfig
|
|
|
|
|
for (var prop in defaults) config[prop] = defaults[prop]
|
|
|
|
|
for (var prop in config_) config[prop] = config_[prop]
|
|
|
|
|
|
|
|
|
|
// Return variables for tokenizers
|
|
|
|
|
var type, setStyle;
|
|
|
|
@ -11271,7 +11347,7 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
|
|
|
|
|
this.tagName = tagName;
|
|
|
|
|
this.indent = state.indented;
|
|
|
|
|
this.startOfLine = startOfLine;
|
|
|
|
|
if (Kludges.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))
|
|
|
|
|
if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))
|
|
|
|
|
this.noIndent = true;
|
|
|
|
|
}
|
|
|
|
|
function popContext(state) {
|
|
|
|
@ -11284,8 +11360,8 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
parentTagName = state.context.tagName;
|
|
|
|
|
if (!Kludges.contextGrabbers.hasOwnProperty(parentTagName) ||
|
|
|
|
|
!Kludges.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
|
|
|
|
|
if (!config.contextGrabbers.hasOwnProperty(parentTagName) ||
|
|
|
|
|
!config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
popContext(state);
|
|
|
|
@ -11316,7 +11392,7 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
|
|
|
|
|
if (type == "word") {
|
|
|
|
|
var tagName = stream.current();
|
|
|
|
|
if (state.context && state.context.tagName != tagName &&
|
|
|
|
|
Kludges.implicitlyClosed.hasOwnProperty(state.context.tagName))
|
|
|
|
|
config.implicitlyClosed.hasOwnProperty(state.context.tagName))
|
|
|
|
|
popContext(state);
|
|
|
|
|
if (state.context && state.context.tagName == tagName) {
|
|
|
|
|
setStyle = "tag";
|
|
|
|
@ -11352,7 +11428,7 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
|
|
|
|
|
var tagName = state.tagName, tagStart = state.tagStart;
|
|
|
|
|
state.tagName = state.tagStart = null;
|
|
|
|
|
if (type == "selfcloseTag" ||
|
|
|
|
|
Kludges.autoSelfClosers.hasOwnProperty(tagName)) {
|
|
|
|
|
config.autoSelfClosers.hasOwnProperty(tagName)) {
|
|
|
|
|
maybePopContext(state, tagName);
|
|
|
|
|
} else {
|
|
|
|
|
maybePopContext(state, tagName);
|
|
|
|
@ -11365,12 +11441,12 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
|
|
|
|
|
}
|
|
|
|
|
function attrEqState(type, stream, state) {
|
|
|
|
|
if (type == "equals") return attrValueState;
|
|
|
|
|
if (!Kludges.allowMissing) setStyle = "error";
|
|
|
|
|
if (!config.allowMissing) setStyle = "error";
|
|
|
|
|
return attrState(type, stream, state);
|
|
|
|
|
}
|
|
|
|
|
function attrValueState(type, stream, state) {
|
|
|
|
|
if (type == "string") return attrContinuedState;
|
|
|
|
|
if (type == "word" && Kludges.allowUnquoted) {setStyle = "string"; return attrState;}
|
|
|
|
|
if (type == "word" && config.allowUnquoted) {setStyle = "string"; return attrState;}
|
|
|
|
|
setStyle = "error";
|
|
|
|
|
return attrState(type, stream, state);
|
|
|
|
|
}
|
|
|
|
@ -11380,12 +11456,14 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
startState: function() {
|
|
|
|
|
return {tokenize: inText,
|
|
|
|
|
state: baseState,
|
|
|
|
|
indented: 0,
|
|
|
|
|
tagName: null, tagStart: null,
|
|
|
|
|
context: null};
|
|
|
|
|
startState: function(baseIndent) {
|
|
|
|
|
var state = {tokenize: inText,
|
|
|
|
|
state: baseState,
|
|
|
|
|
indented: baseIndent || 0,
|
|
|
|
|
tagName: null, tagStart: null,
|
|
|
|
|
context: null}
|
|
|
|
|
if (baseIndent != null) state.baseIndent = baseIndent
|
|
|
|
|
return state
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
token: function(stream, state) {
|
|
|
|
@ -11418,19 +11496,19 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
|
|
|
|
|
return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0;
|
|
|
|
|
// Indent the starts of attribute names.
|
|
|
|
|
if (state.tagName) {
|
|
|
|
|
if (multilineTagIndentPastTag)
|
|
|
|
|
if (config.multilineTagIndentPastTag !== false)
|
|
|
|
|
return state.tagStart + state.tagName.length + 2;
|
|
|
|
|
else
|
|
|
|
|
return state.tagStart + indentUnit * multilineTagIndentFactor;
|
|
|
|
|
return state.tagStart + indentUnit * (config.multilineTagIndentFactor || 1);
|
|
|
|
|
}
|
|
|
|
|
if (alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0;
|
|
|
|
|
if (config.alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0;
|
|
|
|
|
var tagAfter = textAfter && /^<(\/)?([\w_:\.-]*)/.exec(textAfter);
|
|
|
|
|
if (tagAfter && tagAfter[1]) { // Closing tag spotted
|
|
|
|
|
while (context) {
|
|
|
|
|
if (context.tagName == tagAfter[2]) {
|
|
|
|
|
context = context.prev;
|
|
|
|
|
break;
|
|
|
|
|
} else if (Kludges.implicitlyClosed.hasOwnProperty(context.tagName)) {
|
|
|
|
|
} else if (config.implicitlyClosed.hasOwnProperty(context.tagName)) {
|
|
|
|
|
context = context.prev;
|
|
|
|
|
} else {
|
|
|
|
|
break;
|
|
|
|
@ -11438,25 +11516,30 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
|
|
|
|
|
}
|
|
|
|
|
} else if (tagAfter) { // Opening tag spotted
|
|
|
|
|
while (context) {
|
|
|
|
|
var grabbers = Kludges.contextGrabbers[context.tagName];
|
|
|
|
|
var grabbers = config.contextGrabbers[context.tagName];
|
|
|
|
|
if (grabbers && grabbers.hasOwnProperty(tagAfter[2]))
|
|
|
|
|
context = context.prev;
|
|
|
|
|
else
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
while (context && !context.startOfLine)
|
|
|
|
|
while (context && context.prev && !context.startOfLine)
|
|
|
|
|
context = context.prev;
|
|
|
|
|
if (context) return context.indent + indentUnit;
|
|
|
|
|
else return 0;
|
|
|
|
|
else return state.baseIndent || 0;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
electricInput: /<\/[\s\w:]+>$/,
|
|
|
|
|
blockCommentStart: "<!--",
|
|
|
|
|
blockCommentEnd: "-->",
|
|
|
|
|
|
|
|
|
|
configuration: parserConfig.htmlMode ? "html" : "xml",
|
|
|
|
|
helperType: parserConfig.htmlMode ? "html" : "xml"
|
|
|
|
|
configuration: config.htmlMode ? "html" : "xml",
|
|
|
|
|
helperType: config.htmlMode ? "html" : "xml",
|
|
|
|
|
|
|
|
|
|
skipAttribute: function(state) {
|
|
|
|
|
if (state.state == attrValueState)
|
|
|
|
|
state.state = attrState
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -11467,7 +11550,7 @@ if (!CodeMirror.mimeModes.hasOwnProperty("text/html"))
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
},{"../../lib/codemirror":6}],11:[function(require,module,exports){
|
|
|
|
|
},{"../../lib/codemirror":7}],12:[function(require,module,exports){
|
|
|
|
|
(function (global){
|
|
|
|
|
/**
|
|
|
|
|
* marked - a markdown parser
|
|
|
|
@ -12756,7 +12839,7 @@ if (typeof module !== 'undefined' && typeof exports === 'object') {
|
|
|
|
|
}());
|
|
|
|
|
|
|
|
|
|
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
|
|
|
},{}],12:[function(require,module,exports){
|
|
|
|
|
},{}],13:[function(require,module,exports){
|
|
|
|
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
|
|
|
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
|
|
|
|
|
|
|
|
@ -12802,7 +12885,7 @@ CodeMirror.commands.shiftTabAndUnindentMarkdownList = function (cm) {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
},{"codemirror":6}],13:[function(require,module,exports){
|
|
|
|
|
},{"codemirror":7}],14:[function(require,module,exports){
|
|
|
|
|
/*global require,module*/
|
|
|
|
|
"use strict";
|
|
|
|
|
var CodeMirror = require("codemirror");
|
|
|
|
@ -12811,6 +12894,7 @@ require("./codemirror/tablist");
|
|
|
|
|
require("codemirror/addon/display/fullscreen.js");
|
|
|
|
|
require("codemirror/mode/markdown/markdown.js");
|
|
|
|
|
require("codemirror/addon/mode/overlay.js");
|
|
|
|
|
require("codemirror/addon/display/placeholder.js");
|
|
|
|
|
require("codemirror/mode/gfm/gfm.js");
|
|
|
|
|
require("codemirror/mode/xml/xml.js");
|
|
|
|
|
require("spell-checker");
|
|
|
|
@ -13138,7 +13222,7 @@ function toggleSideBySide(editor) {
|
|
|
|
|
var wrapper = cm.getWrapperElement();
|
|
|
|
|
var preview = wrapper.nextSibling;
|
|
|
|
|
var toolbarButton = editor.toolbarElements["side-by-side"];
|
|
|
|
|
|
|
|
|
|
var useSideBySideListener = false;
|
|
|
|
|
if(/editor-preview-active-side/.test(preview.className)) {
|
|
|
|
|
preview.className = preview.className.replace(
|
|
|
|
|
/\s*editor-preview-active-side\s*/g, ""
|
|
|
|
@ -13156,6 +13240,7 @@ function toggleSideBySide(editor) {
|
|
|
|
|
}, 1);
|
|
|
|
|
toolbarButton.className += " active";
|
|
|
|
|
wrapper.className += " CodeMirror-sided";
|
|
|
|
|
useSideBySideListener = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Hide normal preview if active
|
|
|
|
@ -13170,13 +13255,20 @@ function toggleSideBySide(editor) {
|
|
|
|
|
toolbar_div.className = toolbar_div.className.replace(/\s*disabled-for-preview*/g, "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Start preview with the current text
|
|
|
|
|
preview.innerHTML = editor.options.previewRender(editor.value(), preview);
|
|
|
|
|
var sideBySideRenderingFunction = function() {
|
|
|
|
|
preview.innerHTML = editor.options.previewRender(editor.value(), preview);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if(!cm.sideBySideRenderingFunction) {
|
|
|
|
|
cm.sideBySideRenderingFunction = sideBySideRenderingFunction;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Updates preview
|
|
|
|
|
cm.on("update", function() {
|
|
|
|
|
if(useSideBySideListener) {
|
|
|
|
|
preview.innerHTML = editor.options.previewRender(editor.value(), preview);
|
|
|
|
|
});
|
|
|
|
|
cm.on("update", cm.sideBySideRenderingFunction);
|
|
|
|
|
} else {
|
|
|
|
|
cm.off("update", cm.sideBySideRenderingFunction);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -13618,6 +13710,23 @@ var toolbarBuiltInButtons = {
|
|
|
|
|
className: "fa fa-question-circle",
|
|
|
|
|
title: "Markdown Guide",
|
|
|
|
|
default: true
|
|
|
|
|
},
|
|
|
|
|
"separator-4": {
|
|
|
|
|
name: "separator-4"
|
|
|
|
|
},
|
|
|
|
|
"undo": {
|
|
|
|
|
name: "undo",
|
|
|
|
|
action: undo,
|
|
|
|
|
className: "fa fa-undo no-disable",
|
|
|
|
|
title: "Undo",
|
|
|
|
|
default: true
|
|
|
|
|
},
|
|
|
|
|
"redo": {
|
|
|
|
|
name: "redo",
|
|
|
|
|
action: redo,
|
|
|
|
|
className: "fa fa-repeat no-disable",
|
|
|
|
|
title: "Redo",
|
|
|
|
|
default: true
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -13852,7 +13961,8 @@ SimpleMDE.prototype.render = function(el) {
|
|
|
|
|
autofocus: (options.autofocus === true) ? true : false,
|
|
|
|
|
extraKeys: keyMaps,
|
|
|
|
|
lineWrapping: (options.lineWrapping === false) ? false : true,
|
|
|
|
|
allowDropFileTypes: ["text/plain"]
|
|
|
|
|
allowDropFileTypes: ["text/plain"],
|
|
|
|
|
placeholder: options.placeholder || el.getAttribute("placeholder") || ""
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if(options.toolbar !== false) {
|
|
|
|
@ -14235,5 +14345,5 @@ SimpleMDE.prototype.isFullscreenActive = function() {
|
|
|
|
|
|
|
|
|
|
module.exports = SimpleMDE;
|
|
|
|
|
|
|
|
|
|
},{"./codemirror/tablist":12,"codemirror":6,"codemirror/addon/display/fullscreen.js":3,"codemirror/addon/edit/continuelist.js":4,"codemirror/addon/mode/overlay.js":5,"codemirror/mode/gfm/gfm.js":7,"codemirror/mode/markdown/markdown.js":8,"codemirror/mode/xml/xml.js":10,"marked":11,"spell-checker":1}]},{},[13])(13)
|
|
|
|
|
},{"./codemirror/tablist":13,"codemirror":7,"codemirror/addon/display/fullscreen.js":3,"codemirror/addon/display/placeholder.js":4,"codemirror/addon/edit/continuelist.js":5,"codemirror/addon/mode/overlay.js":6,"codemirror/mode/gfm/gfm.js":8,"codemirror/mode/markdown/markdown.js":9,"codemirror/mode/xml/xml.js":11,"marked":12,"spell-checker":1}]},{},[14])(14)
|
|
|
|
|
});
|