TagSpaces is an offline, open source, document manager with tagging support
updating to a newer codemirror version
Ilian541472255c89
diff --git a/data/ext/editorText/codemirror/codemirror.css b/data/ext/editorText/codemirror/codemirror.cssindex 52881f7df..2b050e19f 100644--- a/data/ext/editorText/codemirror/codemirror.css+++ b/data/ext/editorText/codemirror/codemirror.css@@ -36,6 +36,8 @@min-width: 20px;text-align: right;color: #999;+ -moz-box-sizing: content-box;+ box-sizing: content-box;}/* CURSOR */@@ -59,6 +61,11 @@.cm-tab { display: inline-block; }+.CodeMirror-ruler {+ border-left: 1px solid #ccc;+ position: absolute;+}+/* DEFAULT THEME */.cm-s-default .cm-keyword {color: #708;}@@ -74,7 +81,6 @@.cm-s-default .cm-string {color: #a11;}.cm-s-default .cm-string-2 {color: #f50;}.cm-s-default .cm-meta {color: #555;}-.cm-s-default .cm-error {color: #f00;}.cm-s-default .cm-qualifier {color: #555;}.cm-s-default .cm-builtin {color: #30a;}.cm-s-default .cm-bracket {color: #997;}@@ -91,10 +97,12 @@.cm-em {font-style: italic;}.cm-link {text-decoration: underline;}+.cm-s-default .cm-error {color: #f00;}.cm-invalidchar {color: #f00;}div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}+.CodeMirror-activeline-background {background: #e8f2ff;}/* STOP */@@ -113,13 +121,18 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}/* 30px is the magic margin used to hide the element's real scrollbars *//* See overflow: hidden in .CodeMirror */margin-bottom: -30px; margin-right: -30px;- padding-bottom: 30px; padding-right: 30px;+ padding-bottom: 30px;height: 100%;outline: none; /* Prevent dragging from highlighting the element */position: relative;+ -moz-box-sizing: content-box;+ box-sizing: content-box;}.CodeMirror-sizer {position: relative;+ border-right: 30px solid transparent;+ -moz-box-sizing: content-box;+ box-sizing: content-box;}/* The fake, visible scrollbars. Used to force redraw during scrolling@@ -155,6 +168,8 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}.CodeMirror-gutter {white-space: normal;height: 100%;+ -moz-box-sizing: content-box;+ box-sizing: content-box;padding-bottom: 30px;margin-bottom: -32px;display: inline-block;@@ -192,6 +207,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}white-space: pre-wrap;word-break: normal;}+.CodeMirror-linebackground {position: absolute;left: 0; right: 0; top: 0; bottom: 0;@@ -204,8 +220,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}overflow: auto;}-.CodeMirror-widget {-}+.CodeMirror-widget {}.CodeMirror-wrap .CodeMirror-scroll {overflow-x: hidden;@@ -213,7 +228,8 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}.CodeMirror-measure {position: absolute;- width: 100%; height: 0px;+ width: 100%;+ height: 0;overflow: hidden;visibility: hidden;}diff --git a/data/ext/editorText/codemirror/codemirror.js b/data/ext/editorText/codemirror/codemirror.jsindex ac0f32415..3b17937d5 100644--- a/data/ext/editorText/codemirror/codemirror.js+++ b/data/ext/editorText/codemirror/codemirror.js@@ -1,4 +1,4 @@-// CodeMirror version 3.14+// CodeMirror version 3.22//// CodeMirror is the only global var we claimwindow.CodeMirror = (function() {@@ -9,9 +9,15 @@ window.CodeMirror = (function() {// Crude, but necessary to handle a number of hard-to-feature-detect// bugs and behavior differences.var gecko = /gecko\/\d/i.test(navigator.userAgent);- var ie = /MSIE \d/.test(navigator.userAgent);- var ie_lt8 = ie && (document.documentMode == null || document.documentMode < 8);- var ie_lt9 = ie && (document.documentMode == null || document.documentMode < 9);+ // IE11 currently doesn't count as 'ie', since it has almost none of+ // the same bugs as earlier versions. Use ie_gt10 to handle+ // incompatibilities in that version.+ var old_ie = /MSIE \d/.test(navigator.userAgent);+ var ie_lt8 = old_ie && (document.documentMode == null || document.documentMode < 8);+ var ie_lt9 = old_ie && (document.documentMode == null || document.documentMode < 9);+ var ie_lt10 = old_ie && (document.documentMode == null || document.documentMode < 10);+ var ie_gt10 = /Trident\/([7-9]|\d{2,})\./.test(navigator.userAgent);+ var ie = old_ie || ie_gt10;var webkit = /WebKit\//.test(navigator.userAgent);var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(navigator.userAgent);var chrome = /Chrome\//.test(navigator.userAgent);@@ -26,10 +32,11 @@ window.CodeMirror = (function() {// This is woefully incomplete. Suggestions for alternative methods welcome.var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent);var mac = ios || /Mac/.test(navigator.platform);- var windows = /windows/i.test(navigator.platform);+ var windows = /win/i.test(navigator.platform);var opera_version = opera && navigator.userAgent.match(/Version\/(\d*\.\d*)/);if (opera_version) opera_version = Number(opera_version[1]);+ if (opera_version && opera_version >= 15) { opera = false; webkit = true; }// Some browsers use the wrong event properties to signal cmd/ctrl on OS Xvar flipCtrlCmd = mac && (qtwebkit || opera && (opera_version == null || opera_version < 12.11));var captureMiddleClick = gecko || (ie && !ie_lt9);@@ -58,7 +65,8 @@ window.CodeMirror = (function() {overlays: [],modeGen: 0,overwrite: false, focused: false,- suppressEdits: false, pasteIncoming: false,+ suppressEdits: false,+ pasteIncoming: false, cutIncoming: false,draggingText: false,highlight: new Delayed()};@@ -72,7 +80,7 @@ window.CodeMirror = (function() {// Override magic textarea content restore that IE sometimes does// on our hidden textarea on reload- if (ie) setTimeout(bind(resetInput, this, true), 20);+ if (old_ie) setTimeout(bind(resetInput, this, true), 20);registerEventHandlers(this);// IE throws unspecified error in certain cases, when@@ -94,7 +102,7 @@ window.CodeMirror = (function() {function makeDisplay(place, docStart) {var d = {};- var input = d.input = elt("textarea", null, null, "position: absolute; padding: 0; width: 1px; height: 1em; outline: none; font-size: 4px;");+ var input = d.input = elt("textarea", null, null, "position: absolute; padding: 0; width: 1px; height: 1em; outline: none");if (webkit) input.style.width = "1000px";else input.setAttribute("wrap", "off");// if border: 0; -- iOS fails to open keyboard (issue #1287)@@ -166,7 +174,7 @@ window.CodeMirror = (function() {// Self-resetting timeout for the pollerd.poll = new Delayed();- d.cachedCharWidth = d.cachedTextHeight = null;+ d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;d.measureLineCache = [];d.measureLineCachePos = 0;@@ -192,6 +200,10 @@ window.CodeMirror = (function() {function loadMode(cm) {cm.doc.mode = CodeMirror.getMode(cm.options, cm.doc.modeOption);+ resetModeState(cm);+ }++ function resetModeState(cm) {cm.doc.iter(function(line) {if (line.stateAfter) line.stateAfter = null;if (line.styles) line.styles = null;@@ -241,7 +253,6 @@ window.CodeMirror = (function() {var map = keyMap[cm.options.keyMap], style = map.style;cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-keymap-\S+/g, "") +(style ? " cm-keymap-" + style : "");- cm.state.disableInput = map.disableInput;}function themeChanged(cm) {@@ -305,15 +316,13 @@ window.CodeMirror = (function() {// Make sure the gutters options contains the element// "CodeMirror-linenumbers" when the lineNumbers option is true.function setGuttersForLineNumbers(options) {- var found = false;- for (var i = 0; i < options.gutters.length; ++i) {- if (options.gutters[i] == "CodeMirror-linenumbers") {- if (options.lineNumbers) found = true;- else options.gutters.splice(i--, 1);- }+ var found = indexOf(options.gutters, "CodeMirror-linenumbers");+ if (found == -1 && options.lineNumbers) {+ options.gutters = options.gutters.concat(["CodeMirror-linenumbers"]);+ } else if (found > -1 && !options.lineNumbers) {+ options.gutters = options.gutters.slice(0);+ options.gutters.splice(found, 1);}- if (!found && options.lineNumbers)- options.gutters.push("CodeMirror-linenumbers");}// SCROLLBARS@@ -331,15 +340,22 @@ window.CodeMirror = (function() {if (needsV) {d.scrollbarV.style.display = "block";d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + "px" : "0";+ // A bug in IE8 can cause this value to be negative, so guard it.d.scrollbarV.firstChild.style.height =- (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + "px";- } else d.scrollbarV.style.display = "";+ Math.max(0, scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + "px";+ } else {+ d.scrollbarV.style.display = "";+ d.scrollbarV.firstChild.style.height = "0";+ }if (needsH) {d.scrollbarH.style.display = "block";d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + "px" : "0";d.scrollbarH.firstChild.style.width =(d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + "px";- } else d.scrollbarH.style.display = "";+ } else {+ d.scrollbarH.style.display = "";+ d.scrollbarH.firstChild.style.width = "0";+ }if (needsH && needsV) {d.scrollbarFiller.style.display = "block";d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + "px";@@ -350,8 +366,10 @@ window.CodeMirror = (function() {d.gutterFiller.style.width = d.gutters.offsetWidth + "px";} else d.gutterFiller.style.display = "";- if (mac_geLion && scrollbarWidth(d.measure) === 0)+ if (mac_geLion && scrollbarWidth(d.measure) === 0) {d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? "18px" : "12px";+ d.scrollbarV.style.pointerEvents = d.scrollbarH.style.pointerEvents = "none";+ }}function visibleLines(display, doc, viewPort) {@@ -403,14 +421,21 @@ window.CodeMirror = (function() {// DISPLAY DRAWING- function updateDisplay(cm, changes, viewPort) {+ function updateDisplay(cm, changes, viewPort, forced) {var oldFrom = cm.display.showingFrom, oldTo = cm.display.showingTo, updated;var visible = visibleLines(cm.display, cm.doc, viewPort);- for (;;) {- if (!updateDisplayInner(cm, changes, visible)) break;+ for (var first = true;; first = false) {+ var oldWidth = cm.display.scroller.clientWidth;+ if (!updateDisplayInner(cm, changes, visible, forced)) break;updated = true;+ changes = [];updateSelection(cm);updateScrollbars(cm);+ if (first && cm.options.lineWrapping && oldWidth != cm.display.scroller.clientWidth) {+ forced = true;+ continue;+ }+ forced = false;// Clip forced viewport to actual scrollable areaif (viewPort)@@ -419,7 +444,6 @@ window.CodeMirror = (function() {visible = visibleLines(cm.display, cm.doc, viewPort);if (visible.from >= cm.display.showingFrom && visible.to <= cm.display.showingTo)break;- changes = [];}if (updated) {@@ -433,16 +457,16 @@ window.CodeMirror = (function() {// Uses a set of changes plus the current scroll position to// determine which DOM updates have to be made, and makes the// updates.- function updateDisplayInner(cm, changes, visible) {+ function updateDisplayInner(cm, changes, visible, forced) {var display = cm.display, doc = cm.doc;- if (!display.wrapper.clientWidth) {+ if (!display.wrapper.offsetWidth) {display.showingFrom = display.showingTo = doc.first;display.viewOffset = 0;return;}// Bail out if the visible area is already rendered and nothing changed.- if (changes.length == 0 &&+ if (!forced && changes.length == 0 &&visible.from > display.showingFrom && visible.to < display.showingTo)return;@@ -455,7 +479,7 @@ window.CodeMirror = (function() {var positionsChangedFrom = Infinity;if (cm.options.lineNumbers)for (var i = 0; i < changes.length; ++i)- if (changes[i].diff) { positionsChangedFrom = changes[i].from; break; }+ if (changes[i].diff && changes[i].from < positionsChangedFrom) { positionsChangedFrom = changes[i].from; }var end = doc.first + doc.size;var from = Math.max(visible.from - cm.options.viewportMargin, doc.first);@@ -495,7 +519,7 @@ window.CodeMirror = (function() {if (range.from >= range.to) intact.splice(i--, 1);else intactLines += range.to - range.from;}- if (intactLines == to - from && from == display.showingFrom && to == display.showingTo) {+ if (!forced && intactLines == to - from && from == display.showingFrom && to == display.showingTo) {updateViewOffset(cm);return;}@@ -520,6 +544,15 @@ window.CodeMirror = (function() {}display.showingFrom = from; display.showingTo = to;+ display.gutters.style.height = "";+ updateHeightsInViewport(cm);+ updateViewOffset(cm);++ return true;+ }++ function updateHeightsInViewport(cm) {+ var display = cm.display;var prevBottom = display.lineDiv.offsetTop;for (var node = display.lineDiv.firstChild, height; node; node = node.nextSibling) if (node.lineObj) {if (ie_lt8) {@@ -539,9 +572,6 @@ window.CodeMirror = (function() {widgets[i].height = widgets[i].node.offsetHeight;}}- updateViewOffset(cm);-- return true;}function updateViewOffset(cm) {@@ -607,7 +637,7 @@ window.CodeMirror = (function() {if (nextIntact && nextIntact.to == lineN) nextIntact = intact.shift();if (lineIsHidden(cm.doc, line)) {if (line.height != 0) updateLineHeight(line, 0);- if (line.widgets && cur.previousSibling) for (var i = 0; i < line.widgets.length; ++i) {+ if (line.widgets && cur && cur.previousSibling) for (var i = 0; i < line.widgets.length; ++i) {var w = line.widgets[i];if (w.showIfHidden) {var prev = cur.previousSibling;@@ -652,10 +682,11 @@ window.CodeMirror = (function() {}function buildLineElement(cm, line, lineNo, dims, reuse) {- var lineElement = lineContent(cm, line);+ var built = buildLineContent(cm, line), lineElement = built.pre;var markers = line.gutterMarkers, display = cm.display, wrap;- if (!cm.options.lineNumbers && !markers && !line.bgClass && !line.wrapClass && !line.widgets)+ var bgClass = built.bgClass ? built.bgClass + " " + (line.bgClass || "") : line.bgClass;+ if (!cm.options.lineNumbers && !markers && !bgClass && !line.wrapClass && !line.widgets)return lineElement;// Lines with gutter elements, widgets or a background class need@@ -670,10 +701,10 @@ window.CodeMirror = (function() {if (!/\bCodeMirror-linewidget\b/.test(n.className)) {reuse.removeChild(n);} else {- for (var i = 0, first = true; i < line.widgets.length; ++i) {+ for (var i = 0; i < line.widgets.length; ++i) {var widget = line.widgets[i];- if (!widget.above) { insertBefore = n; first = false; }if (widget.node == n.firstChild) {+ if (!widget.above && !insertBefore) insertBefore = n;positionLineWidget(widget, n, reuse, dims);++widgetsSeen;break;@@ -693,12 +724,12 @@ window.CodeMirror = (function() {wrap.appendChild(lineElement);}// Kludge to make sure the styled element lies behind the selection (by z-index)- if (line.bgClass)- wrap.insertBefore(elt("div", null, line.bgClass + " CodeMirror-linebackground"), wrap.firstChild);+ if (bgClass)+ wrap.insertBefore(elt("div", null, bgClass + " CodeMirror-linebackground"), wrap.firstChild);if (cm.options.lineNumbers || markers) {- var gutterWrap = wrap.insertBefore(elt("div", null, null, "position: absolute; left: " ++ var gutterWrap = wrap.insertBefore(elt("div", null, "CodeMirror-gutter-wrapper", "position: absolute; left: " +(cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px"),- wrap.firstChild);+ lineElement);if (cm.options.fixedGutter) (wrap.alignable || (wrap.alignable = [])).push(gutterWrap);if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"]))wrap.lineNumber = gutterWrap.appendChild(@@ -791,12 +822,12 @@ window.CodeMirror = (function() {function updateSelectionRange(cm) {var display = cm.display, doc = cm.doc, sel = cm.doc.sel;var fragment = document.createDocumentFragment();- var clientWidth = display.lineSpace.offsetWidth, pl = paddingLeft(cm.display);+ var padding = paddingH(cm.display), leftSide = padding.left, rightSide = display.lineSpace.offsetWidth - padding.right;function add(left, top, width, bottom) {if (top < 0) top = 0;fragment.appendChild(elt("div", null, "CodeMirror-selected", "position: absolute; left: " + left +- "px; top: " + top + "px; width: " + (width == null ? clientWidth - left : width) ++ "px; top: " + top + "px; width: " + (width == null ? rightSide - left : width) +"px; height: " + (bottom - top) + "px"));}@@ -819,18 +850,18 @@ window.CodeMirror = (function() {left = leftPos.left;right = rightPos.right;}- if (fromArg == null && from == 0) left = pl;+ if (fromArg == null && from == 0) left = leftSide;if (rightPos.top - leftPos.top > 3) { // Different lines, draw top partadd(left, leftPos.top, null, leftPos.bottom);- left = pl;+ left = leftSide;if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);}- if (toArg == null && to == lineLen) right = clientWidth;+ if (toArg == null && to == lineLen) right = rightSide;if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)start = leftPos;if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)end = rightPos;- if (left < pl + 1) left = pl;+ if (left < leftSide + 1) left = leftSide;add(left, rightPos.top, right - left, rightPos.bottom);});return {start: start, end: end};@@ -846,13 +877,13 @@ window.CodeMirror = (function() {if (singleVLine) {if (leftEnd.top < rightStart.top - 2) {add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);- add(pl, rightStart.top, rightStart.left, rightStart.bottom);+ add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);} else {add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);}}if (leftEnd.bottom < rightStart.top)- add(pl, leftEnd.bottom, null, rightStart.top);+ add(leftSide, leftEnd.bottom, null, rightStart.top);}removeChildrenAndAdd(display.selectionDiv, fragment);@@ -866,9 +897,10 @@ window.CodeMirror = (function() {clearInterval(display.blinker);var on = true;display.cursor.style.visibility = display.otherCursor.style.visibility = "";- display.blinker = setInterval(function() {- display.cursor.style.visibility = display.otherCursor.style.visibility = (on = !on) ? "" : "hidden";- }, cm.options.cursorBlinkRate);+ if (cm.options.cursorBlinkRate > 0)+ display.blinker = setInterval(function() {+ display.cursor.style.visibility = display.otherCursor.style.visibility = (on = !on) ? "" : "hidden";+ }, cm.options.cursorBlinkRate);}// HIGHLIGHT WORKER@@ -888,7 +920,7 @@ window.CodeMirror = (function() {doc.iter(doc.frontier, Math.min(doc.first + doc.size, cm.display.showingTo + 500), function(line) {if (doc.frontier >= cm.display.showingFrom) { // Visiblevar oldStyles = line.styles;- line.styles = highlightLine(cm, line, state);+ line.styles = highlightLine(cm, line, state, true);var ischange = !oldStyles || oldStyles.length != line.styles.length;for (var i = 0; !ischange && i < oldStyles.length; ++i) ischange = oldStyles[i] != line.styles[i];if (ischange) {@@ -897,7 +929,7 @@ window.CodeMirror = (function() {}line.stateAfter = copyState(doc.mode, state);} else {- processLine(cm, line, state);+ processLine(cm, line.text, state);line.stateAfter = doc.frontier % 5 == 0 ? copyState(doc.mode, state) : null;}++doc.frontier;@@ -920,7 +952,8 @@ window.CodeMirror = (function() {// parse correctly.function findStartLine(cm, n, precise) {var minindent, minline, doc = cm.doc;- for (var search = n, lim = n - 100; search > lim; --search) {+ var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);+ for (var search = n; search > lim; --search) {if (search <= doc.first) return doc.first;var line = getLine(doc, search - 1);if (line.stateAfter && (!precise || search <= doc.frontier)) return search;@@ -935,16 +968,17 @@ window.CodeMirror = (function() {function getStateBefore(cm, n, precise) {var doc = cm.doc, display = cm.display;- if (!doc.mode.startState) return true;+ if (!doc.mode.startState) return true;var pos = findStartLine(cm, n, precise), state = pos > doc.first && getLine(doc, pos-1).stateAfter;if (!state) state = startState(doc.mode);else state = copyState(doc.mode, state);doc.iter(pos, n, function(line) {- processLine(cm, line, state);+ processLine(cm, line.text, state);var save = pos == n - 1 || pos % 5 == 0 || pos >= display.showingFrom && pos < display.showingTo;line.stateAfter = save ? copyState(doc.mode, state) : null;++pos;});+ if (precise) doc.frontier = pos;return state;}@@ -952,25 +986,34 @@ window.CodeMirror = (function() {function paddingTop(display) {return display.lineSpace.offsetTop;}function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight;}- function paddingLeft(display) {- var e = removeChildrenAndAdd(display.measure, elt("pre", null, null, "text-align: left")).appendChild(elt("span", "x"));- return e.offsetLeft;+ function paddingH(display) {+ if (display.cachedPaddingH) return display.cachedPaddingH;+ var e = removeChildrenAndAdd(display.measure, elt("pre", "x"));+ var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;+ return display.cachedPaddingH = {left: parseInt(style.paddingLeft),+ right: parseInt(style.paddingRight)};}function measureChar(cm, line, ch, data, bias) {var dir = -1;data = data || measureLine(cm, line);+ if (data.crude) {+ var left = data.left + ch * data.width;+ return {left: left, right: left + data.width, top: data.top, bottom: data.bottom};+ }for (var pos = ch;; pos += dir) {var r = data[pos];if (r) break;if (dir < 0 && pos == 0) dir = 1;}- var rightV = (pos < ch || bias == "right") && r.topRight != null;+ bias = pos > ch ? "left" : pos < ch ? "right" : bias;+ if (bias == "left" && r.leftSide) r = r.leftSide;+ else if (bias == "right" && r.rightSide) r = r.rightSide;return {left: pos < ch ? r.right : r.left,right: pos > ch ? r.left : r.right,- top: rightV ? r.topRight : r.top,- bottom: rightV ? r.bottomRight : r.bottom};+ top: r.top,+ bottom: r.bottom};}function findCachedMeasurement(cm, line) {@@ -979,7 +1022,7 @@ window.CodeMirror = (function() {var memo = cache[i];if (memo.text == line.text && memo.markedSpans == line.markedSpans &&cm.display.scroller.clientWidth == memo.width &&- memo.classes == line.textClass + "|" + line.bgClass + "|" + line.wrapClass)+ memo.classes == line.textClass + "|" + line.wrapClass)return memo;}}@@ -999,15 +1042,18 @@ window.CodeMirror = (function() {var cache = cm.display.measureLineCache;var memo = {text: line.text, width: cm.display.scroller.clientWidth,markedSpans: line.markedSpans, measure: measure,- classes: line.textClass + "|" + line.bgClass + "|" + line.wrapClass};+ classes: line.textClass + "|" + line.wrapClass};if (cache.length == 16) cache[++cm.display.measureLineCachePos % 16] = memo;else cache.push(memo);return measure;}function measureLineInner(cm, line) {+ if (!cm.options.lineWrapping && line.text.length >= cm.options.crudeMeasuringFrom)+ return crudelyMeasureLine(cm, line);+var display = cm.display, measure = emptyArray(line.text.length);- var pre = lineContent(cm, line, measure);+ var pre = buildLineContent(cm, line, measure, true).pre;// IE does not cache element positions of inline elements between// calls to getBoundingClientRect. This makes the loop below,@@ -1020,7 +1066,7 @@ window.CodeMirror = (function() {// doesn't work when wrapping is on, but in that case the// situation is slightly better, since IE does cache line-wrapping// information and only recomputes per-line.- if (ie && !ie_lt8 && !cm.options.lineWrapping && pre.childNodes.length > 100) {+ if (old_ie && !ie_lt8 && !cm.options.lineWrapping && pre.childNodes.length > 100) {var fragment = document.createDocumentFragment();var chunk = 10, n = pre.childNodes.length;for (var i = 0, chunks = Math.ceil(n / chunk); i < chunks; ++i) {@@ -1043,52 +1089,64 @@ window.CodeMirror = (function() {if (ie_lt9 && display.measure.first != pre)removeChildrenAndAdd(display.measure, pre);- function categorizeVSpan(top, bot) {+ function measureRect(rect) {+ var top = rect.top - outer.top, bot = rect.bottom - outer.top;if (bot > maxBot) bot = maxBot;if (top < 0) top = 0;- for (var j = 0; j < vranges.length; j += 2) {- var rtop = vranges[j], rbot = vranges[j+1];+ for (var i = vranges.length - 2; i >= 0; i -= 2) {+ var rtop = vranges[i], rbot = vranges[i+1];if (rtop > bot || rbot < top) continue;if (rtop <= top && rbot >= bot ||top <= rtop && bot >= rbot ||Math.min(bot, rbot) - Math.max(top, rtop) >= (bot - top) >> 1) {- vranges[j] = Math.min(top, rtop);- vranges[j+1] = Math.max(bot, rbot);- return j;+ vranges[i] = Math.min(top, rtop);+ vranges[i+1] = Math.max(bot, rbot);+ break;}}- vranges.push(top, bot);- return j;+ if (i < 0) { i = vranges.length; vranges.push(top, bot); }+ return {left: rect.left - outer.left,+ right: rect.right - outer.left,+ top: i, bottom: null};+ }+ function finishRect(rect) {+ rect.bottom = vranges[rect.top+1];+ rect.top = vranges[rect.top];}for (var i = 0, cur; i < measure.length; ++i) if (cur = measure[i]) {- var size, node = cur;+ var node = cur, rect = null;// A widget might wrap, needs special careif (/\bCodeMirror-widget\b/.test(cur.className) && cur.getClientRects) {if (cur.firstChild.nodeType == 1) node = cur.firstChild;- var rects = node.getClientRects(), rLeft = rects[0], rRight = rects[rects.length - 1];+ var rects = node.getClientRects();if (rects.length > 1) {- var vCatLeft = categorizeVSpan(rLeft.top - outer.top, rLeft.bottom - outer.top);- var vCatRight = categorizeVSpan(rRight.top - outer.top, rRight.bottom - outer.top);- data[i] = {left: rLeft.left - outer.left, right: rRight.right - outer.left,- top: vCatLeft, topRight: vCatRight};- continue;+ rect = data[i] = measureRect(rects[0]);+ rect.rightSide = measureRect(rects[rects.length - 1]);}}- size = getRect(node);- var vCat = categorizeVSpan(size.top - outer.top, size.bottom - outer.top);- var right = size.right;- if (cur.measureRight) right = getRect(cur.measureRight).left;- data[i] = {left: size.left - outer.left, right: right - outer.left, top: vCat};+ if (!rect) rect = data[i] = measureRect(getRect(node));+ if (cur.measureRight) rect.right = getRect(cur.measureRight).left - outer.left;+ if (cur.leftSide) rect.leftSide = measureRect(getRect(cur.leftSide));}+ removeChildren(cm.display.measure);for (var i = 0, cur; i < data.length; ++i) if (cur = data[i]) {- var vr = cur.top, vrRight = cur.topRight;- cur.top = vranges[vr]; cur.bottom = vranges[vr+1];- if (vrRight != null) { cur.topRight = vranges[vrRight]; cur.bottomRight = vranges[vrRight+1]; }+ finishRect(cur);+ if (cur.leftSide) finishRect(cur.leftSide);+ if (cur.rightSide) finishRect(cur.rightSide);}return data;}+ function crudelyMeasureLine(cm, line) {+ var copy = new Line(line.text.slice(0, 100), null);+ if (line.textClass) copy.textClass = line.textClass;+ var measure = measureLineInner(cm, copy);+ var left = measureChar(cm, copy, 0, measure, "left");+ var right = measureChar(cm, copy, 99, measure, "right");+ return {crude: true, top: left.top, left: left.left, bottom: left.bottom, width: (right.right - left.left) / 100};+ }+function measureLineWidth(cm, line) {var hasBadSpan = false;if (line.markedSpans) for (var i = 0; i < line.markedSpans; ++i) {@@ -1096,9 +1154,10 @@ window.CodeMirror = (function() {if (sp.collapsed && (sp.to == null || sp.to == line.text.length)) hasBadSpan = true;}var cached = !hasBadSpan && findCachedMeasurement(cm, line);- if (cached) return measureChar(cm, line, line.text.length, cached.measure, "right").right;+ if (cached || line.text.length >= cm.options.crudeMeasuringFrom)+ return measureChar(cm, line, line.text.length, cached && cached.measure, "right").right;- var pre = lineContent(cm, line);+ var pre = buildLineContent(cm, line, null, true).pre;var end = pre.appendChild(zeroWidthElement(cm.display.measure));removeChildrenAndAdd(cm.display.measure, pre);return getRect(end).right - getRect(cm.display.lineDiv).left;@@ -1106,7 +1165,7 @@ window.CodeMirror = (function() {function clearCaches(cm) {cm.display.measureLineCache.length = cm.display.measureLineCachePos = 0;- cm.display.cachedCharWidth = cm.display.cachedTextHeight = null;+ cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;if (!cm.options.lineWrapping) cm.display.maxLineChanged = true;cm.display.lineNumChars = null;}@@ -1243,7 +1302,7 @@ window.CodeMirror = (function() {if (bidi ? to == from || to == moveVisually(lineObj, from, 1) : to - from <= 1) {var ch = x < fromX || x - fromX <= toX - x ? from : to;var xDiff = x - (ch == from ? fromX : toX);- while (isExtendingChar.test(lineObj.text.charAt(ch))) ++ch;+ while (isExtendingChar(lineObj.text.charAt(ch))) ++ch;var pos = PosWithInfo(lineNo, ch, ch == from ? fromOutside : toOutside,xDiff < 0 ? -1 : xDiff ? 1 : 0);return pos;@@ -1302,6 +1361,7 @@ window.CodeMirror = (function() {// An array of ranges of lines that have to be updated. See// updateDisplay.changes: [],+ forceUpdate: false,updateInput: null,userSelChange: null,textChanged: null,@@ -1321,7 +1381,7 @@ window.CodeMirror = (function() {if (op.updateMaxLine) computeMaxLength(cm);if (display.maxLineChanged && !cm.options.lineWrapping && display.maxLine) {var width = measureLineWidth(cm, display.maxLine);- display.sizer.style.minWidth = Math.max(0, width + 3 + scrollerCutOff) + "px";+ display.sizer.style.minWidth = Math.max(0, width + 3) + "px";display.maxLineChanged = false;var maxScrollLeft = Math.max(0, display.sizer.offsetLeft + display.sizer.offsetWidth - display.scroller.clientWidth);if (maxScrollLeft < doc.scrollLeft && !op.updateScrollPos)@@ -1334,17 +1394,20 @@ window.CodeMirror = (function() {var coords = cursorCoords(cm, doc.sel.head);newScrollPos = calculateScrollPos(cm, coords.left, coords.top, coords.left, coords.bottom);}- if (op.changes.length || newScrollPos && newScrollPos.scrollTop != null) {- updated = updateDisplay(cm, op.changes, newScrollPos && newScrollPos.scrollTop);+ if (op.changes.length || op.forceUpdate || newScrollPos && newScrollPos.scrollTop != null) {+ updated = updateDisplay(cm, op.changes, newScrollPos && newScrollPos.scrollTop, op.forceUpdate);if (cm.display.scroller.offsetHeight) cm.doc.scrollTop = cm.display.scroller.scrollTop;}if (!updated && op.selectionChanged) updateSelection(cm);if (op.updateScrollPos) {- display.scroller.scrollTop = display.scrollbarV.scrollTop = doc.scrollTop = newScrollPos.scrollTop;- display.scroller.scrollLeft = display.scrollbarH.scrollLeft = doc.scrollLeft = newScrollPos.scrollLeft;+ var top = Math.max(0, Math.min(display.scroller.scrollHeight - display.scroller.clientHeight, newScrollPos.scrollTop));+ var left = Math.max(0, Math.min(display.scroller.scrollWidth - display.scroller.clientWidth, newScrollPos.scrollLeft));+ display.scroller.scrollTop = display.scrollbarV.scrollTop = doc.scrollTop = top;+ display.scroller.scrollLeft = display.scrollbarH.scrollLeft = doc.scrollLeft = left;alignHorizontally(cm);if (op.scrollToPos)- scrollPosIntoView(cm, clipPos(cm.doc, op.scrollToPos), op.scrollToPosMargin);+ scrollPosIntoView(cm, clipPos(cm.doc, op.scrollToPos.from),+ clipPos(cm.doc, op.scrollToPos.to), op.scrollToPos.margin);} else if (newScrollPos) {scrollCursorIntoView(cm);}@@ -1431,7 +1494,11 @@ window.CodeMirror = (function() {// supported or compatible enough yet to rely on.)function readInput(cm) {var input = cm.display.input, prevInput = cm.display.prevInput, doc = cm.doc, sel = doc.sel;- if (!cm.state.focused || hasSelection(input) || isReadOnly(cm) || cm.state.disableInput) return false;+ if (!cm.state.focused || hasSelection(input) || isReadOnly(cm) || cm.options.disableInput) return false;+ if (cm.state.pasteIncoming && cm.state.fakedLastChar) {+ input.value = input.value.substring(0, input.value.length - 1);+ cm.state.fakedLastChar = false;+ }var text = input.value;if (text == prevInput && posEq(sel.from, sel.to)) return false;if (ie && !ie_lt9 && cm.display.inputHasSelection === text) {@@ -1445,22 +1512,32 @@ window.CodeMirror = (function() {var same = 0, l = Math.min(prevInput.length, text.length);while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) ++same;var from = sel.from, to = sel.to;+ var inserted = text.slice(same);if (same < prevInput.length)from = Pos(from.line, from.ch - (prevInput.length - same));else if (cm.state.overwrite && posEq(from, to) && !cm.state.pasteIncoming)- to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + (text.length - same)));+ to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + inserted.length));var updateInput = cm.curOp.updateInput;- var changeEvent = {from: from, to: to, text: splitLines(text.slice(same)),- origin: cm.state.pasteIncoming ? "paste" : "+input"};+ var changeEvent = {from: from, to: to, text: splitLines(inserted),+ origin: cm.state.pasteIncoming ? "paste" : cm.state.cutIncoming ? "cut" : "+input"};makeChange(cm.doc, changeEvent, "end");cm.curOp.updateInput = updateInput;signalLater(cm, "inputRead", cm, changeEvent);+ if (inserted && !cm.state.pasteIncoming && cm.options.electricChars &&+ cm.options.smartIndent && sel.head.ch < 100) {+ var electric = cm.getModeAt(sel.head).electricChars;+ if (electric) for (var i = 0; i < electric.length; i++)+ if (inserted.indexOf(electric.charAt(i)) > -1) {+ indentLine(cm, sel.head.line, "smart");+ break;+ }+ }if (text.length > 1000 || text.indexOf("\n") > -1) input.value = cm.display.prevInput = "";else cm.display.prevInput = text;if (withOp) endOperation(cm);- cm.state.pasteIncoming = false;+ cm.state.pasteIncoming = cm.state.cutIncoming = false;return true;}@@ -1486,6 +1563,10 @@ window.CodeMirror = (function() {cm.display.input.focus();}+ function ensureFocus(cm) {+ if (!cm.state.focused) { focusInput(cm); onFocus(cm); }+ }+function isReadOnly(cm) {return cm.options.readOnly || cm.doc.cantEdit;}@@ -1495,7 +1576,7 @@ window.CodeMirror = (function() {function registerEventHandlers(cm) {var d = cm.display;on(d.scroller, "mousedown", operation(cm, onMouseDown));- if (ie)+ if (old_ie)on(d.scroller, "dblclick", operation(cm, function(e) {if (signalDOMEvent(cm, e)) return;var pos = posFromMouse(cm, e);@@ -1542,7 +1623,7 @@ window.CodeMirror = (function() {if (resizeTimer == null) resizeTimer = setTimeout(function() {resizeTimer = null;// Might be a text scaling operation, clear size caches.- d.cachedCharWidth = d.cachedTextHeight = knownScrollbarWidth = null;+ d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = knownScrollbarWidth = null;clearCaches(cm);runInOp(cm, bind(regChange, cm));}, 100);@@ -1558,11 +1639,11 @@ window.CodeMirror = (function() {}setTimeout(unregister, 5000);- on(d.input, "keyup", operation(cm, function(e) {- if (signalDOMEvent(cm, e) || cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return;- if (e.keyCode == 16) cm.doc.sel.shift = false;- }));- on(d.input, "input", bind(fastPoll, cm));+ on(d.input, "keyup", operation(cm, onKeyUp));+ on(d.input, "input", function() {+ if (ie && !ie_lt9 && cm.display.inputHasSelection) cm.display.inputHasSelection = null;+ fastPoll(cm);+ });on(d.input, "keydown", operation(cm, onKeyDown));on(d.input, "keypress", operation(cm, onKeyPress));on(d.input, "focus", bind(onFocus, cm));@@ -1578,31 +1659,42 @@ window.CodeMirror = (function() {on(d.scroller, "dragover", drag_);on(d.scroller, "drop", operation(cm, onDrop));}- on(d.scroller, "paste", function(e){+ on(d.scroller, "paste", function(e) {if (eventInWidget(d, e)) return;focusInput(cm);fastPoll(cm);});on(d.input, "paste", function() {+ // Workaround for webkit bug https://bugs.webkit.org/show_bug.cgi?id=90206+ // Add a char to the end of textarea before paste occur so that+ // selection doesn't span to the end of textarea.+ if (webkit && !cm.state.fakedLastChar && !(new Date - cm.state.lastMiddleDown < 200)) {+ var start = d.input.selectionStart, end = d.input.selectionEnd;+ d.input.value += "$";+ d.input.selectionStart = start;+ d.input.selectionEnd = end;+ cm.state.fakedLastChar = true;+ }cm.state.pasteIncoming = true;fastPoll(cm);});- function prepareCopy() {+ function prepareCopy(e) {if (d.inaccurateSelection) {d.prevInput = "";d.inaccurateSelection = false;d.input.value = cm.getSelection();selectInput(d.input);}+ if (e.type == "cut") cm.state.cutIncoming = true;}on(d.input, "cut", prepareCopy);on(d.input, "copy", prepareCopy);// Needed to handle Tab key in KHTMLif (khtml) on(d.sizer, "mouseup", function() {- if (document.activeElement == d.input) d.input.blur();- focusInput(cm);+ if (document.activeElement == d.input) d.input.blur();+ focusInput(cm);});}@@ -1641,12 +1733,14 @@ window.CodeMirror = (function() {}if (clickInGutter(cm, e)) return;var start = posFromMouse(cm, e);+ window.focus();switch (e_button(e)) {case 3:if (captureMiddleClick) onContextMenu.call(cm, cm, e);return;case 2:+ if (webkit) cm.state.lastMiddleDown = +new Date;if (start) extendSelection(cm.doc, start);setTimeout(bind(focusInput, cm), 20);e_preventDefault(e);@@ -1657,7 +1751,7 @@ window.CodeMirror = (function() {// selection.if (!start) {if (e_target(e) == display.scroller) e_preventDefault(e); return;}- if (!cm.state.focused) onFocus(cm);+ setTimeout(bind(ensureFocus, cm), 0);var now = +new Date, type = "single";if (lastDoubleClick && lastDoubleClick.time > now - 400 && posEq(lastDoubleClick.pos, start)) {@@ -1685,6 +1779,9 @@ window.CodeMirror = (function() {e_preventDefault(e2);extendSelection(cm.doc, start);focusInput(cm);+ // Work around unexplainable focus problem in IE9 (#2127)+ if (old_ie && !ie_lt9)+ setTimeout(function() {document.body.focus(); focusInput(cm);}, 20);}});// Let the drag handler handle this.@@ -1734,7 +1831,7 @@ window.CodeMirror = (function() {var cur = posFromMouse(cm, e, true);if (!cur) return;if (!posEq(cur, last)) {- if (!cm.state.focused) onFocus(cm);+ ensureFocus(cm);last = cur;doSelect(cur);var visible = visibleLines(display, doc);@@ -1759,7 +1856,7 @@ window.CodeMirror = (function() {}var move = operation(cm, function(e) {- if (!ie && !e_button(e)) done(e);+ if ((ie && !ie_lt10) ? !e.buttons : !e_button(e)) done(e);else extend(e);});var up = operation(cm, done);@@ -1767,17 +1864,16 @@ window.CodeMirror = (function() {on(document, "mouseup", up);}- function clickInGutter(cm, e) {- var display = cm.display;+ function gutterEvent(cm, e, type, prevent, signalfn) {try { var mX = e.clientX, mY = e.clientY; }catch(e) { return false; }+ if (mX >= Math.floor(getRect(cm.display.gutters).right)) return false;+ if (prevent) e_preventDefault(e);- if (mX >= Math.floor(getRect(display.gutters).right)) return false;- e_preventDefault(e);- if (!hasHandler(cm, "gutterClick")) return true;-+ var display = cm.display;var lineBox = getRect(display.lineDiv);- if (mY > lineBox.bottom) return true;++ if (mY > lineBox.bottom || !hasHandler(cm, type)) return e_defaultPrevented(e);mY -= lineBox.top - display.viewOffset;for (var i = 0; i < cm.options.gutters.length; ++i) {@@ -1785,11 +1881,19 @@ window.CodeMirror = (function() {if (g && getRect(g).right >= mX) {var line = lineAtHeight(cm.doc, mY);var gutter = cm.options.gutters[i];- signalLater(cm, "gutterClick", cm, line, gutter, e);- break;+ signalfn(cm, type, cm, line, gutter, e);+ return e_defaultPrevented(e);}}- return true;+ }++ function contextMenuInGutter(cm, e) {+ if (!hasHandler(cm, "gutterContextMenu")) return false;+ return gutterEvent(cm, e, "gutterContextMenu", false, signal);+ }++ function clickInGutter(cm, e) {+ return gutterEvent(cm, e, "gutterClick", true, signalLater);}// Kludge to work around strange IE behavior where it'll sometimes@@ -1834,7 +1938,6 @@ window.CodeMirror = (function() {if (cm.state.draggingText) replaceRange(cm.doc, "", curFrom, curTo, "paste");cm.replaceSelection(text, null, "paste");focusInput(cm);- onFocus(cm);}}catch(e){}@@ -1852,6 +1955,7 @@ window.CodeMirror = (function() {// Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.if (e.dataTransfer.setDragImage && !safari) {var img = elt("img", null, null, "position: fixed; left: 0; top: 0;");+ img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";if (opera) {img.width = img.height = 1;cm.display.wrapper.appendChild(img);@@ -2046,12 +2150,18 @@ window.CodeMirror = (function() {return handled;}+ function onKeyUp(e) {+ var cm = this;+ if (signalDOMEvent(cm, e) || cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return;+ if (e.keyCode == 16) cm.doc.sel.shift = false;+ }+var lastStoppedKey = null;function onKeyDown(e) {var cm = this;- if (!cm.state.focused) onFocus(cm);- if (ie && e.keyCode == 27) { e.returnValue = false; }+ ensureFocus(cm);if (signalDOMEvent(cm, e) || cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return;+ if (old_ie && e.keyCode == 27) e.returnValue = false;var code = e.keyCode;// IE does strange things with escape.cm.doc.sel.shift = code == 16 || e.shiftKey;@@ -2072,10 +2182,6 @@ window.CodeMirror = (function() {if (opera && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return;}if (((opera && (!e.which || e.which < 10)) || khtml) && handleKeyBinding(cm, e)) return;var ch = String.fromCharCode(charCode == null ? keyCode : charCode);- if (this.options.electricChars && this.doc.mode.electricChars &&- this.options.smartIndent && !isReadOnly(this) &&- this.doc.mode.electricChars.indexOf(ch) > -1)- setTimeout(operation(cm, function() {indentLine(cm, cm.doc.sel.to.line, "smart");}), 75);if (handleCharBinding(cm, e, ch)) return;if (ie && !ie_lt9) cm.display.inputHasSelection = null;fastPoll(cm);@@ -2088,7 +2194,10 @@ window.CodeMirror = (function() {cm.state.focused = true;if (cm.display.wrapper.className.search(/\bCodeMirror-focused\b/) == -1)cm.display.wrapper.className += " CodeMirror-focused";- resetInput(cm, true);+ if (!cm.curOp) {+ resetInput(cm, true);+ if (webkit) setTimeout(bind(resetInput, cm, true), 0); // Issue #1730+ }}slowPoll(cm);restartBlink(cm);@@ -2105,18 +2214,23 @@ window.CodeMirror = (function() {var detectingSelectAll;function onContextMenu(cm, e) {+ if (signalDOMEvent(cm, e, "contextmenu")) return;var display = cm.display, sel = cm.doc.sel;- if (eventInWidget(display, e)) return;+ if (eventInWidget(display, e) || contextMenuInGutter(cm, e)) return;var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;if (!pos || opera) return; // Opera is difficult.- if (posEq(sel.from, sel.to) || posLess(pos, sel.from) || !posLess(pos, sel.to))++ // Reset the current text selection only if the click is done outside of the selection+ // and 'resetSelectionOnContextMenu' option is true.+ var reset = cm.options.resetSelectionOnContextMenu;+ if (reset && (posEq(sel.from, sel.to) || posLess(pos, sel.from) || !posLess(pos, sel.to)))operation(cm, setSelection)(cm.doc, pos, pos);var oldCSS = display.input.style.cssText;display.inputDiv.style.position = "absolute";display.input.style.cssText = "position: fixed; width: 30px; height: 30px; top: " + (e.clientY - 5) +- "px; left: " + (e.clientX - 5) + "px; z-index: 1000; background: white; outline: none;" ++ "px; left: " + (e.clientX - 5) + "px; z-index: 1000; background: transparent; outline: none;" +"border-width: 0; outline: none; overflow: hidden; opacity: .05; -ms-opacity: .05; filter: alpha(opacity=5);";focusInput(cm);resetInput(cm, true);@@ -2125,8 +2239,8 @@ window.CodeMirror = (function() {function prepareSelectAllHack() {if (display.input.selectionStart != null) {- var extval = display.input.value = " " + (posEq(sel.from, sel.to) ? "" : display.input.value);- display.prevInput = " ";+ var extval = display.input.value = "\u200b" + (posEq(sel.from, sel.to) ? "" : display.input.value);+ display.prevInput = "\u200b";display.input.selectionStart = 1; display.input.selectionEnd = extval.length;}}@@ -2141,7 +2255,7 @@ window.CodeMirror = (function() {if (!ie || ie_lt9) prepareSelectAllHack();clearTimeout(detectingSelectAll);var i = 0, poll = function(){- if (display.prevInput == " " && display.input.selectionStart == 0)+ if (display.prevInput == "\u200b" && display.input.selectionStart == 0)operation(cm, commands.selectAll)(cm);else if (i++ < 10) detectingSelectAll = setTimeout(poll, 500);else resetInput(cm);@@ -2260,6 +2374,7 @@ window.CodeMirror = (function() {}function makeChangeNoReadonly(doc, change, selUpdate) {+ if (change.text.length == 1 && change.text[0] == "" && posEq(change.from, change.to)) return;var selAfter = computeSelAfterChange(doc, change, selUpdate);addToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);@@ -2422,6 +2537,7 @@ window.CodeMirror = (function() {function posEq(a, b) {return a.line == b.line && a.ch == b.ch;}function posLess(a, b) {return a.line < b.line || (a.line == b.line && a.ch < b.ch);}+ function cmp(a, b) {return a.line - b.line || a.ch - b.ch;}function copyPos(x) {return Pos(x.line, x.ch);}// SELECTION@@ -2482,6 +2598,7 @@ window.CodeMirror = (function() {var sel = doc.sel;sel.goalColumn = null;+ if (bias == null) bias = posLess(head, sel.head) ? -1 : 1;// Skip over atomic spans.if (checkAtomic || !posEq(anchor, sel.anchor))anchor = skipAtomic(doc, anchor, bias, checkAtomic != "push");@@ -2559,28 +2676,31 @@ window.CodeMirror = (function() {// SCROLLINGfunction scrollCursorIntoView(cm) {- var coords = scrollPosIntoView(cm, cm.doc.sel.head, cm.options.cursorScrollMargin);+ var coords = scrollPosIntoView(cm, cm.doc.sel.head, null, cm.options.cursorScrollMargin);if (!cm.state.focused) return;var display = cm.display, box = getRect(display.sizer), doScroll = null;if (coords.top + box.top < 0) doScroll = true;else if (coords.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) doScroll = false;if (doScroll != null && !phantom) {- var hidden = display.cursor.style.display == "none";- if (hidden) {- display.cursor.style.display = "";- display.cursor.style.left = coords.left + "px";- display.cursor.style.top = (coords.top - display.viewOffset) + "px";- }- display.cursor.scrollIntoView(doScroll);- if (hidden) display.cursor.style.display = "none";+ var scrollNode = elt("div", "\u200b", null, "position: absolute; top: " ++ (coords.top - display.viewOffset) + "px; height: " ++ (coords.bottom - coords.top + scrollerCutOff) + "px; left: " ++ coords.left + "px; width: 2px;");+ cm.display.lineSpace.appendChild(scrollNode);+ scrollNode.scrollIntoView(doScroll);+ cm.display.lineSpace.removeChild(scrollNode);}}- function scrollPosIntoView(cm, pos, margin) {+ function scrollPosIntoView(cm, pos, end, margin) {if (margin == null) margin = 0;for (;;) {var changed = false, coords = cursorCoords(cm, pos);- var scrollPos = calculateScrollPos(cm, coords.left, coords.top - margin, coords.left, coords.bottom + margin);+ var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);+ var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left),+ Math.min(coords.top, endCoords.top) - margin,+ Math.max(coords.left, endCoords.left),+ Math.max(coords.bottom, endCoords.bottom) + margin);var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;if (scrollPos.scrollTop != null) {setScrollTop(cm, scrollPos.scrollTop);@@ -2641,17 +2761,21 @@ window.CodeMirror = (function() {// API UTILITIESfunction indentLine(cm, n, how, aggressive) {- var doc = cm.doc;+ var doc = cm.doc, state;if (how == null) how = "add";if (how == "smart") {if (!cm.doc.mode.indent) how = "prev";- else var state = getStateBefore(cm, n);+ else state = getStateBefore(cm, n);}var tabSize = cm.options.tabSize;var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);+ if (line.stateAfter) line.stateAfter = null;var curSpaceString = line.text.match(/^\s*/)[0], indentation;- if (how == "smart") {+ if (!aggressive && !/\S/.test(line.text)) {+ indentation = 0;+ how = "not";+ } else if (how == "smart") {indentation = cm.doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);if (indentation == Pass) {if (!aggressive) return;@@ -2677,6 +2801,8 @@ window.CodeMirror = (function() {if (indentString != curSpaceString)replaceRange(cm.doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input");+ else if (doc.sel.head.line == n && doc.sel.head.ch < curSpaceString.length)+ setSelection(doc, Pos(n, curSpaceString.length), Pos(n, curSpaceString.length), 1);line.stateAfter = null;}@@ -2719,13 +2845,15 @@ window.CodeMirror = (function() {if (dir < 0 && !moveOnce(!first)) break;var cur = lineObj.text.charAt(ch) || "\n";var type = isWordChar(cur) ? "w"- : !group ? null- : /\s/.test(cur) ? null+ : group && cur == "\n" ? "n"+ : !group || /\s/.test(cur) ? null: "p";+ if (group && !first && !type) type = "s";if (sawType && sawType != type) {if (dir < 0) {dir = 1; moveOnce();}break;}+if (type) sawType = type;if (dir > 0 && !moveOnce(!first)) break;}@@ -2755,7 +2883,7 @@ window.CodeMirror = (function() {function findWordAt(line, pos) {var start = pos.ch, end = pos.ch;if (line) {- if (pos.xRel < 0 || end == line.length) --start; else ++end;+ if ((pos.xRel < 0 || end == line.length) && start) --start; else ++end;var startChar = line.charAt(start);var check = isWordChar(startChar) ? isWordChar: /\s/.test(startChar) ? function(ch) {return /\s/.test(ch);}@@ -2777,7 +2905,7 @@ window.CodeMirror = (function() {CodeMirror.prototype = {constructor: CodeMirror,- focus: function(){window.focus(); focusInput(this); onFocus(this); fastPoll(this);},+ focus: function(){window.focus(); focusInput(this); fastPoll(this);},setOption: function(option, value) {var options = this.options, old = options[option];@@ -2796,7 +2924,7 @@ window.CodeMirror = (function() {removeKeyMap: function(map) {var maps = this.state.keyMaps;for (var i = 0; i < maps.length; ++i)- if ((typeof map == "string" ? maps[i].name : maps[i]) == map) {+ if (maps[i] == map || (typeof maps[i] != "string" && maps[i].name == map)) {maps.splice(i, 1);return true;}@@ -2831,7 +2959,7 @@ window.CodeMirror = (function() {}),indentSelection: operation(null, function(how) {var sel = this.doc.sel;- if (posEq(sel.from, sel.to)) return indentLine(this, sel.from.line, how);+ if (posEq(sel.from, sel.to)) return indentLine(this, sel.from.line, how, true);var e = sel.to.line - (sel.to.ch ? 0 : 1);for (var i = sel.from.line; i <= e; ++i) indentLine(this, i, how);}),@@ -2860,6 +2988,7 @@ window.CodeMirror = (function() {pos = clipPos(this.doc, pos);var styles = getLineStyles(this, getLine(this.doc, pos.line));var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;+ if (ch == 0) return styles[2];for (;;) {var mid = (before + after) >> 1;if ((mid ? styles[mid * 2 - 1] : 0) >= ch) after = mid;@@ -2868,6 +2997,40 @@ window.CodeMirror = (function() {}},+ getModeAt: function(pos) {+ var mode = this.doc.mode;+ if (!mode.innerMode) return mode;+ return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode;+ },++ getHelper: function(pos, type) {+ return this.getHelpers(pos, type)[0];+ },++ getHelpers: function(pos, type) {+ var found = [];+ if (!helpers.hasOwnProperty(type)) return helpers;+ var help = helpers[type], mode = this.getModeAt(pos);+ if (typeof mode[type] == "string") {+ if (help[mode[type]]) found.push(help[mode[type]]);+ } else if (mode[type]) {+ for (var i = 0; i < mode[type].length; i++) {+ var val = help[mode[type][i]];+ if (val) found.push(val);+ }+ } else if (mode.helperType && help[mode.helperType]) {+ found.push(help[mode.helperType]);+ } else if (help[mode.name]) {+ found.push(help[mode.name]);+ }+ for (var i = 0; i < help._global.length; i++) {+ var cur = help._global[i];+ if (cur.pred(mode, this) && indexOf(found, cur.val) == -1)+ found.push(cur.val);+ }+ return found;+ },+getStateAfter: function(line, precise) {var doc = this.doc;line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);@@ -3011,8 +3174,13 @@ window.CodeMirror = (function() {},triggerOnKeyDown: operation(null, onKeyDown),+ triggerOnKeyPress: operation(null, onKeyPress),+ triggerOnKeyUp: operation(null, onKeyUp),- execCommand: function(cmd) {return commands[cmd](this);},+ execCommand: function(cmd) {+ if (commands.hasOwnProperty(cmd))+ return commands[cmd](this);+ },findPosH: function(from, amount, unit, visually) {var dir = 1;@@ -3054,14 +3222,18 @@ window.CodeMirror = (function() {},moveV: operation(null, function(dir, unit) {- var sel = this.doc.sel;- var pos = cursorCoords(this, sel.head, "div");- if (sel.goalColumn != null) pos.left = sel.goalColumn;- var target = findPosV(this, pos, dir, unit);-- if (unit == "page") addToScrollPos(this, 0, charCoords(this, target, "div").top - pos.top);+ var sel = this.doc.sel, target, goal;+ if (sel.shift || sel.extend || posEq(sel.from, sel.to)) {+ var pos = cursorCoords(this, sel.head, "div");+ if (sel.goalColumn != null) pos.left = sel.goalColumn;+ target = findPosV(this, pos, dir, unit);+ if (unit == "page") addToScrollPos(this, 0, charCoords(this, target, "div").top - pos.top);+ goal = pos.left;+ } else {+ target = dir < 0 ? sel.from : sel.to;+ }extendSelection(this.doc, target, target, dir);- sel.goalColumn = pos.left;+ if (goal != null) sel.goalColumn = goal;}),toggleOverwrite: function(value) {@@ -3070,8 +3242,10 @@ window.CodeMirror = (function() {this.display.cursor.className += " CodeMirror-overwrite";elsethis.display.cursor.className = this.display.cursor.className.replace(" CodeMirror-overwrite", "");++ signal(this, "overwriteToggle", this, this.state.overwrite);},- hasFocus: function() { return this.state.focused; },+ hasFocus: function() { return document.activeElement == this.display.input; },scrollTo: operation(null, function(x, y) {updateScrollPos(this, x, y);@@ -3083,38 +3257,48 @@ window.CodeMirror = (function() {clientHeight: scroller.clientHeight - co, clientWidth: scroller.clientWidth - co};},- scrollIntoView: operation(null, function(pos, margin) {- if (typeof pos == "number") pos = Pos(pos, 0);+ scrollIntoView: operation(null, function(range, margin) {+ if (range == null) range = {from: this.doc.sel.head, to: null};+ else if (typeof range == "number") range = {from: Pos(range, 0), to: null};+ else if (range.from == null) range = {from: range, to: null};+ if (!range.to) range.to = range.from;if (!margin) margin = 0;- var coords = pos;- if (!pos || pos.line != null) {- this.curOp.scrollToPos = pos ? clipPos(this.doc, pos) : this.doc.sel.head;- this.curOp.scrollToPosMargin = margin;- coords = cursorCoords(this, this.curOp.scrollToPos);+ var coords = range;+ if (range.from.line != null) {+ this.curOp.scrollToPos = {from: range.from, to: range.to, margin: margin};+ coords = {from: cursorCoords(this, range.from),+ to: cursorCoords(this, range.to)};}- var sPos = calculateScrollPos(this, coords.left, coords.top - margin, coords.right, coords.bottom + margin);+ var sPos = calculateScrollPos(this, Math.min(coords.from.left, coords.to.left),+ Math.min(coords.from.top, coords.to.top) - margin,+ Math.max(coords.from.right, coords.to.right),+ Math.max(coords.from.bottom, coords.to.bottom) + margin);updateScrollPos(this, sPos.scrollLeft, sPos.scrollTop);}),- setSize: function(width, height) {+ setSize: operation(null, function(width, height) {function interpret(val) {return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val;}if (width != null) this.display.wrapper.style.width = interpret(width);if (height != null) this.display.wrapper.style.height = interpret(height);- this.refresh();- },-- on: function(type, f) {on(this, type, f);},- off: function(type, f) {off(this, type, f);},+ if (this.options.lineWrapping)+ this.display.measureLineCache.length = this.display.measureLineCachePos = 0;+ this.curOp.forceUpdate = true;+ signal(this, "refresh", this);+ }),operation: function(f){return runInOp(this, f);},refresh: operation(null, function() {+ var oldHeight = this.display.cachedTextHeight;clearCaches(this);updateScrollPos(this, this.doc.scrollLeft, this.doc.scrollTop);regChange(this);+ if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)+ estimateLineHeights(this);+ signal(this, "refresh", this);}),swapDoc: operation(null, function(doc) {@@ -3124,6 +3308,7 @@ window.CodeMirror = (function() {clearCaches(this);resetInput(this, true);updateScrollPos(this, doc.scrollLeft, doc.scrollTop);+ signalLater(this, "swapDoc", this, old);return old;}),@@ -3132,6 +3317,7 @@ window.CodeMirror = (function() {getScrollerElement: function(){return this.display.scroller;},getGutterElement: function(){return this.display.gutters;}};+ eventMixin(CodeMirror);// OPTION DEFAULTS@@ -3162,12 +3348,18 @@ window.CodeMirror = (function() {option("indentWithTabs", false);option("smartIndent", true);option("tabSize", 4, function(cm) {- loadMode(cm);+ resetModeState(cm);clearCaches(cm);regChange(cm);}, true);+ option("specialChars", /[\t\u0000-\u0019\u00ad\u200b\u2028\u2029\ufeff]/g, function(cm, val) {+ cm.options.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g");+ cm.refresh();+ }, true);+ option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function(cm) {cm.refresh();}, true);option("electricChars", true);option("rtlMoveVisually", !windows);+ option("wholeLineUpdateBefore", true);option("theme", "default", function(cm) {themeChanged(cm);@@ -3197,10 +3389,19 @@ window.CodeMirror = (function() {option("lineNumberFormatter", function(integer) {return integer;}, guttersChanged, true);option("showCursorWhenSelecting", false, updateSelection, true);+ option("resetSelectionOnContextMenu", true);+option("readOnly", false, function(cm, val) {- if (val == "nocursor") {onBlur(cm); cm.display.input.blur();}- else if (!val) resetInput(cm, true);+ if (val == "nocursor") {+ onBlur(cm);+ cm.display.input.blur();+ cm.display.disabled = true;+ } else {+ cm.display.disabled = false;+ if (!val) resetInput(cm, true);+ }});+ option("disableInput", false, function(cm, val) {if (!val) resetInput(cm, true);}, true);option("dragDrop", true);option("cursorBlinkRate", 530);@@ -3208,12 +3409,14 @@ window.CodeMirror = (function() {option("cursorHeight", 1);option("workTime", 100);option("workDelay", 100);- option("flattenSpans", true);+ option("flattenSpans", true, resetModeState, true);+ option("addModeClass", false, resetModeState, true);option("pollInterval", 100);option("undoDepth", 40, function(cm, val){cm.doc.history.undoDepth = val;});option("historyEventDelay", 500);option("viewportMargin", 10, function(cm){cm.refresh();}, true);- option("maxHighlightLength", 10000, function(cm){loadMode(cm); cm.refresh();}, true);+ option("maxHighlightLength", 10000, resetModeState, true);+ option("crudeMeasuringFrom", 10000);option("moveInputWithCursor", true, function(cm, val) {if (!val) cm.display.inputDiv.style.top = cm.display.inputDiv.style.left = 0;});@@ -3246,6 +3449,7 @@ window.CodeMirror = (function() {spec = mimeModes[spec];} else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) {var found = mimeModes[spec.name];+ if (typeof found == "string") found = {name: found};spec = createObj(found, spec);spec.name = found.name;} else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) {@@ -3256,7 +3460,7 @@ window.CodeMirror = (function() {};CodeMirror.getMode = function(options, spec) {- spec = CodeMirror.resolveMode(spec);+ var spec = CodeMirror.resolveMode(spec);var mfactory = modes[spec.name];if (!mfactory) return CodeMirror.getMode(options, "text/plain");var modeObj = mfactory(options, spec);@@ -3269,6 +3473,10 @@ window.CodeMirror = (function() {}}modeObj.name = spec.name;+ if (spec.helperType) modeObj.helperType = spec.helperType;+ if (spec.modeProps) for (var prop in spec.modeProps)+ modeObj[prop] = spec.modeProps[prop];+return modeObj;};@@ -3296,6 +3504,20 @@ window.CodeMirror = (function() {var initHooks = [];CodeMirror.defineInitHook = function(f) {initHooks.push(f);};+ var helpers = CodeMirror.helpers = {};+ CodeMirror.registerHelper = function(type, name, value) {+ if (!helpers.hasOwnProperty(type)) helpers[type] = CodeMirror[type] = {_global: []};+ helpers[type][name] = value;+ };+ CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {+ CodeMirror.registerHelper(type, name, value);+ helpers[type]._global.push({pred: predicate, val: value});+ };++ // UTILITIES++ CodeMirror.isWordChar = isWordChar;+// MODE STATE HANDLING// Utility functions for working with state. Exported because modes@@ -3321,6 +3543,7 @@ window.CodeMirror = (function() {CodeMirror.innerMode = function(mode, state) {while (mode.innerMode) {var info = mode.innerMode(state);+ if (!info || info.mode == mode) break;state = info.state;mode = info.mode;}@@ -3339,7 +3562,7 @@ window.CodeMirror = (function() {},deleteLine: function(cm) {var l = cm.getCursor().line;- cm.replaceRange("", Pos(l, 0), Pos(l), "+delete");+ cm.replaceRange("", Pos(l, 0), Pos(l + 1, 0), "+delete");},delLineLeft: function(cm) {var cur = cm.getCursor();@@ -3394,7 +3617,9 @@ window.CodeMirror = (function() {indentAuto: function(cm) {cm.indentSelection("smart");},indentMore: function(cm) {cm.indentSelection("add");},indentLess: function(cm) {cm.indentSelection("subtract");},- insertTab: function(cm) {cm.replaceSelection("\t", "end", "+input");},+ insertTab: function(cm) {+ cm.replaceSelection("\t", "end", "+input");+ },defaultTab: function(cm) {if (cm.somethingSelected()) cm.indentSelection("add");else cm.replaceSelection("\t", "end", "+input");@@ -3420,14 +3645,15 @@ window.CodeMirror = (function() {keyMap.basic = {"Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown","End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown",- "Delete": "delCharAfter", "Backspace": "delCharBefore", "Tab": "defaultTab", "Shift-Tab": "indentAuto",+ "Delete": "delCharAfter", "Backspace": "delCharBefore", "Shift-Backspace": "delCharBefore",+ "Tab": "defaultTab", "Shift-Tab": "indentAuto","Enter": "newlineAndIndent", "Insert": "toggleOverwrite"};// Note that the save and find-related commands aren't defined by// default. Unknown commands are simply ignored.keyMap.pcDefault = {"Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo",- "Ctrl-Home": "goDocStart", "Alt-Up": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Down": "goDocEnd",+ "Ctrl-Home": "goDocStart", "Ctrl-Up": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Down": "goDocEnd","Ctrl-Left": "goGroupLeft", "Ctrl-Right": "goGroupRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd","Ctrl-Backspace": "delGroupBefore", "Ctrl-Delete": "delGroupAfter", "Ctrl-S": "save", "Ctrl-F": "find","Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll",@@ -3566,11 +3792,12 @@ window.CodeMirror = (function() {this.string = string;this.tabSize = tabSize || 8;this.lastColumnPos = this.lastColumnValue = 0;+ this.lineStart = 0;}StringStream.prototype = {eol: function() {return this.pos >= this.string.length;},- sol: function() {return this.pos == 0;},+ sol: function() {return this.pos == this.lineStart;},peek: function() {return this.string.charAt(this.pos) || undefined;},next: function() {if (this.pos < this.string.length)@@ -3603,9 +3830,12 @@ window.CodeMirror = (function() {this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);this.lastColumnPos = this.start;}- return this.lastColumnValue;+ return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0);+ },+ indentation: function() {+ return countColumn(this.string, null, this.tabSize) -+ (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0);},- indentation: function() {return countColumn(this.string, null, this.tabSize);},match: function(pattern, consume, caseInsensitive) {if (typeof pattern == "string") {var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;};@@ -3621,7 +3851,12 @@ window.CodeMirror = (function() {return match;}},- current: function(){return this.string.slice(this.start, this.pos);}+ current: function(){return this.string.slice(this.start, this.pos);},+ hideFirstChars: function(n, inner) {+ this.lineStart += n;+ try { return inner(); }+ finally { this.lineStart -= n; }+ }};CodeMirror.StringStream = StringStream;@@ -3633,11 +3868,16 @@ window.CodeMirror = (function() {this.doc = doc;}CodeMirror.TextMarker = TextMarker;+ eventMixin(TextMarker);TextMarker.prototype.clear = function() {if (this.explicitlyCleared) return;var cm = this.doc.cm, withOp = cm && !cm.curOp;if (withOp) startOperation(cm);+ if (hasHandler(this, "clear")) {+ var found = this.find();+ if (found) signalLater(this, "clear", found.from, found.to);+ }var min = null, max = null;for (var i = 0; i < this.lines.length; ++i) {var line = this.lines[i];@@ -3666,10 +3906,9 @@ window.CodeMirror = (function() {if (cm) reCheckSelection(cm);}if (withOp) endOperation(cm);- signalLater(this, "clear");};- TextMarker.prototype.find = function() {+ TextMarker.prototype.find = function(bothSides) {var from, to;for (var i = 0; i < this.lines.length; ++i) {var line = this.lines[i];@@ -3680,21 +3919,24 @@ window.CodeMirror = (function() {if (span.to != null) to = Pos(found, span.to);}}- if (this.type == "bookmark") return from;+ if (this.type == "bookmark" && !bothSides) return from;return from && {from: from, to: to};};TextMarker.prototype.changed = function() {var pos = this.find(), cm = this.doc.cm;if (!pos || !cm) return;- var line = getLine(this.doc, pos.from.line);+ if (this.type != "bookmark") pos = pos.from;+ var line = getLine(this.doc, pos.line);clearCachedMeasurement(cm, line);- if (pos.from.line >= cm.display.showingFrom && pos.from.line < cm.display.showingTo) {+ if (pos.line >= cm.display.showingFrom && pos.line < cm.display.showingTo) {for (var node = cm.display.lineDiv.firstChild; node; node = node.nextSibling) if (node.lineObj == line) {if (node.offsetHeight != line.height) updateLineHeight(line, node.offsetHeight);break;}- runInOp(cm, function() { cm.curOp.selectionChanged = true; });+ runInOp(cm, function() {+ cm.curOp.selectionChanged = cm.curOp.forceUpdate = cm.curOp.updateMaxLine = true;+ });}};@@ -3714,37 +3956,40 @@ window.CodeMirror = (function() {}};+ var nextMarkerId = 0;+function markText(doc, from, to, options, type) {if (options && options.shared) return markTextShared(doc, from, to, options, type);if (doc.cm && !doc.cm.curOp) return operation(doc.cm, markText)(doc, from, to, options, type);var marker = new TextMarker(doc, type);- if (type == "range" && !posLess(from, to)) return marker;if (options) copyObj(options, marker);+ if (posLess(to, from) || posEq(from, to) && marker.clearWhenEmpty !== false)+ return marker;if (marker.replacedWith) {marker.collapsed = true;marker.replacedWith = elt("span", [marker.replacedWith], "CodeMirror-widget");if (!options.handleMouseEvents) marker.replacedWith.ignoreEvents = true;}- if (marker.collapsed) sawCollapsedSpans = true;+ if (marker.collapsed) {+ if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||+ from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))+ throw new Error("Inserting collapsed marker partially overlapping an existing one");+ sawCollapsedSpans = true;+ }if (marker.addToHistory)addToHistory(doc, {from: from, to: to, origin: "markText"},{head: doc.sel.head, anchor: doc.sel.anchor}, NaN);- var curLine = from.line, size = 0, collapsedAtStart, collapsedAtEnd, cm = doc.cm, updateMaxLine;+ var curLine = from.line, cm = doc.cm, updateMaxLine;doc.iter(curLine, to.line + 1, function(line) {if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(doc, line) == cm.display.maxLine)updateMaxLine = true;var span = {from: null, to: null, marker: marker};- size += line.text.length;- if (curLine == from.line) {span.from = from.ch; size -= from.ch;}- if (curLine == to.line) {span.to = to.ch; size -= line.text.length - to.ch;}- if (marker.collapsed) {- if (curLine == to.line) collapsedAtEnd = collapsedSpanAt(line, to.ch);- if (curLine == from.line) collapsedAtStart = collapsedSpanAt(line, from.ch);- else updateLineHeight(line, 0);- }+ if (curLine == from.line) span.from = from.ch;+ if (curLine == to.line) span.to = to.ch;+ if (marker.collapsed && curLine != from.line) updateLineHeight(line, 0);addMarkedSpan(line, span);++curLine;});@@ -3760,14 +4005,12 @@ window.CodeMirror = (function() {doc.clearHistory();}if (marker.collapsed) {- if (collapsedAtStart != collapsedAtEnd)- throw new Error("Inserting collapsed marker overlapping an existing one");- marker.size = size;+ marker.id = ++nextMarkerId;marker.atomic = true;}if (cm) {if (updateMaxLine) cm.curOp.updateMaxLine = true;- if (marker.className || marker.startStyle || marker.endStyle || marker.collapsed)+ if (marker.className || marker.title || marker.startStyle || marker.endStyle || marker.collapsed)regChange(cm, from.line, to.line + 1);if (marker.atomic) reCheckSelection(cm);}@@ -3785,6 +4028,7 @@ window.CodeMirror = (function() {}}CodeMirror.SharedTextMarker = SharedTextMarker;+ eventMixin(SharedTextMarker);SharedTextMarker.prototype.clear = function() {if (this.explicitlyCleared) return;@@ -3834,7 +4078,7 @@ window.CodeMirror = (function() {if (old) for (var i = 0, nw; i < old.length; ++i) {var span = old[i], marker = span.marker;var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);- if (startsBefore || marker.type == "bookmark" && span.from == startCh && (!isInsert || !span.marker.insertLeft)) {+ if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) {var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh);(nw || (nw = [])).push({from: span.from,to: endsAfter ? null : span.to,@@ -3848,7 +4092,7 @@ window.CodeMirror = (function() {if (old) for (var i = 0, nw; i < old.length; ++i) {var span = old[i], marker = span.marker;var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);- if (endsAfter || marker.type == "bookmark" && span.from == endCh && (!isInsert || span.marker.insertLeft)) {+ if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) {var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh);(nw || (nw = [])).push({from: startsBefore ? null : span.from - endCh,to: span.to == null ? null : span.to - endCh,@@ -3898,13 +4142,9 @@ window.CodeMirror = (function() {}}}- if (sameLine && first) {- // Make sure we didn't create any zero-length spans- for (var i = 0; i < first.length; ++i)- if (first[i].from != null && first[i].from == first[i].to && first[i].marker.type != "bookmark")- first.splice(i--, 1);- if (!first.length) first = null;- }+ // Make sure we didn't create any zero-length spans+ if (first) first = clearEmptySpans(first);+ if (last && last != first) last = clearEmptySpans(last);var newMarkers = [first];if (!sameLine) {@@ -3921,6 +4161,16 @@ window.CodeMirror = (function() {return newMarkers;}+ function clearEmptySpans(spans) {+ for (var i = 0; i < spans.length; ++i) {+ var span = spans[i];+ if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)+ spans.splice(i--, 1);+ }+ if (!spans.length) return null;+ return spans;+ }+function mergeOldSpans(doc, change) {var old = getOldSpans(doc, change);var stretched = stretchSpansOverChange(doc, change);@@ -3971,20 +4221,48 @@ window.CodeMirror = (function() {return parts;}- function collapsedSpanAt(line, ch) {+ function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0; }+ function extraRight(marker) { return marker.inclusiveRight ? 1 : 0; }++ function compareCollapsedMarkers(a, b) {+ var lenDiff = a.lines.length - b.lines.length;+ if (lenDiff != 0) return lenDiff;+ var aPos = a.find(), bPos = b.find();+ var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);+ if (fromCmp) return -fromCmp;+ var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);+ if (toCmp) return toCmp;+ return b.id - a.id;+ }++ function collapsedSpanAtSide(line, start) {var sps = sawCollapsedSpans && line.markedSpans, found;if (sps) for (var sp, i = 0; i < sps.length; ++i) {sp = sps[i];- if (!sp.marker.collapsed) continue;- if ((sp.from == null || sp.from < ch) &&- (sp.to == null || sp.to > ch) &&- (!found || found.width < sp.marker.width))+ if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&+ (!found || compareCollapsedMarkers(found, sp.marker) < 0))found = sp.marker;}return found;}- function collapsedSpanAtStart(line) { return collapsedSpanAt(line, -1); }- function collapsedSpanAtEnd(line) { return collapsedSpanAt(line, line.text.length + 1); }+ function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true); }+ function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false); }++ function conflictingCollapsedRange(doc, lineNo, from, to, marker) {+ var line = getLine(doc, lineNo);+ var sps = sawCollapsedSpans && line.markedSpans;+ if (sps) for (var i = 0; i < sps.length; ++i) {+ var sp = sps[i];+ if (!sp.marker.collapsed) continue;+ var found = sp.marker.find(true);+ var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);+ var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);+ if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;+ if (fromCmp <= 0 && (cmp(found.to, from) || extraRight(sp.marker) - extraLeft(marker)) > 0 ||+ fromCmp >= 0 && (cmp(found.from, to) || extraLeft(sp.marker) - extraRight(marker)) < 0)+ return true;+ }+ }function visualLine(doc, line) {var merged;@@ -4014,6 +4292,7 @@ window.CodeMirror = (function() {for (var sp, i = 0; i < line.markedSpans.length; ++i) {sp = line.markedSpans[i];if (sp.marker.collapsed && !sp.marker.replacedWith && sp.from == span.to &&+ (sp.to == null || sp.to != span.from) &&(sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&lineIsHiddenInner(doc, line, sp)) return true;}@@ -4037,11 +4316,12 @@ window.CodeMirror = (function() {// LINE WIDGETSvar LineWidget = CodeMirror.LineWidget = function(cm, node, options) {- for (var opt in options) if (options.hasOwnProperty(opt))+ if (options) for (var opt in options) if (options.hasOwnProperty(opt))this[opt] = options[opt];this.cm = cm;this.node = node;};+ eventMixin(LineWidget);function widgetOperation(f) {return function() {var withOp = !this.cm.curOp;@@ -4056,7 +4336,9 @@ window.CodeMirror = (function() {if (no == null || !ws) return;for (var i = 0; i < ws.length; ++i) if (ws[i] == this) ws.splice(i--, 1);if (!ws.length) this.line.widgets = null;+ var aboveVisible = heightAtLine(this.cm, this.line) < this.cm.doc.scrollTop;updateLineHeight(this.line, Math.max(0, this.line.height - widgetHeight(this)));+ if (aboveVisible) addToScrollPos(this.cm, 0, -this.height);regChange(this.cm, no, no + 1);});LineWidget.prototype.changed = widgetOperation(function() {@@ -4080,12 +4362,15 @@ window.CodeMirror = (function() {var widget = new LineWidget(cm, node, options);if (widget.noHScroll) cm.display.alignWidgets = true;changeLine(cm, handle, function(line) {- (line.widgets || (line.widgets = [])).push(widget);+ var widgets = line.widgets || (line.widgets = []);+ if (widget.insertAt == null) widgets.push(widget);+ else widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget);widget.line = line;if (!lineIsHidden(cm.doc, line) || widget.showIfHidden) {- var aboveVisible = heightAtLine(cm, line) < cm.display.scroller.scrollTop;+ var aboveVisible = heightAtLine(cm, line) < cm.doc.scrollTop;updateLineHeight(line, line.height + widgetHeight(widget));if (aboveVisible) addToScrollPos(cm, 0, widget.height);+ cm.curOp.forceUpdate = true;}return true;});@@ -4096,12 +4381,13 @@ window.CodeMirror = (function() {// Line objects. These hold state related to a line, including// highlighting info (the styles array).- function makeLine(text, markedSpans, estimateHeight) {- var line = {text: text};- attachMarkedSpans(line, markedSpans);- line.height = estimateHeight ? estimateHeight(line) : 1;- return line;- }+ var Line = CodeMirror.Line = function(text, markedSpans, estimateHeight) {+ this.text = text;+ attachMarkedSpans(this, markedSpans);+ this.height = estimateHeight ? estimateHeight(this) : 1;+ };+ eventMixin(Line);+ Line.prototype.lineNo = function() { return lineNo(this); };function updateLine(line, text, markedSpans, estimateHeight) {line.text = text;@@ -4122,7 +4408,7 @@ window.CodeMirror = (function() {// Run the given mode's parser over a line, update the styles// array, which contains alternating fragments of text and CSS// classes.- function runMode(cm, text, mode, state, f) {+ function runMode(cm, text, mode, state, f, forceToEnd) {var flattenSpans = mode.flattenSpans;if (flattenSpans == null) flattenSpans = cm.options.flattenSpans;var curStart = 0, curStyle = null;@@ -4131,27 +4417,38 @@ window.CodeMirror = (function() {while (!stream.eol()) {if (stream.pos > cm.options.maxHighlightLength) {flattenSpans = false;- // Webkit seems to refuse to render text nodes longer than 57444 characters- stream.pos = Math.min(text.length, stream.start + 50000);+ if (forceToEnd) processLine(cm, text, state, stream.pos);+ stream.pos = text.length;style = null;} else {style = mode.token(stream, state);}+ if (cm.options.addModeClass) {+ var mName = CodeMirror.innerMode(mode, state).mode.name;+ if (mName) style = "m-" + (style ? mName + " " + style : mName);+ }if (!flattenSpans || curStyle != style) {if (curStart < stream.start) f(stream.start, curStyle);curStart = stream.start; curStyle = style;}stream.start = stream.pos;}- if (curStart < stream.pos) f(stream.pos, curStyle);+ while (curStart < stream.pos) {+ // Webkit seems to refuse to render text nodes longer than 57444 characters+ var pos = Math.min(stream.pos, curStart + 50000);+ f(pos, curStyle);+ curStart = pos;+ }}- function highlightLine(cm, line, state) {+ function highlightLine(cm, line, state, forceToEnd) {// A styles array always starts with a number identifying the// mode/overlays that it is based on (for easy invalidation).var st = [cm.state.modeGen];// Compute the base array of styles- runMode(cm, line.text, cm.doc.mode, state, function(end, style) {st.push(end, style);});+ runMode(cm, line.text, cm.doc.mode, state, function(end, style) {+ st.push(end, style);+ }, forceToEnd);// Run overlays, adjust style array.for (var o = 0; o < cm.state.overlays.length; ++o) {@@ -4190,31 +4487,44 @@ window.CodeMirror = (function() {// Lightweight form of highlight -- proceed over this line and// update state, but don't save a style array.- function processLine(cm, line, state) {+ function processLine(cm, text, state, startAt) {var mode = cm.doc.mode;- var stream = new StringStream(line.text, cm.options.tabSize);- if (line.text == "" && mode.blankLine) mode.blankLine(state);+ var stream = new StringStream(text, cm.options.tabSize);+ stream.start = stream.pos = startAt || 0;+ if (text == "" && mode.blankLine) mode.blankLine(state);while (!stream.eol() && stream.pos <= cm.options.maxHighlightLength) {mode.token(stream, state);stream.start = stream.pos;}}- var styleToClassCache = {};- function styleToClass(style) {+ var styleToClassCache = {}, styleToClassCacheWithMode = {};+ function interpretTokenStyle(style, builder) {if (!style) return null;- return styleToClassCache[style] ||- (styleToClassCache[style] = "cm-" + style.replace(/ +/g, " cm-"));- }-- function lineContent(cm, realLine, measure) {+ for (;;) {+ var lineClass = style.match(/(?:^|\s+)line-(background-)?(\S+)/);+ if (!lineClass) break;+ style = style.slice(0, lineClass.index) + style.slice(lineClass.index + lineClass[0].length);+ var prop = lineClass[1] ? "bgClass" : "textClass";+ if (builder[prop] == null)+ builder[prop] = lineClass[2];+ else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(builder[prop]))+ builder[prop] += " " + lineClass[2];+ }+ if (/^\s*$/.test(style)) return null;+ var cache = builder.cm.options.addModeClass ? styleToClassCacheWithMode : styleToClassCache;+ return cache[style] ||+ (cache[style] = style.replace(/\S+/g, "cm-$&"));+ }++ function buildLineContent(cm, realLine, measure, copyWidgets) {var merged, line = realLine, empty = true;while (merged = collapsedSpanAtStart(line))line = getLine(cm.doc, merged.find().from.line);- var builder = {pre: elt("pre"), col: 0, pos: 0, display: !measure,- measure: null, measuredSomething: false, cm: cm};- if (line.textClass) builder.pre.className = line.textClass;+ var builder = {pre: elt("pre"), col: 0, pos: 0,+ measure: null, measuredSomething: false, cm: cm,+ copyWidgets: copyWidgets};do {if (line.text) empty = false;@@ -4251,21 +4561,30 @@ window.CodeMirror = (function() {}}+ var textClass = builder.textClass ? builder.textClass + " " + (realLine.textClass || "") : realLine.textClass;+ if (textClass) builder.pre.className = textClass;+signal(cm, "renderLine", cm, realLine, builder.pre);- return builder.pre;+ return builder;}- var tokenSpecialChars = /[\t\u0000-\u0019\u00ad\u200b\u2028\u2029\uFEFF]/g;- function buildToken(builder, text, style, startStyle, endStyle) {+ function defaultSpecialCharPlaceholder(ch) {+ var token = elt("span", "\u2022", "cm-invalidchar");+ token.title = "\\u" + ch.charCodeAt(0).toString(16);+ return token;+ }++ function buildToken(builder, text, style, startStyle, endStyle, title) {if (!text) return;- if (!tokenSpecialChars.test(text)) {+ var special = builder.cm.options.specialChars;+ if (!special.test(text)) {builder.col += text.length;var content = document.createTextNode(text);} else {var content = document.createDocumentFragment(), pos = 0;while (true) {- tokenSpecialChars.lastIndex = pos;- var m = tokenSpecialChars.exec(text);+ special.lastIndex = pos;+ var m = special.exec(text);var skipped = m ? m.index - pos : text.length - pos;if (skipped) {content.appendChild(document.createTextNode(text.slice(pos, pos + skipped)));@@ -4278,8 +4597,7 @@ window.CodeMirror = (function() {content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab"));builder.col += tabWidth;} else {- var token = elt("span", "\u2022", "cm-invalidchar");- token.title = "\\u" + m[0].charCodeAt(0).toString(16);+ var token = builder.cm.options.specialCharPlaceholder(m[0]);content.appendChild(token);builder.col += 1;}@@ -4289,7 +4607,9 @@ window.CodeMirror = (function() {var fullStyle = style || "";if (startStyle) fullStyle += startStyle;if (endStyle) fullStyle += endStyle;- return builder.pre.appendChild(elt("span", [content], fullStyle));+ var token = elt("span", [content], fullStyle);+ if (title) token.title = title;+ return builder.pre.appendChild(token);}builder.pre.appendChild(content);}@@ -4297,20 +4617,21 @@ window.CodeMirror = (function() {function buildTokenMeasure(builder, text, style, startStyle, endStyle) {var wrapping = builder.cm.options.lineWrapping;for (var i = 0; i < text.length; ++i) {- var ch = text.charAt(i), start = i == 0;- if (ch >= "\ud800" && ch < "\udbff" && i < text.length - 1) {- ch = text.slice(i, i + 2);- ++i;- } else if (i && wrapping && spanAffectsWrapping(text, i)) {+ var start = i == 0, to = i + 1;+ while (to < text.length && isExtendingChar(text.charAt(to))) ++to;+ var ch = text.slice(i, to);+ i = to - 1;+ if (i && wrapping && spanAffectsWrapping(text, i))builder.pre.appendChild(elt("wbr"));- }+ var old = builder.measure[builder.pos];var span = builder.measure[builder.pos] =buildToken(builder, ch, style,start && startStyle, i == text.length - 1 && endStyle);+ if (old) span.leftSide = old.leftSide || old;// In IE single-space nodes wrap differently than spaces// embedded in larger text nodes, except when set to// white-space: normal (issue #1268).- if (ie && wrapping && ch == " " && i && !/\s/.test(text.charAt(i - 1)) &&+ if (old_ie && wrapping && ch == " " && i && !/\s/.test(text.charAt(i - 1)) &&i < text.length - 1 && !/\s/.test(text.charAt(i + 1)))span.style.whiteSpace = "normal";builder.pos += ch.length;@@ -4325,20 +4646,30 @@ window.CodeMirror = (function() {out += " ";return out;}- return function(builder, text, style, startStyle, endStyle) {- return inner(builder, text.replace(/ {3,}/, split), style, startStyle, endStyle);+ return function(builder, text, style, startStyle, endStyle, title) {+ return inner(builder, text.replace(/ {3,}/g, split), style, startStyle, endStyle, title);};}- function buildCollapsedSpan(builder, size, widget) {+ function buildCollapsedSpan(builder, size, marker, ignoreWidget) {+ var widget = !ignoreWidget && marker.replacedWith;if (widget) {- if (!builder.display) widget = widget.cloneNode(true);+ if (builder.copyWidgets) widget = widget.cloneNode(true);+ builder.pre.appendChild(widget);if (builder.measure) {- builder.measure[builder.pos] = size ? widget- : builder.pre.appendChild(zeroWidthElement(builder.cm.display.measure));+ if (size) {+ builder.measure[builder.pos] = widget;+ } else {+ var elt = zeroWidthElement(builder.cm.display.measure);+ if (marker.type == "bookmark" && !marker.insertLeft)+ builder.measure[builder.pos] = builder.pre.appendChild(elt);+ else if (builder.measure[builder.pos])+ return;+ else+ builder.measure[builder.pos] = builder.pre.insertBefore(elt, widget);+ }builder.measuredSomething = true;}- builder.pre.appendChild(widget);}builder.pos += size;}@@ -4349,17 +4680,17 @@ window.CodeMirror = (function() {var spans = line.markedSpans, allText = line.text, at = 0;if (!spans) {for (var i = 1; i < styles.length; i+=2)- builder.addToken(builder, allText.slice(at, at = styles[i]), styleToClass(styles[i+1]));+ builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder));return;}var len = allText.length, pos = 0, i = 1, text = "", style;- var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed;+ var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;for (;;) {if (nextChange == pos) { // Update current marker set- spanStyle = spanEndStyle = spanStartStyle = "";+ spanStyle = spanEndStyle = spanStartStyle = title = "";collapsed = null; nextChange = Infinity;- var foundBookmark = null;+ var foundBookmarks = [];for (var j = 0; j < spans.length; ++j) {var sp = spans[j], m = sp.marker;if (sp.from <= pos && (sp.to == null || sp.to > pos)) {@@ -4367,20 +4698,21 @@ window.CodeMirror = (function() {if (m.className) spanStyle += " " + m.className;if (m.startStyle && sp.from == pos) spanStartStyle += " " + m.startStyle;if (m.endStyle && sp.to == nextChange) spanEndStyle += " " + m.endStyle;- if (m.collapsed && (!collapsed || collapsed.marker.size < m.size))+ if (m.title && !title) title = m.title;+ if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))collapsed = sp;} else if (sp.from > pos && nextChange > sp.from) {nextChange = sp.from;}- if (m.type == "bookmark" && sp.from == pos && m.replacedWith)- foundBookmark = m.replacedWith;+ if (m.type == "bookmark" && sp.from == pos && m.replacedWith) foundBookmarks.push(m);}if (collapsed && (collapsed.from || 0) == pos) {buildCollapsedSpan(builder, (collapsed.to == null ? len : collapsed.to) - pos,- collapsed.from != null && collapsed.marker.replacedWith);+ collapsed.marker, collapsed.from == null);if (collapsed.to == null) return collapsed.marker.find();}- if (foundBookmark && !collapsed) buildCollapsedSpan(builder, 0, foundBookmark);+ if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)+ buildCollapsedSpan(builder, 0, foundBookmarks[j]);}if (pos >= len) break;@@ -4391,14 +4723,14 @@ window.CodeMirror = (function() {if (!collapsed) {var tokenText = end > upto ? text.slice(0, upto - pos) : text;builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,- spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "");+ spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", title);}if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}pos = end;spanStartStyle = "";}text = allText.slice(at, at = styles[i++]);- style = styleToClass(styles[i++]);+ style = interpretTokenStyle(styles[i++], builder);}}}@@ -4417,11 +4749,12 @@ window.CodeMirror = (function() {var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;// First adjust the line structure- if (from.ch == 0 && to.ch == 0 && lastText == "") {+ if (from.ch == 0 && to.ch == 0 && lastText == "" &&+ (!doc.cm || doc.cm.options.wholeLineUpdateBefore)) {// This is a whole-line replace. Treated specially to make// sure line objects move the way they are supposed to.for (var i = 0, e = text.length - 1, added = []; i < e; ++i)- added.push(makeLine(text[i], spansFor(i), estimateHeight));+ added.push(new Line(text[i], spansFor(i), estimateHeight));update(lastLine, lastLine.text, lastSpans);if (nlines) doc.remove(from.line, nlines);if (added.length) doc.insert(from.line, added);@@ -4430,8 +4763,8 @@ window.CodeMirror = (function() {update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);} else {for (var added = [], i = 1, e = text.length - 1; i < e; ++i)- added.push(makeLine(text[i], spansFor(i), estimateHeight));- added.push(makeLine(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));+ added.push(new Line(text[i], spansFor(i), estimateHeight));+ added.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));doc.insert(from.line + 1, added);}@@ -4442,7 +4775,7 @@ window.CodeMirror = (function() {update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);for (var i = 1, e = text.length - 1, added = []; i < e; ++i)- added.push(makeLine(text[i], spansFor(i), estimateHeight));+ added.push(new Line(text[i], spansFor(i), estimateHeight));if (nlines > 1) doc.remove(from.line + 1, nlines - 1);doc.insert(from.line + 1, added);}@@ -4585,7 +4918,7 @@ window.CodeMirror = (function() {if (!(this instanceof Doc)) return new Doc(text, mode, firstLine);if (firstLine == null) firstLine = 0;- BranchChunk.call(this, [new LeafChunk([makeLine("", null)])]);+ BranchChunk.call(this, [new LeafChunk([new Line("", null)])]);this.first = firstLine;this.scrollTop = this.scrollLeft = 0;this.cantEdit = false;@@ -4650,6 +4983,11 @@ window.CodeMirror = (function() {getLineHandle: function(line) {if (isLine(this, line)) return getLine(this, line);},getLineNumber: function(line) {return lineNo(line);},+ getLineHandleVisualStart: function(line) {+ if (typeof line == "number") line = getLine(this, line);+ return visualLine(this, line);+ },+lineCount: function() {return this.size;},firstLine: function() {return this.first;},lastLine: function() {return this.first + this.size - 1;},@@ -4671,11 +5009,11 @@ window.CodeMirror = (function() {if (extend) extendSelection(this, pos);else setSelection(this, pos, pos);}),- setSelection: docOperation(function(anchor, head) {- setSelection(this, clipPos(this, anchor), clipPos(this, head || anchor));+ setSelection: docOperation(function(anchor, head, bias) {+ setSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), bias);}),- extendSelection: docOperation(function(from, to) {- extendSelection(this, clipPos(this, from), to && clipPos(this, to));+ extendSelection: docOperation(function(from, to, bias) {+ extendSelection(this, clipPos(this, from), to && clipPos(this, to), bias);}),getSelection: function(lineSep) {return this.getRange(this.sel.from, this.sel.to, lineSep);},@@ -4694,10 +5032,11 @@ window.CodeMirror = (function() {clearHistory: function() {this.history = makeHistory(this.history.maxGeneration);},markClean: function() {- this.cleanGeneration = this.changeGeneration();+ this.cleanGeneration = this.changeGeneration(true);},- changeGeneration: function() {- this.history.lastOp = this.history.lastOrigin = null;+ changeGeneration: function(forceSplit) {+ if (forceSplit)+ this.history.lastOp = this.history.lastOrigin = null;return this.history.generation;},isClean: function (gen) {@@ -4719,7 +5058,8 @@ window.CodeMirror = (function() {},setBookmark: function(pos, options) {var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),- insertLeft: options && options.insertLeft};+ insertLeft: options && options.insertLeft,+ clearWhenEmpty: false};pos = clipPos(this, pos);return markText(this, pos, pos, realOpts, "bookmark");},@@ -4734,6 +5074,22 @@ window.CodeMirror = (function() {}return markers;},+ findMarks: function(from, to) {+ from = clipPos(this, from); to = clipPos(this, to);+ var found = [], lineNo = from.line;+ this.iter(from.line, to.line + 1, function(line) {+ var spans = line.markedSpans;+ if (spans) for (var i = 0; i < spans.length; i++) {+ var span = spans[i];+ if (!(lineNo == from.line && from.ch > span.to ||+ span.from == null && lineNo != from.line||+ lineNo == to.line && span.from > to.ch))+ found.push(span.marker.parent || span.marker);+ }+ ++lineNo;+ });+ return found;+ },getAllMarks: function() {var markers = [];this.iter(function(line) {@@ -4820,6 +5176,8 @@ window.CodeMirror = (function() {return function() {return method.apply(this.doc, arguments);};})(Doc.prototype[prop]);+ eventMixin(Doc);+function linkedDocs(doc, f, sharedHistOnly) {function propagate(doc, skip, sharedHist) {if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) {@@ -4963,7 +5321,8 @@ window.CodeMirror = (function() {}function historyChangeFromChange(doc, change) {- var histChange = {from: change.from, to: changeEnd(change), text: getBetween(doc, change.from, change.to)};+ var from = { line: change.from.line, ch: change.from.ch };+ var histChange = {from: from, to: changeEnd(change), text: getBetween(doc, change.from, change.to)};attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);return histChange;@@ -4997,13 +5356,15 @@ window.CodeMirror = (function() {anchorBefore: doc.sel.anchor, headBefore: doc.sel.head,anchorAfter: selAfter.anchor, headAfter: selAfter.head};hist.done.push(cur);- hist.generation = ++hist.maxGeneration;while (hist.done.length > hist.undoDepth)hist.done.shift();}+ hist.generation = ++hist.maxGeneration;hist.lastTime = time;hist.lastOp = opId;hist.lastOrigin = change.origin;++ if (!last) signal(doc, "historyAdded");}function removeClearedSpans(spans) {@@ -5183,9 +5544,9 @@ window.CodeMirror = (function() {delayedCallbacks.push(bnd(arr[i]));}- function signalDOMEvent(cm, e) {- signal(cm, e.type, cm, e);- return e_defaultPrevented(e);+ function signalDOMEvent(cm, e, override) {+ signal(cm, override || e.type, cm, e);+ return e_defaultPrevented(e) || e.codemirrorIgnore;}function fireDelayed() {@@ -5202,6 +5563,11 @@ window.CodeMirror = (function() {CodeMirror.on = on; CodeMirror.off = off; CodeMirror.signal = signal;+ function eventMixin(ctor) {+ ctor.prototype.on = function(type, f) {on(this, type, f);};+ ctor.prototype.off = function(type, f) {off(this, type, f);};+ }+// MISC UTILITIES// Number of pixels added to scroller and sizer to hide scrollbar@@ -5280,7 +5646,7 @@ window.CodeMirror = (function() {return function(){return f.apply(null, args);};}- var nonASCIISingleCaseWordChar = /[\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;+ var nonASCIISingleCaseWordChar = /[\u00df\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function isWordChar(ch) {return /\w/.test(ch) || ch > "\x80" &&(ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch));@@ -5291,7 +5657,8 @@ window.CodeMirror = (function() {return true;}- var isExtendingChar = /[\u0300-\u036F\u0483-\u0487\u0488-\u0489\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\uA66F\uA670-\uA672\uA674-\uA67D\uA69F\udc00-\udfff]/;+ var extendingChars = /[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;+ function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch); }// DOM UTILITIES@@ -5353,11 +5720,18 @@ window.CodeMirror = (function() {spanAffectsWrapping = function(str, i) {return /\-[^ \-?]|\?[^ !\'\"\),.\-\/:;\?\]\}]/.test(str.slice(i - 1, i + 1));};+ else if (webkit && /Chrome\/(?:29|[3-9]\d|\d\d\d)\./.test(navigator.userAgent))+ spanAffectsWrapping = function(str, i) {+ var code = str.charCodeAt(i - 1);+ return code >= 8208 && code <= 8212;+ };else if (webkit)spanAffectsWrapping = function(str, i) {- if (i > 1 && str.charCodeAt(i - 1) == 45 && /\w/.test(str.charAt(i - 2)) && /[^\-?\.]/.test(str.charAt(i)))- return true;- return /[~!#%&*)=+}\]|\"\.>,:;][({[<]|-[^\-?\.\u2010-\u201f\u2026]|\?[\w~`@#$%\^&*(_=+{[|><]|…[\w~`@#$%\^&*(_=+{[><]/.test(str.slice(i - 1, i + 1));+ if (i > 1 && str.charCodeAt(i - 1) == 45) {+ if (/\w/.test(str.charAt(i - 2)) && /[^\-?\.]/.test(str.charAt(i))) return true;+ if (i > 2 && /[\d\.,]/.test(str.charAt(i - 2)) && /[\d\.,]/.test(str.charAt(i))) return false;+ }+ return /[~!#%&*)=+}\]\\|\"\.>,:;][({[<]|-[^\-?\.\u2010-\u201f\u2026]|\?[\w~`@#$%\^&*(_=+{[|><]|\u2026[\w~`@#$%\^&*(_=+{[><]/.test(str.slice(i - 1, i + 1));};var knownScrollbarWidth;@@ -5425,14 +5799,14 @@ window.CodeMirror = (function() {var keyNames = {3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt",19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End",36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert",- 46: "Delete", 59: ";", 91: "Mod", 92: "Mod", 93: "Mod", 109: "-", 107: "=", 127: "Delete",- 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\",- 221: "]", 222: "'", 63276: "PageUp", 63277: "PageDown", 63275: "End", 63273: "Home",- 63234: "Left", 63232: "Up", 63235: "Right", 63233: "Down", 63302: "Insert", 63272: "Delete"};+ 46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod", 107: "=", 109: "-", 127: "Delete",+ 173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\",+ 221: "]", 222: "'", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete",+ 63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert"};CodeMirror.keyNames = keyNames;(function() {// Number keys- for (var i = 0; i < 10; i++) keyNames[i + 48] = String(i);+ for (var i = 0; i < 10; i++) keyNames[i + 48] = keyNames[i + 96] = String(i);// Alphabetic keysfor (var i = 65; i <= 90; i++) keyNames[i] = String.fromCharCode(i);// Function keys@@ -5443,11 +5817,15 @@ window.CodeMirror = (function() {function iterateBidiSections(order, from, to, f) {if (!order) return f(from, to, "ltr");+ var found = false;for (var i = 0; i < order.length; ++i) {var part = order[i];- if (part.from < to && part.to > from || from == to && part.to == from)+ if (part.from < to && part.to > from || from == to && part.to == from) {f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr");+ found = true;+ }}+ if (!found) f(from, to, "ltr");}function bidiLeft(part) { return part.level % 2 ? part.to : part.from; }@@ -5485,29 +5863,29 @@ window.CodeMirror = (function() {}var bidiOther;function getBidiPartAt(order, pos) {+ bidiOther = null;for (var i = 0, found; i < order.length; ++i) {var cur = order[i];- if (cur.from < pos && cur.to > pos) { bidiOther = null; return i; }- if (cur.from == pos || cur.to == pos) {+ if (cur.from < pos && cur.to > pos) return i;+ if ((cur.from == pos || cur.to == pos)) {if (found == null) {found = i;} else if (compareBidiLevel(order, cur.level, order[found].level)) {- bidiOther = found;+ if (cur.from != cur.to) bidiOther = found;return i;} else {- bidiOther = i;+ if (cur.from != cur.to) bidiOther = i;return found;}}}- bidiOther = null;return found;}function moveInLine(line, pos, dir, byUnit) {if (!byUnit) return pos + dir;do pos += dir;- while (pos > 0 && isExtendingChar.test(line.text.charAt(pos)));+ while (pos > 0 && isExtendingChar(line.text.charAt(pos)));return pos;}@@ -5542,7 +5920,7 @@ window.CodeMirror = (function() {function moveLogically(line, start, dir, byUnit) {var target = start + dir;- if (byUnit) while (target > 0 && isExtendingChar.test(line.text.charAt(target))) target += dir;+ if (byUnit) while (target > 0 && isExtendingChar(line.text.charAt(target))) target += dir;return target < 0 || target > line.text.length ? null : target;}@@ -5634,7 +6012,7 @@ window.CodeMirror = (function() {if (type == ",") types[i] = "N";else if (type == "%") {for (var end = i + 1; end < len && types[end] == "%"; ++end) {}- var replace = (i && types[i-1] == "!") || (end < len - 1 && types[end] == "1") ? "1" : "N";+ var replace = (i && types[i-1] == "!") || (end < len && types[end] == "1") ? "1" : "N";for (var j = i; j < end; ++j) types[j] = replace;i = end - 1;}@@ -5659,7 +6037,7 @@ window.CodeMirror = (function() {if (isNeutral.test(types[i])) {for (var end = i + 1; end < len && isNeutral.test(types[end]); ++end) {}var before = (i ? types[i-1] : outerType) == "L";- var after = (end < len - 1 ? types[end] : outerType) == "L";+ var after = (end < len ? types[end] : outerType) == "L";var replace = before || after ? "L" : "R";for (var j = i; j < end; ++j) types[j] = replace;i = end - 1;@@ -5709,7 +6087,7 @@ window.CodeMirror = (function() {// THE END- CodeMirror.version = "3.14.0";+ CodeMirror.version = "3.22.0";return CodeMirror;})();diff --git a/data/ext/editorText/codemirror/mode/apl/index.html b/data/ext/editorText/codemirror/mode/apl/index.htmlindex 119ff17f1..f8282ac42 100644--- a/data/ext/editorText/codemirror/mode/apl/index.html+++ b/data/ext/editorText/codemirror/mode/apl/index.html@@ -1,20 +1,32 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: APL mode</title>- <link rel="stylesheet" href="../../doc/docs.css">- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="../../addon/edit/matchbrackets.js"></script>- <script src="./apl.js"></script>- <style>++<title>CodeMirror: APL mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="../../addon/edit/matchbrackets.js"></script>+<script src="./apl.js"></script>+<style>.CodeMirror { border: 2px inset #dee; }</style>- </head>- <body>- <h1>CodeMirror: APL mode</h1>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">APL</a>+ </ul>+</div>+<article>+<h2>APL mode</h2><form><textarea id="code" name="code">⍝ Conway's game of life@@ -57,5 +69,4 @@ gen ← {' #'[(life ⍣ ⍵) board]}have popups etc.</p><p><strong>MIME types defined:</strong> <code>text/apl</code> (APL code)</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/asterisk/index.html b/data/ext/editorText/codemirror/mode/asterisk/index.htmlindex 0a796a011..6abdecb50 100644--- a/data/ext/editorText/codemirror/mode/asterisk/index.html+++ b/data/ext/editorText/codemirror/mode/asterisk/index.html@@ -1,20 +1,33 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Asterisk dialplan mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="asterisk.js"></script>- <style>++<title>CodeMirror: Asterisk dialplan mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="asterisk.js"></script>+<style>.CodeMirror {border: 1px solid #999;}.cm-s-default span.cm-arrow { color: red; }</style>- <link rel="stylesheet" href="../../doc/docs.css">- </head>- <body>- <h1>CodeMirror: Asterisk dialplan mode</h1>- <form><textarea id="code" name="code">+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Asterisk dialplan</a>+ </ul>+</div>++<article>+<h2>Asterisk dialplan mode</h2>+<form><textarea id="code" name="code">; extensions.conf - the Asterisk dial plan;@@ -138,5 +151,4 @@ exten => 8500,n,Goto(s,6)<p><strong>MIME types defined:</strong> <code>text/x-asterisk</code>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/clike/clike.js b/data/ext/editorText/codemirror/mode/clike/clike.jsindex 3fcc1a757..4e4988dd8 100644--- a/data/ext/editorText/codemirror/mode/clike/clike.js+++ b/data/ext/editorText/codemirror/mode/clike/clike.js@@ -158,7 +158,8 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {electricChars: "{}",blockCommentStart: "/*",blockCommentEnd: "*/",- lineComment: "//"+ lineComment: "//",+ fold: "brace"};});@@ -202,18 +203,34 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {return "string";}- function mimes(ms, mode) {- for (var i = 0; i < ms.length; ++i) CodeMirror.defineMIME(ms[i], mode);+ function def(mimes, mode) {+ var words = [];+ function add(obj) {+ if (obj) for (var prop in obj) if (obj.hasOwnProperty(prop))+ words.push(prop);+ }+ add(mode.keywords);+ add(mode.builtin);+ add(mode.atoms);+ if (words.length) {+ mode.helperType = mimes[0];+ CodeMirror.registerHelper("hintWords", mimes[0], words);+ }++ for (var i = 0; i < mimes.length; ++i)+ CodeMirror.defineMIME(mimes[i], mode);}- mimes(["text/x-csrc", "text/x-c", "text/x-chdr"], {+ def(["text/x-csrc", "text/x-c", "text/x-chdr"], {name: "clike",keywords: words(cKeywords),blockKeywords: words("case do else for if switch while struct"),atoms: words("null"),- hooks: {"#": cppHook}+ hooks: {"#": cppHook},+ modeProps: {fold: ["brace", "include"]}});- mimes(["text/x-c++src", "text/x-c++hdr"], {++ def(["text/x-c++src", "text/x-c++hdr"], {name: "clike",keywords: words(cKeywords + " asm dynamic_cast namespace reinterpret_cast try bool explicit new " +"static_cast typeid catch operator template typename class friend private " +@@ -221,7 +238,8 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {"wchar_t"),blockKeywords: words("catch class do else finally for if struct switch try while"),atoms: words("true false null"),- hooks: {"#": cppHook}+ hooks: {"#": cppHook},+ modeProps: {fold: ["brace", "include"]}});CodeMirror.defineMIME("text/x-java", {name: "clike",@@ -237,7 +255,8 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {stream.eatWhile(/[\w\$_]/);return "meta";}- }+ },+ modeProps: {fold: ["brace", "import"]}});CodeMirror.defineMIME("text/x-csharp", {name: "clike",@@ -302,7 +321,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {}}});- mimes(["x-shader/x-vertex", "x-shader/x-fragment"], {+ def(["x-shader/x-vertex", "x-shader/x-fragment"], {name: "clike",keywords: words("float int bool void " +"vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 " +@@ -356,6 +375,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {"gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits " +"gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits " +"gl_MaxDrawBuffers"),- hooks: {"#": cppHook}+ hooks: {"#": cppHook},+ modeProps: {fold: ["brace", "include"]}});}());diff --git a/data/ext/editorText/codemirror/mode/clike/index.html b/data/ext/editorText/codemirror/mode/clike/index.htmlindex 5f90394d9..93bd718a0 100644--- a/data/ext/editorText/codemirror/mode/clike/index.html+++ b/data/ext/editorText/codemirror/mode/clike/index.html@@ -1,19 +1,32 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: C-like mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="../../addon/edit/matchbrackets.js"></script>- <script src="clike.js"></script>- <link rel="stylesheet" href="../../doc/docs.css">- <style>.CodeMirror {border: 2px inset #dee;}</style>- </head>- <body>- <h1>CodeMirror: C-like mode</h1>--<form><textarea id="code" name="code">++<title>CodeMirror: C-like mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="../../addon/edit/matchbrackets.js"></script>+<script src="clike.js"></script>+<style>.CodeMirror {border: 2px inset #dee;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">C-like</a>+ </ul>+</div>++<article>+<h2>C-like mode</h2>++<div><textarea id="c-code">/* C demo code */#include <zmq.h>@@ -79,14 +92,94 @@ void* zmq_thread_init(void* zmq_context, int signal_fd) {pthread_detach(thread);return context;}-</textarea></form>+</textarea></div>++<h2>C++ example</h2>++<div><textarea id="cpp-code">+#include <iostream>+#include "mystuff/util.h"++namespace {+enum Enum {+ VAL1, VAL2, VAL3+};++int Helper(const MyType& param) {+ return 0;+}+} // namespace++class ForwardDec;++template <class T, class V>+class Class : public BaseClass {+ const MyType<T, V> member_;++ public:+ const MyType<T, V>& Method() const {+ return member_;+ }++ void Method2(MyType<T, V>* value);+}++template <class T, class V>+void Class::Method2(MyType<T, V>* value) {+ std::out << 1 >> method();+ value->Method3(member_);+ member_ = value;+}+</textarea></div>++<h2>Java example</h2>++<div><textarea id="java-code">+import com.demo.util.MyType;+import com.demo.util.MyInterface;++public enum Enum {+ VAL1, VAL2, VAL3+}++public class Class<T, V> implements MyInterface {+ public static final MyType<T, V> member;++ private class InnerClass {+ public int zero() {+ return 0;+ }+ }++ @Override+ public MyType method() {+ return member;+ }++ public void method2(MyType<T, V> value) {+ method();+ value.method3();+ member = value;+ }+}+</textarea></div><script>- var editor = CodeMirror.fromTextArea(document.getElementById("code"), {+ var cEditor = CodeMirror.fromTextArea(document.getElementById("c-code"), {lineNumbers: true,matchBrackets: true,mode: "text/x-csrc"});+ var cppEditor = CodeMirror.fromTextArea(document.getElementById("cpp-code"), {+ lineNumbers: true,+ matchBrackets: true,+ mode: "text/x-c++src"+ });+ var javaEditor = CodeMirror.fromTextArea(document.getElementById("java-code"), {+ lineNumbers: true,+ matchBrackets: true,+ mode: "text/x-java"+ });</script><p>Simple mode that tries to handle C-like languages as well as it@@ -99,5 +192,4 @@ void* zmq_thread_init(void* zmq_context, int signal_fd) {(C code), <code>text/x-c++src</code> (C++code), <code>text/x-java</code> (Javacode), <code>text/x-csharp</code> (C#).</p>- </body>-</html>+</article>diff --git a/data/ext/editorText/codemirror/mode/clike/scala.html b/data/ext/editorText/codemirror/mode/clike/scala.htmlindex f3c7eea49..e9acc049b 100644--- a/data/ext/editorText/codemirror/mode/clike/scala.html+++ b/data/ext/editorText/codemirror/mode/clike/scala.html@@ -1,29 +1,30 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: C-like mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <link rel="stylesheet" href="../../theme/ambiance.css">- <script src="../../lib/codemirror.js"></script>- <script src="../../addon/edit/matchbrackets.js"></script>- <script src="clike.js"></script>- <link rel="stylesheet" href="../../doc/docs.css">- <style>- body- {- margin: 0;- padding: 0;- max-width:inherit;- height: 100%;- }- html, form, .CodeMirror, .CodeMirror-scroll- {- height: 100%;- }- </style>- </head>- <body>++<title>CodeMirror: Scala mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<link rel="stylesheet" href="../../theme/ambiance.css">+<script src="../../lib/codemirror.js"></script>+<script src="../../addon/edit/matchbrackets.js"></script>+<script src="clike.js"></script>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Scala</a>+ </ul>+</div>++<article>+<h2>Scala mode</h2><form><textarea id="code" name="code">@@ -763,5 +764,4 @@mode: "text/x-scala"});</script>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/clojure/clojure.js b/data/ext/editorText/codemirror/mode/clojure/clojure.jsindex ee22a12fe..a45a95de5 100644--- a/data/ext/editorText/codemirror/mode/clojure/clojure.js+++ b/data/ext/editorText/codemirror/mode/clojure/clojure.js@@ -2,10 +2,11 @@* Author: Hans Engel* Branched from CodeMirror's Scheme mode (by Koh Zi Han, based on implementation by Koh Zi Chun)*/-CodeMirror.defineMode("clojure", function () {+CodeMirror.defineMode("clojure", function (options) {var BUILTIN = "builtin", COMMENT = "comment", STRING = "string", CHARACTER = "string-2",ATOM = "atom", NUMBER = "number", BRACKET = "bracket", KEYWORD = "keyword";- var INDENT_WORD_SKIP = 2;+ var INDENT_WORD_SKIP = options.indentUnit || 2;+ var NORMAL_INDENT_UNIT = options.indentUnit || 2;function makeKeywords(str) {var obj = {}, words = str.split(" ");@@ -44,7 +45,7 @@ CodeMirror.defineMode("clojure", function () {sign: /[+-]/,exponent: /e/i,keyword_char: /[^\s\(\[\;\)\]]/,- symbol: /[\w*+!\-\._?:\/]/+ symbol: /[\w*+!\-\._?:<>\/]/};function stateStack(indent, type, prev) { // represents a state stack object@@ -179,8 +180,8 @@ CodeMirror.defineMode("clojure", function () {stream.eatSpace();if (stream.eol() || stream.peek() == ";") {// nothing significant after- // we restart indentation 1 space after- pushStack(state, indentTemp + 1, ch);+ // we restart indentation the user defined spaces after+ pushStack(state, indentTemp + NORMAL_INDENT_UNIT, ch);} else {pushStack(state, indentTemp + stream.current().length, ch); // else we match}diff --git a/data/ext/editorText/codemirror/mode/clojure/index.html b/data/ext/editorText/codemirror/mode/clojure/index.htmlindex bfe6fc955..5a50c566f 100644--- a/data/ext/editorText/codemirror/mode/clojure/index.html+++ b/data/ext/editorText/codemirror/mode/clojure/index.html@@ -1,17 +1,30 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Clojure mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="clojure.js"></script>- <style>.CodeMirror {background: #f8f8f8;}</style>- <link rel="stylesheet" href="../../doc/docs.css">- </head>- <body>- <h1>CodeMirror: Clojure mode</h1>- <form><textarea id="code" name="code">++<title>CodeMirror: Clojure mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="clojure.js"></script>+<style>.CodeMirror {background: #f8f8f8;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Clojure</a>+ </ul>+</div>++<article>+<h2>Clojure mode</h2>+<form><textarea id="code" name="code">; Conway's Game of Life, based on the work of:;; Laurent Petit https://gist.github.com/1200343;; Christophe Grand http://clj-me.cgrand.net/2011/08/19/conways-game-of-life@@ -72,5 +85,4 @@<p><strong>MIME types defined:</strong> <code>text/x-clojure</code>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/cobol/index.html b/data/ext/editorText/codemirror/mode/cobol/index.htmlindex 71cc2fa15..326e398b6 100644--- a/data/ext/editorText/codemirror/mode/cobol/index.html+++ b/data/ext/editorText/codemirror/mode/cobol/index.html@@ -1,35 +1,36 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: COBOL mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="../../addon/edit/matchbrackets.js"></script>- <script src="cobol.js"></script>- <link rel="stylesheet" href="../../theme/neat.css">- <link rel="stylesheet" href="../../theme/elegant.css">- <link rel="stylesheet" href="../../theme/erlang-dark.css">- <link rel="stylesheet" href="../../theme/night.css">- <link rel="stylesheet" href="../../theme/monokai.css">- <link rel="stylesheet" href="../../theme/cobalt.css">- <link rel="stylesheet" href="../../theme/eclipse.css">- <link rel="stylesheet" href="../../theme/rubyblue.css">- <link rel="stylesheet" href="../../theme/lesser-dark.css">- <link rel="stylesheet" href="../../theme/xq-dark.css">- <link rel="stylesheet" href="../../theme/xq-light.css">- <link rel="stylesheet" href="../../theme/ambiance.css">- <link rel="stylesheet" href="../../theme/blackboard.css">- <link rel="stylesheet" href="../../theme/vibrant-ink.css">- <link rel="stylesheet" href="../../theme/solarized.css">- <link rel="stylesheet" href="../../theme/twilight.css">- <link rel="stylesheet" href="../../theme/midnight.css">- <link rel="stylesheet" href="../../addon/dialog/dialog.css">- <script src="../../addon/selection/active-line.js"></script>- <script src="../../addon/search/search.js"></script>- <script src="../../addon/dialog/dialog.js"></script>- <script src="../../addon/search/searchcursor.js"></script>- <style>++<title>CodeMirror: COBOL mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<link rel="stylesheet" href="../../theme/neat.css">+<link rel="stylesheet" href="../../theme/elegant.css">+<link rel="stylesheet" href="../../theme/erlang-dark.css">+<link rel="stylesheet" href="../../theme/night.css">+<link rel="stylesheet" href="../../theme/monokai.css">+<link rel="stylesheet" href="../../theme/cobalt.css">+<link rel="stylesheet" href="../../theme/eclipse.css">+<link rel="stylesheet" href="../../theme/rubyblue.css">+<link rel="stylesheet" href="../../theme/lesser-dark.css">+<link rel="stylesheet" href="../../theme/xq-dark.css">+<link rel="stylesheet" href="../../theme/xq-light.css">+<link rel="stylesheet" href="../../theme/ambiance.css">+<link rel="stylesheet" href="../../theme/blackboard.css">+<link rel="stylesheet" href="../../theme/vibrant-ink.css">+<link rel="stylesheet" href="../../theme/solarized.css">+<link rel="stylesheet" href="../../theme/twilight.css">+<link rel="stylesheet" href="../../theme/midnight.css">+<link rel="stylesheet" href="../../addon/dialog/dialog.css">+<script src="../../lib/codemirror.js"></script>+<script src="../../addon/edit/matchbrackets.js"></script>+<script src="cobol.js"></script>+<script src="../../addon/selection/active-line.js"></script>+<script src="../../addon/search/search.js"></script>+<script src="../../addon/dialog/dialog.js"></script>+<script src="../../addon/search/searchcursor.js"></script>+<style>.CodeMirror {border: 1px solid #eee;font-size : 20px;@@ -37,8 +38,23 @@}.CodeMirror-activeline-background {background: #555555 !important;}</style>- </head>- <body>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">COBOL</a>+ </ul>+</div>++<article>+<h2>COBOL mode</h2>+<p> Select Theme <select onchange="selectTheme()" id="selectTheme"><option>default</option><option>ambiance</option>@@ -191,5 +207,4 @@}}</script>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/coffeescript/LICENSE b/data/ext/editorText/codemirror/mode/coffeescript/LICENSEdeleted file mode 100644index 977e284e0..000000000--- a/data/ext/editorText/codemirror/mode/coffeescript/LICENSE+++ /dev/null@@ -1,22 +0,0 @@-The MIT License--Copyright (c) 2011 Jeff Pickhardt-Modified from the Python CodeMirror mode, Copyright (c) 2010 Timothy Farrell--Permission is hereby granted, free of charge, to any person obtaining a copy-of this software and associated documentation files (the "Software"), to deal-in the Software without restriction, including without limitation the rights-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell-copies of the Software, and to permit persons to whom the Software is-furnished to do so, subject to the following conditions:--The above copyright notice and this permission notice shall be included in-all copies or substantial portions of the Software.--THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN-THE SOFTWARE.\ No newline at end of filediff --git a/data/ext/editorText/codemirror/mode/coffeescript/coffeescript.js b/data/ext/editorText/codemirror/mode/coffeescript/coffeescript.jsindex 509d9207b..0e9e6352f 100644--- a/data/ext/editorText/codemirror/mode/coffeescript/coffeescript.js+++ b/data/ext/editorText/codemirror/mode/coffeescript/coffeescript.js@@ -2,346 +2,352 @@* Link to the project's GitHub page:* https://github.com/pickhardt/coffeescript-codemirror-mode*/-CodeMirror.defineMode('coffeescript', function(conf) {- var ERRORCLASS = 'error';-- function wordRegexp(words) {- return new RegExp("^((" + words.join(")|(") + "))\\b");- }-- var singleOperators = new RegExp("^[\\+\\-\\*/%&|\\^~<>!\?]");- var singleDelimiters = new RegExp('^[\\(\\)\\[\\]\\{\\},:`=;\\.]');- var doubleOperators = new RegExp("^((\->)|(\=>)|(\\+\\+)|(\\+\\=)|(\\-\\-)|(\\-\\=)|(\\*\\*)|(\\*\\=)|(\\/\\/)|(\\/\\=)|(==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//))");- var doubleDelimiters = new RegExp("^((\\.\\.)|(\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))");- var tripleDelimiters = new RegExp("^((\\.\\.\\.)|(//=)|(>>=)|(<<=)|(\\*\\*=))");- var identifiers = new RegExp("^[_A-Za-z$][_A-Za-z$0-9]*");- var properties = new RegExp("^(@|this\.)[_A-Za-z$][_A-Za-z$0-9]*");-- var wordOperators = wordRegexp(['and', 'or', 'not',- 'is', 'isnt', 'in',- 'instanceof', 'typeof']);- var indentKeywords = ['for', 'while', 'loop', 'if', 'unless', 'else',- 'switch', 'try', 'catch', 'finally', 'class'];- var commonKeywords = ['break', 'by', 'continue', 'debugger', 'delete',- 'do', 'in', 'of', 'new', 'return', 'then',- 'this', 'throw', 'when', 'until'];-- var keywords = wordRegexp(indentKeywords.concat(commonKeywords));-- indentKeywords = wordRegexp(indentKeywords);--- var stringPrefixes = new RegExp("^('{3}|\"{3}|['\"])");- var regexPrefixes = new RegExp("^(/{3}|/)");- var commonConstants = ['Infinity', 'NaN', 'undefined', 'null', 'true', 'false', 'on', 'off', 'yes', 'no'];- var constants = wordRegexp(commonConstants);-- // Tokenizers- function tokenBase(stream, state) {- // Handle scope changes- if (stream.sol()) {- var scopeOffset = state.scopes[0].offset;- if (stream.eatSpace()) {- var lineOffset = stream.indentation();- if (lineOffset > scopeOffset) {- return 'indent';- } else if (lineOffset < scopeOffset) {- return 'dedent';- }- return null;- } else {- if (scopeOffset > 0) {- dedent(stream, state);- }- }+CodeMirror.defineMode("coffeescript", function(conf) {+ var ERRORCLASS = "error";++ function wordRegexp(words) {+ return new RegExp("^((" + words.join(")|(") + "))\\b");+ }++ var operators = /^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?)/;+ var delimiters = /^(?:[()\[\]{},:`=;]|\.\.?\.?)/;+ var identifiers = /^[_A-Za-z$][_A-Za-z$0-9]*/;+ var properties = /^(@|this\.)[_A-Za-z$][_A-Za-z$0-9]*/;++ var wordOperators = wordRegexp(["and", "or", "not",+ "is", "isnt", "in",+ "instanceof", "typeof"]);+ var indentKeywords = ["for", "while", "loop", "if", "unless", "else",+ "switch", "try", "catch", "finally", "class"];+ var commonKeywords = ["break", "by", "continue", "debugger", "delete",+ "do", "in", "of", "new", "return", "then",+ "this", "throw", "when", "until"];++ var keywords = wordRegexp(indentKeywords.concat(commonKeywords));++ indentKeywords = wordRegexp(indentKeywords);+++ var stringPrefixes = /^('{3}|\"{3}|['\"])/;+ var regexPrefixes = /^(\/{3}|\/)/;+ var commonConstants = ["Infinity", "NaN", "undefined", "null", "true", "false", "on", "off", "yes", "no"];+ var constants = wordRegexp(commonConstants);++ // Tokenizers+ function tokenBase(stream, state) {+ // Handle scope changes+ if (stream.sol()) {+ if (state.scope.align === null) state.scope.align = false;+ var scopeOffset = state.scope.offset;+ if (stream.eatSpace()) {+ var lineOffset = stream.indentation();+ if (lineOffset > scopeOffset && state.scope.type == "coffee") {+ return "indent";+ } else if (lineOffset < scopeOffset) {+ return "dedent";}- if (stream.eatSpace()) {- return null;- }-- var ch = stream.peek();-- // Handle docco title comment (single line)- if (stream.match("####")) {- stream.skipToEnd();- return 'comment';- }-- // Handle multi line comments- if (stream.match("###")) {- state.tokenize = longComment;- return state.tokenize(stream, state);+ return null;+ } else {+ if (scopeOffset > 0) {+ dedent(stream, state);}+ }+ }+ if (stream.eatSpace()) {+ return null;+ }- // Single line comment- if (ch === '#') {- stream.skipToEnd();- return 'comment';- }+ var ch = stream.peek();- // Handle number literals- if (stream.match(/^-?[0-9\.]/, false)) {- var floatLiteral = false;- // Floats- if (stream.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)) {- floatLiteral = true;- }- if (stream.match(/^-?\d+\.\d*/)) {- floatLiteral = true;- }- if (stream.match(/^-?\.\d+/)) {- floatLiteral = true;- }-- if (floatLiteral) {- // prevent from getting extra . on 1..- if (stream.peek() == "."){- stream.backUp(1);- }- return 'number';- }- // Integers- var intLiteral = false;- // Hex- if (stream.match(/^-?0x[0-9a-f]+/i)) {- intLiteral = true;- }- // Decimal- if (stream.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)) {- intLiteral = true;- }- // Zero by itself with no other piece of number.- if (stream.match(/^-?0(?![\dx])/i)) {- intLiteral = true;- }- if (intLiteral) {- return 'number';- }- }+ // Handle docco title comment (single line)+ if (stream.match("####")) {+ stream.skipToEnd();+ return "comment";+ }- // Handle strings- if (stream.match(stringPrefixes)) {- state.tokenize = tokenFactory(stream.current(), 'string');- return state.tokenize(stream, state);- }- // Handle regex literals- if (stream.match(regexPrefixes)) {- if (stream.current() != '/' || stream.match(/^.*\//, false)) { // prevent highlight of division- state.tokenize = tokenFactory(stream.current(), 'string-2');- return state.tokenize(stream, state);- } else {- stream.backUp(1);- }- }+ // Handle multi line comments+ if (stream.match("###")) {+ state.tokenize = longComment;+ return state.tokenize(stream, state);+ }- // Handle operators and delimiters- if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters)) {- return 'punctuation';- }- if (stream.match(doubleOperators)- || stream.match(singleOperators)- || stream.match(wordOperators)) {- return 'operator';- }- if (stream.match(singleDelimiters)) {- return 'punctuation';- }+ // Single line comment+ if (ch === "#") {+ stream.skipToEnd();+ return "comment";+ }- if (stream.match(constants)) {- return 'atom';+ // Handle number literals+ if (stream.match(/^-?[0-9\.]/, false)) {+ var floatLiteral = false;+ // Floats+ if (stream.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)) {+ floatLiteral = true;+ }+ if (stream.match(/^-?\d+\.\d*/)) {+ floatLiteral = true;+ }+ if (stream.match(/^-?\.\d+/)) {+ floatLiteral = true;+ }++ if (floatLiteral) {+ // prevent from getting extra . on 1..+ if (stream.peek() == "."){+ stream.backUp(1);}+ return "number";+ }+ // Integers+ var intLiteral = false;+ // Hex+ if (stream.match(/^-?0x[0-9a-f]+/i)) {+ intLiteral = true;+ }+ // Decimal+ if (stream.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)) {+ intLiteral = true;+ }+ // Zero by itself with no other piece of number.+ if (stream.match(/^-?0(?![\dx])/i)) {+ intLiteral = true;+ }+ if (intLiteral) {+ return "number";+ }+ }- if (stream.match(keywords)) {- return 'keyword';- }+ // Handle strings+ if (stream.match(stringPrefixes)) {+ state.tokenize = tokenFactory(stream.current(), false, "string");+ return state.tokenize(stream, state);+ }+ // Handle regex literals+ if (stream.match(regexPrefixes)) {+ if (stream.current() != "/" || stream.match(/^.*\//, false)) { // prevent highlight of division+ state.tokenize = tokenFactory(stream.current(), true, "string-2");+ return state.tokenize(stream, state);+ } else {+ stream.backUp(1);+ }+ }- if (stream.match(identifiers)) {- return 'variable';- }+ // Handle operators and delimiters+ if (stream.match(operators) || stream.match(wordOperators)) {+ return "operator";+ }+ if (stream.match(delimiters)) {+ return "punctuation";+ }- if (stream.match(properties)) {- return 'property';- }+ if (stream.match(constants)) {+ return "atom";+ }- // Handle non-detected items- stream.next();- return ERRORCLASS;+ if (stream.match(keywords)) {+ return "keyword";}- function tokenFactory(delimiter, outclass) {- var singleline = delimiter.length == 1;- return function(stream, state) {- while (!stream.eol()) {- stream.eatWhile(/[^'"\/\\]/);- if (stream.eat('\\')) {- stream.next();- if (singleline && stream.eol()) {- return outclass;- }- } else if (stream.match(delimiter)) {- state.tokenize = tokenBase;- return outclass;- } else {- stream.eat(/['"\/]/);- }- }- if (singleline) {- if (conf.mode.singleLineStringErrors) {- outclass = ERRORCLASS;- } else {- state.tokenize = tokenBase;- }- }- return outclass;- };+ if (stream.match(identifiers)) {+ return "variable";}- function longComment(stream, state) {- while (!stream.eol()) {- stream.eatWhile(/[^#]/);- if (stream.match("###")) {- state.tokenize = tokenBase;- break;- }- stream.eatWhile("#");- }- return "comment";+ if (stream.match(properties)) {+ return "property";}- function indent(stream, state, type) {- type = type || 'coffee';- var indentUnit = 0;- if (type === 'coffee') {- for (var i = 0; i < state.scopes.length; i++) {- if (state.scopes[i].type === 'coffee') {- indentUnit = state.scopes[i].offset + conf.indentUnit;- break;- }- }+ // Handle non-detected items+ stream.next();+ return ERRORCLASS;+ }++ function tokenFactory(delimiter, singleline, outclass) {+ return function(stream, state) {+ while (!stream.eol()) {+ stream.eatWhile(/[^'"\/\\]/);+ if (stream.eat("\\")) {+ stream.next();+ if (singleline && stream.eol()) {+ return outclass;+ }+ } else if (stream.match(delimiter)) {+ state.tokenize = tokenBase;+ return outclass;} else {- indentUnit = stream.column() + stream.current().length;+ stream.eat(/['"\/]/);}- state.scopes.unshift({- offset: indentUnit,- type: type- });- }-- function dedent(stream, state) {- if (state.scopes.length == 1) return;- if (state.scopes[0].type === 'coffee') {- var _indent = stream.indentation();- var _indent_index = -1;- for (var i = 0; i < state.scopes.length; ++i) {- if (_indent === state.scopes[i].offset) {- _indent_index = i;- break;- }- }- if (_indent_index === -1) {- return true;- }- while (state.scopes[0].offset !== _indent) {- state.scopes.shift();- }- return false;+ }+ if (singleline) {+ if (conf.mode.singleLineStringErrors) {+ outclass = ERRORCLASS;} else {- state.scopes.shift();- return false;+ state.tokenize = tokenBase;}+ }+ return outclass;+ };+ }++ function longComment(stream, state) {+ while (!stream.eol()) {+ stream.eatWhile(/[^#]/);+ if (stream.match("###")) {+ state.tokenize = tokenBase;+ break;+ }+ stream.eatWhile("#");}-- function tokenLexer(stream, state) {- var style = state.tokenize(stream, state);- var current = stream.current();-- // Handle '.' connected identifiers- if (current === '.') {- style = state.tokenize(stream, state);- current = stream.current();- if (style === 'variable') {- return 'variable';- } else {- return ERRORCLASS;- }- }-- // Handle scope changes.- if (current === 'return') {- state.dedent += 1;- }- if (((current === '->' || current === '=>') &&- !state.lambda &&- state.scopes[0].type == 'coffee' &&- stream.peek() === '')- || style === 'indent') {- indent(stream, state);- }- var delimiter_index = '[({'.indexOf(current);- if (delimiter_index !== -1) {- indent(stream, state, '])}'.slice(delimiter_index, delimiter_index+1));- }- if (indentKeywords.exec(current)){- indent(stream, state);- }- if (current == 'then'){- dedent(stream, state);- }--- if (style === 'dedent') {- if (dedent(stream, state)) {- return ERRORCLASS;- }- }- delimiter_index = '])}'.indexOf(current);- if (delimiter_index !== -1) {- if (dedent(stream, state)) {- return ERRORCLASS;- }- }- if (state.dedent > 0 && stream.eol() && state.scopes[0].type == 'coffee') {- if (state.scopes.length > 1) state.scopes.shift();- state.dedent -= 1;+ return "comment";+ }++ function indent(stream, state, type) {+ type = type || "coffee";+ var offset = 0, align = false, alignOffset = null;+ for (var scope = state.scope; scope; scope = scope.prev) {+ if (scope.type === "coffee") {+ offset = scope.offset + conf.indentUnit;+ break;+ }+ }+ if (type !== "coffee") {+ align = null;+ alignOffset = stream.column() + stream.current().length;+ } else if (state.scope.align) {+ state.scope.align = false;+ }+ state.scope = {+ offset: offset,+ type: type,+ prev: state.scope,+ align: align,+ alignOffset: alignOffset+ };+ }++ function dedent(stream, state) {+ if (!state.scope.prev) return;+ if (state.scope.type === "coffee") {+ var _indent = stream.indentation();+ var matched = false;+ for (var scope = state.scope; scope; scope = scope.prev) {+ if (_indent === scope.offset) {+ matched = true;+ break;}-- return style;+ }+ if (!matched) {+ return true;+ }+ while (state.scope.prev && state.scope.offset !== _indent) {+ state.scope = state.scope.prev;+ }+ return false;+ } else {+ state.scope = state.scope.prev;+ return false;+ }+ }++ function tokenLexer(stream, state) {+ var style = state.tokenize(stream, state);+ var current = stream.current();++ // Handle "." connected identifiers+ if (current === ".") {+ style = state.tokenize(stream, state);+ current = stream.current();+ if (/^\.[\w$]+$/.test(current)) {+ return "variable";+ } else {+ return ERRORCLASS;+ }}- var external = {- startState: function(basecolumn) {- return {- tokenize: tokenBase,- scopes: [{offset:basecolumn || 0, type:'coffee'}],- lastToken: null,- lambda: false,- dedent: 0- };- },-- token: function(stream, state) {- var style = tokenLexer(stream, state);-- state.lastToken = {style:style, content: stream.current()};-- if (stream.eol() && stream.lambda) {- state.lambda = false;- }-- return style;- },+ // Handle scope changes.+ if (current === "return") {+ state.dedent += 1;+ }+ if (((current === "->" || current === "=>") &&+ !state.lambda &&+ !stream.peek())+ || style === "indent") {+ indent(stream, state);+ }+ var delimiter_index = "[({".indexOf(current);+ if (delimiter_index !== -1) {+ indent(stream, state, "])}".slice(delimiter_index, delimiter_index+1));+ }+ if (indentKeywords.exec(current)){+ indent(stream, state);+ }+ if (current == "then"){+ dedent(stream, state);+ }- indent: function(state) {- if (state.tokenize != tokenBase) {- return 0;- }- return state.scopes[0].offset;- },+ if (style === "dedent") {+ if (dedent(stream, state)) {+ return ERRORCLASS;+ }+ }+ delimiter_index = "])}".indexOf(current);+ if (delimiter_index !== -1) {+ while (state.scope.type == "coffee" && state.scope.prev)+ state.scope = state.scope.prev;+ if (state.scope.type == current)+ state.scope = state.scope.prev;+ }+ if (state.dedent > 0 && stream.eol() && state.scope.type == "coffee") {+ if (state.scope.prev) state.scope = state.scope.prev;+ state.dedent -= 1;+ }- lineComment: "#"- };- return external;+ return style;+ }++ var external = {+ startState: function(basecolumn) {+ return {+ tokenize: tokenBase,+ scope: {offset:basecolumn || 0, type:"coffee", prev: null, align: false},+ lastToken: null,+ lambda: false,+ dedent: 0+ };+ },++ token: function(stream, state) {+ var fillAlign = state.scope.align === null && state.scope;+ if (fillAlign && stream.sol()) fillAlign.align = false;++ var style = tokenLexer(stream, state);+ if (fillAlign && style && style != "comment") fillAlign.align = true;++ state.lastToken = {style:style, content: stream.current()};++ if (stream.eol() && stream.lambda) {+ state.lambda = false;+ }++ return style;+ },++ indent: function(state, text) {+ if (state.tokenize != tokenBase) return 0;+ var scope = state.scope;+ var closer = text && "])}".indexOf(text.charAt(0)) > -1;+ if (closer) while (scope.type == "coffee" && scope.prev) scope = scope.prev;+ var closes = closer && scope.type === text.charAt(0);+ if (scope.align)+ return scope.alignOffset - (closes ? 1 : 0);+ else+ return (closes ? scope.prev : scope).offset;+ },++ lineComment: "#",+ fold: "indent"+ };+ return external;});-CodeMirror.defineMIME('text/x-coffeescript', 'coffeescript');+CodeMirror.defineMIME("text/x-coffeescript", "coffeescript");diff --git a/data/ext/editorText/codemirror/mode/coffeescript/index.html b/data/ext/editorText/codemirror/mode/coffeescript/index.htmlindex ee72b8d2f..6e6fde52e 100644--- a/data/ext/editorText/codemirror/mode/coffeescript/index.html+++ b/data/ext/editorText/codemirror/mode/coffeescript/index.html@@ -1,17 +1,30 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: CoffeeScript mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="coffeescript.js"></script>- <style>.CodeMirror {border-top: 1px solid silver; border-bottom: 1px solid silver;}</style>- <link rel="stylesheet" href="../../doc/docs.css">- </head>- <body>- <h1>CodeMirror: CoffeeScript mode</h1>- <form><textarea id="code" name="code">++<title>CodeMirror: CoffeeScript mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="coffeescript.js"></script>+<style>.CodeMirror {border-top: 1px solid silver; border-bottom: 1px solid silver;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">CoffeeScript</a>+ </ul>+</div>++<article>+<h2>CoffeeScript mode</h2>+<form><textarea id="code" name="code"># CoffeeScript mode for CodeMirror# Copyright (c) 2011 Jeff Pickhardt, released under# the MIT License.@@ -724,5 +737,4 @@ wrapper::value = -> this._wrapped<p>The CoffeeScript mode was written by Jeff Pickhardt (<a href="LICENSE">license</a>).</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/commonlisp/index.html b/data/ext/editorText/codemirror/mode/commonlisp/index.htmlindex f9766a844..d48be8d23 100644--- a/data/ext/editorText/codemirror/mode/commonlisp/index.html+++ b/data/ext/editorText/codemirror/mode/commonlisp/index.html@@ -1,17 +1,30 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Common Lisp mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="commonlisp.js"></script>- <style>.CodeMirror {background: #f8f8f8;}</style>- <link rel="stylesheet" href="../../doc/docs.css">- </head>- <body>- <h1>CodeMirror: Common Lisp mode</h1>- <form><textarea id="code" name="code">(in-package :cl-postgres)++<title>CodeMirror: Common Lisp mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="commonlisp.js"></script>+<style>.CodeMirror {background: #f8f8f8;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Common Lisp</a>+ </ul>+</div>++<article>+<h2>Common Lisp mode</h2>+<form><textarea id="code" name="code">(in-package :cl-postgres);; These are used to synthesize reader and writer names for integer;; reading/writing functions when the amount of bytes and the@@ -161,5 +174,4 @@ when UTF-8 support is enabled."<p><strong>MIME types defined:</strong> <code>text/x-common-lisp</code>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/css/css.js b/data/ext/editorText/codemirror/mode/css/css.jsindex 27c97f37e..6cc4b71b0 100644--- a/data/ext/editorText/codemirror/mode/css/css.js+++ b/data/ext/editorText/codemirror/mode/css/css.js@@ -1,91 +1,82 @@-CodeMirror.defineMode("css", function(config) {- return CodeMirror.getMode(config, "text/css");-});--CodeMirror.defineMode("css-base", function(config, parserConfig) {+CodeMirror.defineMode("css", function(config, parserConfig) {"use strict";+ if (!parserConfig.propertyKeywords) parserConfig = CodeMirror.resolveMode("text/css");+var indentUnit = config.indentUnit,- hooks = parserConfig.hooks || {},- atMediaTypes = parserConfig.atMediaTypes || {},- atMediaFeatures = parserConfig.atMediaFeatures || {},+ tokenHooks = parserConfig.tokenHooks,+ mediaTypes = parserConfig.mediaTypes || {},+ mediaFeatures = parserConfig.mediaFeatures || {},propertyKeywords = parserConfig.propertyKeywords || {},colorKeywords = parserConfig.colorKeywords || {},valueKeywords = parserConfig.valueKeywords || {},- allowNested = !!parserConfig.allowNested,- type = null;+ fontProperties = parserConfig.fontProperties || {},+ allowNested = parserConfig.allowNested;+ var type, override;function ret(style, tp) { type = tp; return style; }+ // Tokenizers+function tokenBase(stream, state) {var ch = stream.next();- if (hooks[ch]) {- // result[0] is style and result[1] is type- var result = hooks[ch](stream, state);+ if (tokenHooks[ch]) {+ var result = tokenHooks[ch](stream, state);if (result !== false) return result;}- if (ch == "@") {stream.eatWhile(/[\w\\\-]/); return ret("def", stream.current());}- else if (ch == "=") ret(null, "compare");- else if ((ch == "~" || ch == "|") && stream.eat("=")) return ret(null, "compare");- else if (ch == "\"" || ch == "'") {+ if (ch == "@") {+ stream.eatWhile(/[\w\\\-]/);+ return ret("def", stream.current());+ } else if (ch == "=" || (ch == "~" || ch == "|") && stream.eat("=")) {+ return ret(null, "compare");+ } else if (ch == "\"" || ch == "'") {state.tokenize = tokenString(ch);return state.tokenize(stream, state);- }- else if (ch == "#") {+ } else if (ch == "#") {stream.eatWhile(/[\w\\\-]/);return ret("atom", "hash");- }- else if (ch == "!") {+ } else if (ch == "!") {stream.match(/^\s*\w*/);return ret("keyword", "important");- }- else if (/\d/.test(ch)) {+ } else if (/\d/.test(ch) || ch == "." && stream.eat(/\d/)) {stream.eatWhile(/[\w.%]/);return ret("number", "unit");- }- else if (ch === "-") {- if (/\d/.test(stream.peek())) {+ } else if (ch === "-") {+ if (/[\d.]/.test(stream.peek())) {stream.eatWhile(/[\w.%]/);return ret("number", "unit");} else if (stream.match(/^[^-]+-/)) {return ret("meta", "meta");}- }- else if (/[,+>*\/]/.test(ch)) {+ } else if (/[,+>*\/]/.test(ch)) {return ret(null, "select-op");- }- else if (ch == "." && stream.match(/^-?[_a-z][_a-z0-9-]*/i)) {+ } else if (ch == "." && stream.match(/^-?[_a-z][_a-z0-9-]*/i)) {return ret("qualifier", "qualifier");- }- else if (ch == ":") {- return ret("operator", ch);- }- else if (/[;{}\[\]\(\)]/.test(ch)) {+ } else if (/[:;{}\[\]\(\)]/.test(ch)) {return ret(null, ch);- }- else if (ch == "u" && stream.match("rl(")) {+ } else if (ch == "u" && stream.match("rl(")) {stream.backUp(1);state.tokenize = tokenParenthesized;- return ret("property", "variable");- }- else {+ return ret("property", "word");+ } else if (/[\w\\\-]/.test(ch)) {stream.eatWhile(/[\w\\\-]/);- return ret("property", "variable");+ return ret("property", "word");+ } else {+ return ret(null, null);}}- function tokenString(quote, nonInclusive) {+ function tokenString(quote) {return function(stream, state) {var escaped = false, ch;while ((ch = stream.next()) != null) {- if (ch == quote && !escaped)+ if (ch == quote && !escaped) {+ if (quote == ")") stream.backUp(1);break;+ }escaped = !escaped && ch == "\\";}- if (!escaped) {- if (nonInclusive) stream.backUp(1);- state.tokenize = tokenBase;- }+ if (ch == quote || !escaped && quote != ")") state.tokenize = null;return ret("string", "string");};}@@ -93,202 +84,253 @@ CodeMirror.defineMode("css-base", function(config, parserConfig) {function tokenParenthesized(stream, state) {stream.next(); // Must be '('if (!stream.match(/\s*[\"\']/, false))- state.tokenize = tokenString(")", true);+ state.tokenize = tokenString(")");else- state.tokenize = tokenBase;+ state.tokenize = null;return ret(null, "(");}+ // Context management++ function Context(type, indent, prev) {+ this.type = type;+ this.indent = indent;+ this.prev = prev;+ }++ function pushContext(state, stream, type) {+ state.context = new Context(type, stream.indentation() + indentUnit, state.context);+ return type;+ }++ function popContext(state) {+ state.context = state.context.prev;+ return state.context.type;+ }++ function pass(type, stream, state) {+ return states[state.context.type](type, stream, state);+ }+ function popAndPass(type, stream, state, n) {+ for (var i = n || 1; i > 0; i--)+ state.context = state.context.prev;+ return pass(type, stream, state);+ }++ // Parser++ function wordAsValue(stream) {+ var word = stream.current().toLowerCase();+ if (valueKeywords.hasOwnProperty(word))+ override = "atom";+ else if (colorKeywords.hasOwnProperty(word))+ override = "keyword";+ else+ override = "variable";+ }++ var states = {};++ states.top = function(type, stream, state) {+ if (type == "{") {+ return pushContext(state, stream, "block");+ } else if (type == "}" && state.context.prev) {+ return popContext(state);+ } else if (type == "@media") {+ return pushContext(state, stream, "media");+ } else if (type == "@font-face") {+ return "font_face_before";+ } else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(type)) {+ return "keyframes";+ } else if (type && type.charAt(0) == "@") {+ return pushContext(state, stream, "at");+ } else if (type == "hash") {+ override = "builtin";+ } else if (type == "word") {+ override = "tag";+ } else if (type == "variable-definition") {+ return "maybeprop";+ } else if (type == "interpolation") {+ return pushContext(state, stream, "interpolation");+ } else if (type == ":") {+ return "pseudo";+ } else if (allowNested && type == "(") {+ return pushContext(state, stream, "params");+ }+ return state.context.type;+ };++ states.block = function(type, stream, state) {+ if (type == "word") {+ if (propertyKeywords.hasOwnProperty(stream.current().toLowerCase())) {+ override = "property";+ return "maybeprop";+ } else if (allowNested) {+ override = stream.match(/^\s*:/, false) ? "property" : "tag";+ return "block";+ } else {+ override += " error";+ return "maybeprop";+ }+ } else if (type == "meta") {+ return "block";+ } else if (!allowNested && (type == "hash" || type == "qualifier")) {+ override = "error";+ return "block";+ } else {+ return states.top(type, stream, state);+ }+ };++ states.maybeprop = function(type, stream, state) {+ if (type == ":") return pushContext(state, stream, "prop");+ return pass(type, stream, state);+ };++ states.prop = function(type, stream, state) {+ if (type == ";") return popContext(state);+ if (type == "{" && allowNested) return pushContext(state, stream, "propBlock");+ if (type == "}" || type == "{") return popAndPass(type, stream, state);+ if (type == "(") return pushContext(state, stream, "parens");++ if (type == "hash" && !/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(stream.current())) {+ override += " error";+ } else if (type == "word") {+ wordAsValue(stream);+ } else if (type == "interpolation") {+ return pushContext(state, stream, "interpolation");+ }+ return "prop";+ };++ states.propBlock = function(type, _stream, state) {+ if (type == "}") return popContext(state);+ if (type == "word") { override = "property"; return "maybeprop"; }+ return state.context.type;+ };++ states.parens = function(type, stream, state) {+ if (type == "{" || type == "}") return popAndPass(type, stream, state);+ if (type == ")") return popContext(state);+ return "parens";+ };++ states.pseudo = function(type, stream, state) {+ if (type == "word") {+ override = "variable-3";+ return state.context.type;+ }+ return pass(type, stream, state);+ };++ states.media = function(type, stream, state) {+ if (type == "(") return pushContext(state, stream, "media_parens");+ if (type == "}") return popAndPass(type, stream, state);+ if (type == "{") return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top");++ if (type == "word") {+ var word = stream.current().toLowerCase();+ if (word == "only" || word == "not" || word == "and")+ override = "keyword";+ else if (mediaTypes.hasOwnProperty(word))+ override = "attribute";+ else if (mediaFeatures.hasOwnProperty(word))+ override = "property";+ else+ override = "error";+ }+ return state.context.type;+ };++ states.media_parens = function(type, stream, state) {+ if (type == ")") return popContext(state);+ if (type == "{" || type == "}") return popAndPass(type, stream, state, 2);+ return states.media(type, stream, state);+ };++ states.font_face_before = function(type, stream, state) {+ if (type == "{")+ return pushContext(state, stream, "font_face");+ return pass(type, stream, state);+ };++ states.font_face = function(type, stream, state) {+ if (type == "}") return popContext(state);+ if (type == "word") {+ if (!fontProperties.hasOwnProperty(stream.current().toLowerCase()))+ override = "error";+ else+ override = "property";+ return "maybeprop";+ }+ return "font_face";+ };++ states.keyframes = function(type, stream, state) {+ if (type == "word") { override = "variable"; return "keyframes"; }+ if (type == "{") return pushContext(state, stream, "top");+ return pass(type, stream, state);+ };++ states.at = function(type, stream, state) {+ if (type == ";") return popContext(state);+ if (type == "{" || type == "}") return popAndPass(type, stream, state);+ if (type == "word") override = "tag";+ else if (type == "hash") override = "builtin";+ return "at";+ };++ states.interpolation = function(type, stream, state) {+ if (type == "}") return popContext(state);+ if (type == "{" || type == ";") return popAndPass(type, stream, state);+ if (type != "variable") override = "error";+ return "interpolation";+ };++ states.params = function(type, stream, state) {+ if (type == ")") return popContext(state);+ if (type == "{" || type == "}") return popAndPass(type, stream, state);+ if (type == "word") wordAsValue(stream);+ return "params";+ };+return {startState: function(base) {- return {tokenize: tokenBase,- baseIndent: base || 0,- stack: []};+ return {tokenize: null,+ state: "top",+ context: new Context("top", base || 0, null)};},token: function(stream, state) {-- // Use these terms when applicable (see http://www.xanthir.com/blog/b4E50)- //- // rule** or **ruleset:- // A selector + braces combo, or an at-rule.- //- // declaration block:- // A sequence of declarations.- //- // declaration:- // A property + colon + value combo.- //- // property value:- // The entire value of a property.- //- // component value:- // A single piece of a property value. Like the 5px in- // text-shadow: 0 0 5px blue;. Can also refer to things that are- // multiple terms, like the 1-4 terms that make up the background-size- // portion of the background shorthand.- //- // term:- // The basic unit of author-facing CSS, like a single number (5),- // dimension (5px), string ("foo"), or function. Officially defined- // by the CSS 2.1 grammar (look for the 'term' production)- //- //- // simple selector:- // A single atomic selector, like a type selector, an attr selector, a- // class selector, etc.- //- // compound selector:- // One or more simple selectors without a combinator. div.example is- // compound, div > .example is not.- //- // complex selector:- // One or more compound selectors chained with combinators.- //- // combinator:- // The parts of selectors that express relationships. There are four- // currently - the space (descendant combinator), the greater-than- // bracket (child combinator), the plus sign (next sibling combinator),- // and the tilda (following sibling combinator).- //- // sequence of selectors:- // One or more of the named type of selector chained with commas.-- state.tokenize = state.tokenize || tokenBase;- if (state.tokenize == tokenBase && stream.eatSpace()) return null;- var style = state.tokenize(stream, state);- if (style && typeof style != "string") style = ret(style[0], style[1]);-- // Changing style returned based on context- var context = state.stack[state.stack.length-1];- if (style == "variable") {- if (type == "variable-definition") state.stack.push("propertyValue");- return "variable-2";- } else if (style == "property") {- var word = stream.current().toLowerCase();- if (context == "propertyValue") {- if (valueKeywords.hasOwnProperty(word)) {- style = "string-2";- } else if (colorKeywords.hasOwnProperty(word)) {- style = "keyword";- } else {- style = "variable-2";- }- } else if (context == "rule") {- if (!propertyKeywords.hasOwnProperty(word)) {- style += " error";- }- } else if (context == "block") {- // if a value is present in both property, value, or color, the order- // of preference is property -> color -> value- if (propertyKeywords.hasOwnProperty(word)) {- style = "property";- } else if (colorKeywords.hasOwnProperty(word)) {- style = "keyword";- } else if (valueKeywords.hasOwnProperty(word)) {- style = "string-2";- } else {- style = "tag";- }- } else if (!context || context == "@media{") {- style = "tag";- } else if (context == "@media") {- if (atMediaTypes[stream.current()]) {- style = "attribute"; // Known attribute- } else if (/^(only|not)$/.test(word)) {- style = "keyword";- } else if (word == "and") {- style = "error"; // "and" is only allowed in @mediaType- } else if (atMediaFeatures.hasOwnProperty(word)) {- style = "error"; // Known property, should be in @mediaType(- } else {- // Unknown, expecting keyword or attribute, assuming attribute- style = "attribute error";- }- } else if (context == "@mediaType") {- if (atMediaTypes.hasOwnProperty(word)) {- style = "attribute";- } else if (word == "and") {- style = "operator";- } else if (/^(only|not)$/.test(word)) {- style = "error"; // Only allowed in @media- } else {- // Unknown attribute or property, but expecting property (preceded- // by "and"). Should be in parentheses- style = "error";- }- } else if (context == "@mediaType(") {- if (propertyKeywords.hasOwnProperty(word)) {- // do nothing, remains "property"- } else if (atMediaTypes.hasOwnProperty(word)) {- style = "error"; // Known property, should be in parentheses- } else if (word == "and") {- style = "operator";- } else if (/^(only|not)$/.test(word)) {- style = "error"; // Only allowed in @media- } else {- style += " error";- }- } else if (context == "@import") {- style = "tag";- } else {- style = "error";- }- } else if (style == "atom") {- if(!context || context == "@media{" || context == "block") {- style = "builtin";- } else if (context == "propertyValue") {- if (!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(stream.current())) {- style += " error";- }- } else {- style = "error";- }- } else if (context == "@media" && type == "{") {- style = "error";+ if (!state.tokenize && stream.eatSpace()) return null;+ var style = (state.tokenize || tokenBase)(stream, state);+ if (style && typeof style == "object") {+ type = style[1];+ style = style[0];}-- // Push/pop context stack- if (type == "{") {- if (context == "@media" || context == "@mediaType") {- state.stack.pop();- state.stack[state.stack.length-1] = "@media{";- }- else {- var newContext = allowNested ? "block" : "rule";- state.stack.push(newContext);- }- }- else if (type == "}") {- var lastState = state.stack[state.stack.length - 1];- if (lastState == "interpolation") style = "operator";- state.stack.pop();- if (context == "propertyValue") state.stack.pop();- }- else if (type == "interpolation") state.stack.push("interpolation");- else if (type == "@media") state.stack.push("@media");- else if (type == "@import") state.stack.push("@import");- else if (context == "@media" && /\b(keyword|attribute)\b/.test(style))- state.stack.push("@mediaType");- else if (context == "@mediaType" && stream.current() == ",") state.stack.pop();- else if (context == "@mediaType" && type == "(") state.stack.push("@mediaType(");- else if (context == "@mediaType(" && type == ")") state.stack.pop();- else if ((context == "rule" || context == "block") && type == ":") state.stack.push("propertyValue");- else if (context == "propertyValue" && type == ";") state.stack.pop();- else if (context == "@import" && type == ";") state.stack.pop();- return style;+ override = style;+ state.state = states[state.state](type, stream, state);+ return override;},indent: function(state, textAfter) {- var n = state.stack.length;- if (/^\}/.test(textAfter))- n -= state.stack[state.stack.length-1] == "propertyValue" ? 2 : 1;- return state.baseIndent + n * indentUnit;+ var cx = state.context, ch = textAfter && textAfter.charAt(0);+ var indent = cx.indent;+ if (cx.type == "prop" && ch == "}") cx = cx.prev;+ if (cx.prev &&+ (ch == "}" && (cx.type == "block" || cx.type == "top" || cx.type == "interpolation" || cx.type == "font_face") ||+ ch == ")" && (cx.type == "parens" || cx.type == "params" || cx.type == "media_parens") ||+ ch == "{" && (cx.type == "at" || cx.type == "media"))) {+ indent = cx.indent - indentUnit;+ cx = cx.prev;+ }+ return indent;},electricChars: "}",blockCommentStart: "/*",- blockCommentEnd: "*/"+ blockCommentEnd: "*/",+ fold: "brace"};});@@ -301,12 +343,12 @@ CodeMirror.defineMode("css-base", function(config, parserConfig) {return keys;}- var atMediaTypes = keySet([+ var mediaTypes_ = ["all", "aural", "braille", "handheld", "print", "projection", "screen","tty", "tv", "embossed"- ]);+ ], mediaTypes = keySet(mediaTypes_);- var atMediaFeatures = keySet([+ var mediaFeatures_ = ["width", "min-width", "max-width", "height", "min-height", "max-height","device-width", "min-device-width", "max-device-width", "device-height","min-device-height", "max-device-height", "aspect-ratio",@@ -315,15 +357,15 @@ CodeMirror.defineMode("css-base", function(config, parserConfig) {"max-color", "color-index", "min-color-index", "max-color-index","monochrome", "min-monochrome", "max-monochrome", "resolution","min-resolution", "max-resolution", "scan", "grid"- ]);+ ], mediaFeatures = keySet(mediaFeatures_);- var propertyKeywords = keySet([+ var propertyKeywords_ = ["align-content", "align-items", "align-self", "alignment-adjust","alignment-baseline", "anchor-point", "animation", "animation-delay",- "animation-direction", "animation-duration", "animation-iteration-count",- "animation-name", "animation-play-state", "animation-timing-function",- "appearance", "azimuth", "backface-visibility", "background",- "background-attachment", "background-clip", "background-color",+ "animation-direction", "animation-duration", "animation-fill-mode",+ "animation-iteration-count", "animation-name", "animation-play-state",+ "animation-timing-function", "appearance", "azimuth", "backface-visibility",+ "background", "background-attachment", "background-clip", "background-color","background-image", "background-origin", "background-position","background-repeat", "background-size", "baseline-shift", "binding","bleed", "bookmark-label", "bookmark-level", "bookmark-state",@@ -349,15 +391,16 @@ CodeMirror.defineMode("css-base", function(config, parserConfig) {"drop-initial-before-align", "drop-initial-size", "drop-initial-value","elevation", "empty-cells", "fit", "fit-position", "flex", "flex-basis","flex-direction", "flex-flow", "flex-grow", "flex-shrink", "flex-wrap",- "float", "float-offset", "font", "font-feature-settings", "font-family",- "font-kerning", "font-language-override", "font-size", "font-size-adjust",+ "float", "float-offset", "flow-from", "flow-into", "font", "font-feature-settings",+ "font-family", "font-kerning", "font-language-override", "font-size", "font-size-adjust","font-stretch", "font-style", "font-synthesis", "font-variant","font-variant-alternates", "font-variant-caps", "font-variant-east-asian","font-variant-ligatures", "font-variant-numeric", "font-variant-position",- "font-weight", "grid-cell", "grid-column", "grid-column-align",- "grid-column-sizing", "grid-column-span", "grid-columns", "grid-flow",- "grid-row", "grid-row-align", "grid-row-sizing", "grid-row-span",- "grid-rows", "grid-template", "hanging-punctuation", "height", "hyphens",+ "font-weight", "grid", "grid-area", "grid-auto-columns", "grid-auto-flow",+ "grid-auto-position", "grid-auto-rows", "grid-column", "grid-column-end",+ "grid-column-start", "grid-row", "grid-row-end", "grid-row-start",+ "grid-template", "grid-template-areas", "grid-template-columns",+ "grid-template-rows", "hanging-punctuation", "height", "hyphens","icon", "image-orientation", "image-rendering", "image-resolution","inline-box-align", "justify-content", "left", "letter-spacing","line-break", "line-height", "line-stacking", "line-stacking-ruby",@@ -374,25 +417,27 @@ CodeMirror.defineMode("css-base", function(config, parserConfig) {"page", "page-break-after", "page-break-before", "page-break-inside","page-policy", "pause", "pause-after", "pause-before", "perspective","perspective-origin", "pitch", "pitch-range", "play-during", "position",- "presentation-level", "punctuation-trim", "quotes", "rendering-intent",- "resize", "rest", "rest-after", "rest-before", "richness", "right",- "rotation", "rotation-point", "ruby-align", "ruby-overhang",- "ruby-position", "ruby-span", "size", "speak", "speak-as", "speak-header",+ "presentation-level", "punctuation-trim", "quotes", "region-break-after",+ "region-break-before", "region-break-inside", "region-fragment",+ "rendering-intent", "resize", "rest", "rest-after", "rest-before", "richness",+ "right", "rotation", "rotation-point", "ruby-align", "ruby-overhang",+ "ruby-position", "ruby-span", "shape-inside", "shape-outside", "size",+ "speak", "speak-as", "speak-header","speak-numeral", "speak-punctuation", "speech-rate", "stress", "string-set","tab-size", "table-layout", "target", "target-name", "target-new","target-position", "text-align", "text-align-last", "text-decoration","text-decoration-color", "text-decoration-line", "text-decoration-skip","text-decoration-style", "text-emphasis", "text-emphasis-color","text-emphasis-position", "text-emphasis-style", "text-height",- "text-indent", "text-justify", "text-outline", "text-shadow",- "text-space-collapse", "text-transform", "text-underline-position",+ "text-indent", "text-justify", "text-outline", "text-overflow", "text-shadow",+ "text-size-adjust", "text-space-collapse", "text-transform", "text-underline-position","text-wrap", "top", "transform", "transform-origin", "transform-style","transition", "transition-delay", "transition-duration","transition-property", "transition-timing-function", "unicode-bidi","vertical-align", "visibility", "voice-balance", "voice-duration","voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress","voice-volume", "volume", "white-space", "widows", "width", "word-break",- "word-spacing", "word-wrap", "z-index",+ "word-spacing", "word-wrap", "z-index", "zoom",// SVG-specific"clip-path", "clip-rule", "mask", "enable-background", "filter", "flood-color","flood-opacity", "lighting-color", "stop-color", "stop-opacity", "pointer-events",@@ -403,9 +448,9 @@ CodeMirror.defineMode("css-base", function(config, parserConfig) {"stroke-miterlimit", "stroke-opacity", "stroke-width", "text-rendering","baseline-shift", "dominant-baseline", "glyph-orientation-horizontal","glyph-orientation-vertical", "kerning", "text-anchor", "writing-mode"- ]);+ ], propertyKeywords = keySet(propertyKeywords_);- var colorKeywords = keySet([+ var colorKeywords_ = ["aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige","bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown","burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue",@@ -415,7 +460,7 @@ CodeMirror.defineMode("css-base", function(config, parserConfig) {"darkslateblue", "darkslategray", "darkturquoise", "darkviolet","deeppink", "deepskyblue", "dimgray", "dodgerblue", "firebrick","floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite",- "gold", "goldenrod", "gray", "green", "greenyellow", "honeydew",+ "gold", "goldenrod", "gray", "grey", "green", "greenyellow", "honeydew","hotpink", "indianred", "indigo", "ivory", "khaki", "lavender","lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral","lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightpink",@@ -432,28 +477,28 @@ CodeMirror.defineMode("css-base", function(config, parserConfig) {"slateblue", "slategray", "snow", "springgreen", "steelblue", "tan","teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white","whitesmoke", "yellow", "yellowgreen"- ]);+ ], colorKeywords = keySet(colorKeywords_);- var valueKeywords = keySet([+ var valueKeywords_ = ["above", "absolute", "activeborder", "activecaption", "afar","after-white-space", "ahead", "alias", "all", "all-scroll", "alternate","always", "amharic", "amharic-abegede", "antialiased", "appworkspace",- "arabic-indic", "armenian", "asterisks", "auto", "avoid", "background",- "backwards", "baseline", "below", "bidi-override", "binary", "bengali",- "blink", "block", "block-axis", "bold", "bolder", "border", "border-box",- "both", "bottom", "break-all", "break-word", "button", "button-bevel",+ "arabic-indic", "armenian", "asterisks", "auto", "avoid", "avoid-column", "avoid-page",+ "avoid-region", "background", "backwards", "baseline", "below", "bidi-override", "binary",+ "bengali", "blink", "block", "block-axis", "bold", "bolder", "border", "border-box",+ "both", "bottom", "break", "break-all", "break-word", "button", "button-bevel","buttonface", "buttonhighlight", "buttonshadow", "buttontext", "cambodian","capitalize", "caps-lock-indicator", "caption", "captiontext", "caret","cell", "center", "checkbox", "circle", "cjk-earthly-branch","cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote",- "col-resize", "collapse", "compact", "condensed", "contain", "content",+ "col-resize", "collapse", "column", "compact", "condensed", "contain", "content","content-box", "context-menu", "continuous", "copy", "cover", "crop","cross", "crosshair", "currentcolor", "cursive", "dashed", "decimal","decimal-leading-zero", "default", "default-button", "destination-atop","destination-in", "destination-out", "destination-over", "devanagari","disc", "discard", "document", "dot-dash", "dot-dot-dash", "dotted","double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out",- "element", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede",+ "element", "ellipse", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede","ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er","ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er","ethiopic-halehame-aa-et", "ethiopic-halehame-am-et",@@ -469,7 +514,7 @@ CodeMirror.defineMode("css-base", function(config, parserConfig) {"inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite","infobackground", "infotext", "inherit", "initial", "inline", "inline-axis","inline-block", "inline-table", "inset", "inside", "intrinsic", "invert",- "italic", "justify", "kannada", "katakana", "katakana-iroha", "khmer",+ "italic", "justify", "kannada", "katakana", "katakana-iroha", "keep-all", "khmer","landscape", "lao", "large", "larger", "left", "level", "lighter","line-through", "linear", "lines", "list-item", "listbox", "listitem","local", "logical", "loud", "lower", "lower-alpha", "lower-armenian",@@ -488,11 +533,11 @@ CodeMirror.defineMode("css-base", function(config, parserConfig) {"no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap","ns-resize", "nw-resize", "nwse-resize", "oblique", "octal", "open-quote","optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset",- "outside", "overlay", "overline", "padding", "padding-box", "painted",- "paused", "persian", "plus-darker", "plus-lighter", "pointer", "portrait",- "pre", "pre-line", "pre-wrap", "preserve-3d", "progress", "push-button",- "radio", "read-only", "read-write", "read-write-plaintext-only", "relative",- "repeat", "repeat-x", "repeat-y", "reset", "reverse", "rgb", "rgba",+ "outside", "outside-shape", "overlay", "overline", "padding", "padding-box",+ "painted", "page", "paused", "persian", "plus-darker", "plus-lighter", "pointer",+ "polygon", "portrait", "pre", "pre-line", "pre-wrap", "preserve-3d", "progress", "push-button",+ "radio", "read-only", "read-write", "read-write-plaintext-only", "rectangle", "region",+ "relative", "repeat", "repeat-x", "repeat-y", "reset", "reverse", "rgb", "rgba","ridge", "right", "round", "row-resize", "rtl", "run-in", "running","s-resize", "sans-serif", "scroll", "scrollbar", "se-resize", "searchfield","searchfield-cancel-button", "searchfield-decoration",@@ -517,7 +562,15 @@ CodeMirror.defineMode("css-base", function(config, parserConfig) {"visibleStroke", "visual", "w-resize", "wait", "wave", "wider","window", "windowframe", "windowtext", "x-large", "x-small", "xor","xx-large", "xx-small"- ]);+ ], valueKeywords = keySet(valueKeywords_);++ var fontProperties_ = [+ "font-family", "src", "unicode-range", "font-variant", "font-feature-settings",+ "font-stretch", "font-weight", "font-style"+ ], fontProperties = keySet(fontProperties_);++ var allWords = mediaTypes_.concat(mediaFeatures_).concat(propertyKeywords_).concat(colorKeywords_).concat(valueKeywords_);+ CodeMirror.registerHelper("hintWords", "css", allWords);function tokenCComment(stream, state) {var maybeEnd = false, ch;@@ -531,56 +584,47 @@ CodeMirror.defineMode("css-base", function(config, parserConfig) {return ["comment", "comment"];}+ function tokenSGMLComment(stream, state) {+ if (stream.skipTo("-->")) {+ stream.match("-->");+ state.tokenize = null;+ } else {+ stream.skipToEnd();+ }+ return ["comment", "comment"];+ }+CodeMirror.defineMIME("text/css", {- atMediaTypes: atMediaTypes,- atMediaFeatures: atMediaFeatures,+ mediaTypes: mediaTypes,+ mediaFeatures: mediaFeatures,propertyKeywords: propertyKeywords,colorKeywords: colorKeywords,valueKeywords: valueKeywords,- hooks: {+ fontProperties: fontProperties,+ tokenHooks: {"<": function(stream, state) {- function tokenSGMLComment(stream, state) {- var dashes = 0, ch;- while ((ch = stream.next()) != null) {- if (dashes >= 2 && ch == ">") {- state.tokenize = null;- break;- }- dashes = (ch == "-") ? dashes + 1 : 0;- }- return ["comment", "comment"];- }- if (stream.eat("!")) {- state.tokenize = tokenSGMLComment;- return tokenSGMLComment(stream, state);- }+ if (!stream.match("!--")) return false;+ state.tokenize = tokenSGMLComment;+ return tokenSGMLComment(stream, state);},"/": function(stream, state) {- if (stream.eat("*")) {- state.tokenize = tokenCComment;- return tokenCComment(stream, state);- }- return false;+ if (!stream.eat("*")) return false;+ state.tokenize = tokenCComment;+ return tokenCComment(stream, state);}},- name: "css-base"+ name: "css"});CodeMirror.defineMIME("text/x-scss", {- atMediaTypes: atMediaTypes,- atMediaFeatures: atMediaFeatures,+ mediaTypes: mediaTypes,+ mediaFeatures: mediaFeatures,propertyKeywords: propertyKeywords,colorKeywords: colorKeywords,valueKeywords: valueKeywords,+ fontProperties: fontProperties,allowNested: true,- hooks: {- "$": function(stream) {- stream.match(/^[\w-]+/);- if (stream.peek() == ":") {- return ["variable", "variable-definition"];- }- return ["variable", "variable"];- },+ tokenHooks: {"/": function(stream, state) {if (stream.eat("/")) {stream.skipToEnd();@@ -592,15 +636,58 @@ CodeMirror.defineMode("css-base", function(config, parserConfig) {return ["operator", "operator"];}},+ ":": function(stream) {+ if (stream.match(/\s*{/))+ return [null, "{"];+ return false;+ },+ "$": function(stream) {+ stream.match(/^[\w-]+/);+ if (stream.match(/^\s*:/, false))+ return ["variable-2", "variable-definition"];+ return ["variable-2", "variable"];+ },"#": function(stream) {- if (stream.eat("{")) {- return ["operator", "interpolation"];+ if (!stream.eat("{")) return false;+ return [null, "interpolation"];+ }+ },+ name: "css",+ helperType: "scss"+ });++ CodeMirror.defineMIME("text/x-less", {+ mediaTypes: mediaTypes,+ mediaFeatures: mediaFeatures,+ propertyKeywords: propertyKeywords,+ colorKeywords: colorKeywords,+ valueKeywords: valueKeywords,+ fontProperties: fontProperties,+ allowNested: true,+ tokenHooks: {+ "/": function(stream, state) {+ if (stream.eat("/")) {+ stream.skipToEnd();+ return ["comment", "comment"];+ } else if (stream.eat("*")) {+ state.tokenize = tokenCComment;+ return tokenCComment(stream, state);} else {- stream.eatWhile(/[\w\\\-]/);- return ["atom", "hash"];+ return ["operator", "operator"];}+ },+ "@": function(stream) {+ if (stream.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/, false)) return false;+ stream.eatWhile(/[\w\\\-]/);+ if (stream.match(/^\s*:/, false))+ return ["variable-2", "variable-definition"];+ return ["variable-2", "variable"];+ },+ "&": function() {+ return ["atom", "atom"];}},- name: "css-base"+ name: "css",+ helperType: "less"});})();diff --git a/data/ext/editorText/codemirror/mode/css/index.html b/data/ext/editorText/codemirror/mode/css/index.htmlindex ae2c3bfce..80ef518e9 100644--- a/data/ext/editorText/codemirror/mode/css/index.html+++ b/data/ext/editorText/codemirror/mode/css/index.html@@ -1,17 +1,30 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: CSS mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="css.js"></script>- <style>.CodeMirror {background: #f8f8f8;}</style>- <link rel="stylesheet" href="../../doc/docs.css">- </head>- <body>- <h1>CodeMirror: CSS mode</h1>- <form><textarea id="code" name="code">++<title>CodeMirror: CSS mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="css.js"></script>+<style>.CodeMirror {background: #f8f8f8;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">CSS</a>+ </ul>+</div>++<article>+<h2>CSS mode</h2>+<form><textarea id="code" name="code">/* Some example CSS */@import url("something.css");@@ -50,9 +63,8 @@ code {var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});</script>- <p><strong>MIME types defined:</strong> <code>text/css</code>.</p>+ <p><strong>MIME types defined:</strong> <code>text/css</code>, <code>text/x-scss</code> (<a href="scss.html">demo</a>), <code>text/x-less</code> (<a href="less.html">demo</a>).</p><p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#css_*">normal</a>, <a href="../../test/index.html#verbose,css_*">verbose</a>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/css/less.html b/data/ext/editorText/codemirror/mode/css/less.htmlnew file mode 100644index 000000000..1030ca43f--- /dev/null+++ b/data/ext/editorText/codemirror/mode/css/less.html@@ -0,0 +1,152 @@+<!doctype html>++<title>CodeMirror: LESS mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="../../addon/edit/matchbrackets.js"></script>+<script src="css.js"></script>+<style>.CodeMirror {border: 1px solid #ddd; line-height: 1.2;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">LESS</a>+ </ul>+</div>++<article>+<h2>LESS mode</h2>+<form><textarea id="code" name="code">@media screen and (device-aspect-ratio: 16/9) { … }+@media screen and (device-aspect-ratio: 1280/720) { … }+@media screen and (device-aspect-ratio: 2560/1440) { … }++html:lang(fr-be)++tr:nth-child(2n+1) /* represents every odd row of an HTML table */++img:nth-of-type(2n+1) { float: right; }+img:nth-of-type(2n) { float: left; }++body > h2:not(:first-of-type):not(:last-of-type)++html|*:not(:link):not(:visited)+*|*:not(:hover)+p::first-line { text-transform: uppercase }++@namespace foo url(http://www.example.com);+foo|h1 { color: blue } /* first rule */++span[hello="Ocean"][goodbye="Land"]++E[foo]{+ padding:65px;+}++input[type="search"]::-webkit-search-decoration,+input[type="search"]::-webkit-search-cancel-button {+ -webkit-appearance: none; // Inner-padding issues in Chrome OSX, Safari 5+}+button::-moz-focus-inner,+input::-moz-focus-inner { // Inner padding and border oddities in FF3/4+ padding: 0;+ border: 0;+}+.btn {+ // reset here as of 2.0.3 due to Recess property order+ border-color: #ccc;+ border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);+}+fieldset span button, fieldset span input[type="file"] {+ font-size:12px;+ font-family:Arial, Helvetica, sans-serif;+}++.rounded-corners (@radius: 5px) {+ border-radius: @radius;+ -webkit-border-radius: @radius;+ -moz-border-radius: @radius;+}++@import url("something.css");++@light-blue: hsl(190, 50%, 65%);++#menu {+ position: absolute;+ width: 100%;+ z-index: 3;+ clear: both;+ display: block;+ background-color: @blue;+ height: 42px;+ border-top: 2px solid lighten(@alpha-blue, 20%);+ border-bottom: 2px solid darken(@alpha-blue, 25%);+ .box-shadow(0, 1px, 8px, 0.6);+ -moz-box-shadow: 0 0 0 #000; // Because firefox sucks.++ &.docked {+ background-color: hsla(210, 60%, 40%, 0.4);+ }+ &:hover {+ background-color: @blue;+ }++ #dropdown {+ margin: 0 0 0 117px;+ padding: 0;+ padding-top: 5px;+ display: none;+ width: 190px;+ border-top: 2px solid @medium;+ color: @highlight;+ border: 2px solid darken(@medium, 25%);+ border-left-color: darken(@medium, 15%);+ border-right-color: darken(@medium, 15%);+ border-top-width: 0;+ background-color: darken(@medium, 10%);+ ul {+ padding: 0px;+ }+ li {+ font-size: 14px;+ display: block;+ text-align: left;+ padding: 0;+ border: 0;+ a {+ display: block;+ padding: 0px 15px;+ text-decoration: none;+ color: white;+ &:hover {+ background-color: darken(@medium, 15%);+ text-decoration: none;+ }+ }+ }+ .border-radius(5px, bottom);+ .box-shadow(0, 6px, 8px, 0.5);+ }+}+</textarea></form>+ <script>+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {+ lineNumbers : true,+ matchBrackets : true,+ mode: "text/x-less"+ });+ </script>++ <p>The LESS mode is a sub-mode of the <a href="index.html">CSS mode</a> (defined in <code>css.js</code>.</p>++ <p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#less_*">normal</a>, <a href="../../test/index.html#verbose,less_*">verbose</a>.</p>+ </article>diff --git a/data/ext/editorText/codemirror/mode/css/less_test.js b/data/ext/editorText/codemirror/mode/css/less_test.jsnew file mode 100644index 000000000..ea64f91d1--- /dev/null+++ b/data/ext/editorText/codemirror/mode/css/less_test.js@@ -0,0 +1,48 @@+(function() {+ "use strict";++ var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-less");+ function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "less"); }++ MT("variable",+ "[variable-2 @base]: [atom #f04615];",+ "[qualifier .class] {",+ " [property width]: [variable percentage]([number 0.5]); [comment // returns `50%`]",+ " [property color]: [variable saturate]([variable-2 @base], [number 5%]);",+ "}");++ MT("amp",+ "[qualifier .child], [qualifier .sibling] {",+ " [qualifier .parent] [atom &] {",+ " [property color]: [keyword black];",+ " }",+ " [atom &] + [atom &] {",+ " [property color]: [keyword red];",+ " }",+ "}");++ MT("mixin",+ "[qualifier .mixin] ([variable dark]; [variable-2 @color]) {",+ " [property color]: [variable darken]([variable-2 @color], [number 10%]);",+ "}",+ "[qualifier .mixin] ([variable light]; [variable-2 @color]) {",+ " [property color]: [variable lighten]([variable-2 @color], [number 10%]);",+ "}",+ "[qualifier .mixin] ([variable-2 @_]; [variable-2 @color]) {",+ " [property display]: [atom block];",+ "}",+ "[variable-2 @switch]: [variable light];",+ "[qualifier .class] {",+ " [qualifier .mixin]([variable-2 @switch]; [atom #888]);",+ "}");++ MT("nest",+ "[qualifier .one] {",+ " [def @media] ([property width]: [number 400px]) {",+ " [property font-size]: [number 1.2em];",+ " [def @media] [attribute print] [keyword and] [property color] {",+ " [property color]: [keyword blue];",+ " }",+ " }",+ "}");+})();diff --git a/data/ext/editorText/codemirror/mode/css/scss.html b/data/ext/editorText/codemirror/mode/css/scss.htmlindex b90cbe876..0677d08fe 100644--- a/data/ext/editorText/codemirror/mode/css/scss.html+++ b/data/ext/editorText/codemirror/mode/css/scss.html@@ -1,17 +1,30 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: SCSS mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="css.js"></script>- <style>.CodeMirror {background: #f8f8f8;}</style>- <link rel="stylesheet" href="../../doc/docs.css">- </head>- <body>- <h1>CodeMirror: SCSS mode</h1>- <form><textarea id="code" name="code">++<title>CodeMirror: SCSS mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="css.js"></script>+<style>.CodeMirror {background: #f8f8f8;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">SCSS</a>+ </ul>+</div>++<article>+<h2>SCSS mode</h2>+<form><textarea id="code" name="code">/* Some example SCSS */@import "compass/css3";@@ -137,9 +150,8 @@ code {});</script>- <p><strong>MIME types defined:</strong> <code>text/scss</code>.</p>+ <p>The SCSS mode is a sub-mode of the <a href="index.html">CSS mode</a> (defined in <code>css.js</code>.</p><p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#scss_*">normal</a>, <a href="../../test/index.html#verbose,scss_*">verbose</a>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/css/scss_test.js b/data/ext/editorText/codemirror/mode/css/scss_test.jsindex 996dc7884..c51cb42bb 100644--- a/data/ext/editorText/codemirror/mode/css/scss_test.js+++ b/data/ext/editorText/codemirror/mode/css/scss_test.js@@ -1,33 +1,33 @@(function() {- var mode = CodeMirror.getMode({tabSize: 4}, "text/x-scss");+ var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-scss");function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "scss"); }MT('url_with_quotation',- "[tag foo] { [property background][operator :][string-2 url]([string test.jpg]) }");+ "[tag foo] { [property background]:[atom url]([string test.jpg]) }");MT('url_with_double_quotes',- "[tag foo] { [property background][operator :][string-2 url]([string \"test.jpg\"]) }");+ "[tag foo] { [property background]:[atom url]([string \"test.jpg\"]) }");MT('url_with_single_quotes',- "[tag foo] { [property background][operator :][string-2 url]([string \'test.jpg\']) }");+ "[tag foo] { [property background]:[atom url]([string \'test.jpg\']) }");MT('string',"[def @import] [string \"compass/css3\"]");MT('important_keyword',- "[tag foo] { [property background][operator :][string-2 url]([string \'test.jpg\']) [keyword !important] }");+ "[tag foo] { [property background]:[atom url]([string \'test.jpg\']) [keyword !important] }");MT('variable',- "[variable-2 $blue][operator :][atom #333]");+ "[variable-2 $blue]:[atom #333]");MT('variable_as_attribute',- "[tag foo] { [property color][operator :][variable-2 $blue] }");+ "[tag foo] { [property color]:[variable-2 $blue] }");MT('numbers',- "[tag foo] { [property padding][operator :][number 10px] [number 10] [number 10em] [number 8in] }");+ "[tag foo] { [property padding]:[number 10px] [number 10] [number 10em] [number 8in] }");MT('number_percentage',- "[tag foo] { [property width][operator :][number 80%] }");+ "[tag foo] { [property width]:[number 80%] }");MT('selector',"[builtin #hello][qualifier .world]{}");@@ -39,42 +39,69 @@"[comment /*foobar*/]");MT('attribute_with_hyphen',- "[tag foo] { [property font-size][operator :][number 10px] }");+ "[tag foo] { [property font-size]:[number 10px] }");MT('string_after_attribute',- "[tag foo] { [property content][operator :][string \"::\"] }");+ "[tag foo] { [property content]:[string \"::\"] }");MT('directives',"[def @include] [qualifier .mixin]");MT('basic_structure',- "[tag p] { [property background][operator :][keyword red]; }");+ "[tag p] { [property background]:[keyword red]; }");MT('nested_structure',- "[tag p] { [tag a] { [property color][operator :][keyword red]; } }");+ "[tag p] { [tag a] { [property color]:[keyword red]; } }");MT('mixin',"[def @mixin] [tag table-base] {}");MT('number_without_semicolon',- "[tag p] {[property width][operator :][number 12]}",- "[tag a] {[property color][operator :][keyword red];}");+ "[tag p] {[property width]:[number 12]}",+ "[tag a] {[property color]:[keyword red];}");MT('atom_in_nested_block',- "[tag p] { [tag a] { [property color][operator :][atom #000]; } }");+ "[tag p] { [tag a] { [property color]:[atom #000]; } }");MT('interpolation_in_property',- "[tag foo] { [operator #{][variable-2 $hello][operator }:][atom #000]; }");+ "[tag foo] { #{[variable-2 $hello]}:[number 2]; }");MT('interpolation_in_selector',- "[tag foo][operator #{][variable-2 $hello][operator }] { [property color][operator :][atom #000]; }");+ "[tag foo]#{[variable-2 $hello]} { [property color]:[atom #000]; }");MT('interpolation_error',- "[tag foo][operator #{][error foo][operator }] { [property color][operator :][atom #000]; }");+ "[tag foo]#{[error foo]} { [property color]:[atom #000]; }");MT("divide_operator",- "[tag foo] { [property width][operator :][number 4] [operator /] [number 2] }");+ "[tag foo] { [property width]:[number 4] [operator /] [number 2] }");MT('nested_structure_with_id_selector',- "[tag p] { [builtin #hello] { [property color][operator :][keyword red]; } }");+ "[tag p] { [builtin #hello] { [property color]:[keyword red]; } }");++ MT('indent_mixin',+ "[def @mixin] [tag container] (",+ " [variable-2 $a]: [number 10],",+ " [variable-2 $b]: [number 10])",+ "{}");++ MT('indent_nested',+ "[tag foo] {",+ " [tag bar] {",+ " }",+ "}");++ MT('indent_parentheses',+ "[tag foo] {",+ " [property color]: [variable darken]([variable-2 $blue],",+ " [number 9%]);",+ "}");++ MT('indent_vardef',+ "[variable-2 $name]:",+ " [string 'val'];",+ "[tag tag] {",+ " [tag inner] {",+ " [property margin]: [number 3px];",+ " }",+ "}");})();diff --git a/data/ext/editorText/codemirror/mode/css/test.js b/data/ext/editorText/codemirror/mode/css/test.jsindex 97dd0a8a3..b3f47767e 100644--- a/data/ext/editorText/codemirror/mode/css/test.js+++ b/data/ext/editorText/codemirror/mode/css/test.js@@ -1,57 +1,19 @@(function() {- var mode = CodeMirror.getMode({tabSize: 4}, "css");+ var mode = CodeMirror.getMode({indentUnit: 2}, "css");function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }- // Requires at least one media query- MT("atMediaEmpty",- "[def @media] [error {] }");-- MT("atMediaMultiple",- "[def @media] [keyword not] [attribute screen] [operator and] ([property color]), [keyword not] [attribute print] [operator and] ([property color]) { }");-- MT("atMediaCheckStack",- "[def @media] [attribute screen] { } [tag foo] { }");-- MT("atMediaCheckStack",- "[def @media] [attribute screen] ([property color]) { } [tag foo] { }");-- MT("atMediaCheckStackInvalidAttribute",- "[def @media] [attribute&error foobarhello] { } [tag foo] { }");-- // Error, because "and" is only allowed immediately preceding a media expression- MT("atMediaInvalidAttribute",- "[def @media] [attribute&error foobarhello] { }");-- // Error, because "and" is only allowed immediately preceding a media expression- MT("atMediaInvalidAnd",- "[def @media] [error and] [attribute screen] { }");-- // Error, because "not" is only allowed as the first item in each media query- MT("atMediaInvalidNot",- "[def @media] [attribute screen] [error not] ([error not]) { }");-- // Error, because "only" is only allowed as the first item in each media query- MT("atMediaInvalidOnly",- "[def @media] [attribute screen] [error only] ([error only]) { }");-// Error, because "foobarhello" is neither a known type or property, but// property was expected (after "and"), and it should be in parenthese.MT("atMediaUnknownType",- "[def @media] [attribute screen] [operator and] [error foobarhello] { }");-- // Error, because "color" is not a known type, but is a known property, and- // should be in parentheses.- MT("atMediaInvalidType",- "[def @media] [attribute screen] [operator and] [error color] { }");-- // Error, because "print" is not a known property, but is a known type,- // and should not be in parenthese.- MT("atMediaInvalidProperty",- "[def @media] [attribute screen] [operator and] ([error print]) { }");+ "[def @media] [attribute screen] [keyword and] [error foobarhello] { }");// Soft error, because "foobarhello" is not a known property or type.MT("atMediaUnknownProperty",- "[def @media] [attribute screen] [operator and] ([property&error foobarhello]) { }");+ "[def @media] [attribute screen] [keyword and] ([error foobarhello]) { }");++ // Make sure nesting works with media queries+ MT("atMediaMaxWidthNested",+ "[def @media] [attribute screen] [keyword and] ([property max-width]: [number 25px]) { [tag foo] { } }");MT("tagSelector","[tag foo] { }");@@ -63,51 +25,95 @@"[builtin #foo] { [error #foo] }");MT("tagSelectorUnclosed",- "[tag foo] { [property margin][operator :] [number 0] } [tag bar] { }");+ "[tag foo] { [property margin]: [number 0] } [tag bar] { }");MT("tagStringNoQuotes",- "[tag foo] { [property font-family][operator :] [variable-2 hello] [variable-2 world]; }");+ "[tag foo] { [property font-family]: [variable hello] [variable world]; }");MT("tagStringDouble",- "[tag foo] { [property font-family][operator :] [string \"hello world\"]; }");+ "[tag foo] { [property font-family]: [string \"hello world\"]; }");MT("tagStringSingle",- "[tag foo] { [property font-family][operator :] [string 'hello world']; }");+ "[tag foo] { [property font-family]: [string 'hello world']; }");MT("tagColorKeyword",- "[tag foo] {" +- "[property color][operator :] [keyword black];" +- "[property color][operator :] [keyword navy];" +- "[property color][operator :] [keyword yellow];" +- "}");+ "[tag foo] {",+ " [property color]: [keyword black];",+ " [property color]: [keyword navy];",+ " [property color]: [keyword yellow];",+ "}");MT("tagColorHex3",- "[tag foo] { [property background][operator :] [atom #fff]; }");+ "[tag foo] { [property background]: [atom #fff]; }");MT("tagColorHex6",- "[tag foo] { [property background][operator :] [atom #ffffff]; }");+ "[tag foo] { [property background]: [atom #ffffff]; }");MT("tagColorHex4",- "[tag foo] { [property background][operator :] [atom&error #ffff]; }");+ "[tag foo] { [property background]: [atom&error #ffff]; }");MT("tagColorHexInvalid",- "[tag foo] { [property background][operator :] [atom&error #ffg]; }");+ "[tag foo] { [property background]: [atom&error #ffg]; }");MT("tagNegativeNumber",- "[tag foo] { [property margin][operator :] [number -5px]; }");+ "[tag foo] { [property margin]: [number -5px]; }");MT("tagPositiveNumber",- "[tag foo] { [property padding][operator :] [number 5px]; }");+ "[tag foo] { [property padding]: [number 5px]; }");MT("tagVendor",- "[tag foo] { [meta -foo-][property box-sizing][operator :] [meta -foo-][string-2 border-box]; }");+ "[tag foo] { [meta -foo-][property box-sizing]: [meta -foo-][atom border-box]; }");MT("tagBogusProperty",- "[tag foo] { [property&error barhelloworld][operator :] [number 0]; }");+ "[tag foo] { [property&error barhelloworld]: [number 0]; }");MT("tagTwoProperties",- "[tag foo] { [property margin][operator :] [number 0]; [property padding][operator :] [number 0]; }");+ "[tag foo] { [property margin]: [number 0]; [property padding]: [number 0]; }");++ MT("tagTwoPropertiesURL",+ "[tag foo] { [property background]: [atom url]([string //example.com/foo.png]); [property padding]: [number 0]; }");MT("commentSGML","[comment <!--comment-->]");++ MT("commentSGML2",+ "[comment <!--comment]",+ "[comment -->] [tag div] {}");++ MT("indent_tagSelector",+ "[tag strong], [tag em] {",+ " [property background]: [atom rgba](",+ " [number 255], [number 255], [number 0], [number .2]",+ " );",+ "}");++ MT("indent_atMedia",+ "[def @media] {",+ " [tag foo] {",+ " [property color]:",+ " [keyword yellow];",+ " }",+ "}");++ MT("indent_comma",+ "[tag foo] {",+ " [property font-family]: [variable verdana],",+ " [atom sans-serif];",+ "}");++ MT("indent_parentheses",+ "[tag foo]:[variable-3 before] {",+ " [property background]: [atom url](",+ "[string blahblah]",+ "[string etc]",+ "[string ]) [keyword !important];",+ "}");++ MT("font_face",+ "[def @font-face] {",+ " [property font-family]: [string 'myfont'];",+ " [error nonsense]: [string 'abc'];",+ " [property src]: [atom url]([string http://blah]),",+ " [atom url]([string http://foo]);",+ "}");})();diff --git a/data/ext/editorText/codemirror/mode/d/index.html b/data/ext/editorText/codemirror/mode/d/index.htmlindex 13332727a..8b25fcc5c 100644--- a/data/ext/editorText/codemirror/mode/d/index.html+++ b/data/ext/editorText/codemirror/mode/d/index.html@@ -1,18 +1,30 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: D mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="../../addon/edit/matchbrackets.js"></script>- <script src="d.js"></script>- <link rel="stylesheet" href="../../doc/docs.css">- <style>.CodeMirror {border: 2px inset #dee;}</style>- </head>- <body>- <h1>CodeMirror: D mode</h1>+<title>CodeMirror: D mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="../../addon/edit/matchbrackets.js"></script>+<script src="d.js"></script>+<style>.CodeMirror {border: 2px inset #dee;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">D</a>+ </ul>+</div>++<article>+<h2>D mode</h2><form><textarea id="code" name="code">/* D demo code // copied from phobos/sd/metastrings.d */// Written in the D programming language.@@ -258,5 +270,4 @@ deprecated alias parseUinteger ParseInteger;<p><strong>MIME types defined:</strong> <code>text/x-d</code>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/diff/index.html b/data/ext/editorText/codemirror/mode/diff/index.htmlindex 556025204..6ceae8b33 100644--- a/data/ext/editorText/codemirror/mode/diff/index.html+++ b/data/ext/editorText/codemirror/mode/diff/index.html@@ -1,23 +1,36 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Diff mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="diff.js"></script>- <style>++<title>CodeMirror: Diff mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="diff.js"></script>+<style>.CodeMirror {border-top: 1px solid #ddd; border-bottom: 1px solid #ddd;}span.cm-meta {color: #a0b !important;}span.cm-error { background-color: black; opacity: 0.4;}span.cm-error.cm-string { background-color: red; }span.cm-error.cm-tag { background-color: #2b2; }</style>- <link rel="stylesheet" href="../../doc/docs.css">- </head>- <body>- <h1>CodeMirror: Diff mode</h1>- <form><textarea id="code" name="code">+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Diff</a>+ </ul>+</div>++<article>+<h2>Diff mode</h2>+<form><textarea id="code" name="code">diff --git a/index.html b/index.htmlindex c1d9156..7764744 100644--- a/index.html@@ -101,5 +114,4 @@ index 04646a9..9a39cc7 100644<p><strong>MIME types defined:</strong> <code>text/x-diff</code>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/dtd/dtd.js b/data/ext/editorText/codemirror/mode/dtd/dtd.jsnew file mode 100644index 000000000..7033bf0f8--- /dev/null+++ b/data/ext/editorText/codemirror/mode/dtd/dtd.js@@ -0,0 +1,127 @@+/*+ DTD mode+ Ported to CodeMirror by Peter Kroon <[email protected]>+ Report bugs/issues here: https://github.com/marijnh/CodeMirror/issues+ GitHub: @peterkroon+*/++CodeMirror.defineMode("dtd", function(config) {+ var indentUnit = config.indentUnit, type;+ function ret(style, tp) {type = tp; return style;}++ function tokenBase(stream, state) {+ var ch = stream.next();++ if (ch == "<" && stream.eat("!") ) {+ if (stream.eatWhile(/[\-]/)) {+ state.tokenize = tokenSGMLComment;+ return tokenSGMLComment(stream, state);+ } else if (stream.eatWhile(/[\w]/)) return ret("keyword", "doindent");+ } else if (ch == "<" && stream.eat("?")) { //xml declaration+ state.tokenize = inBlock("meta", "?>");+ return ret("meta", ch);+ } else if (ch == "#" && stream.eatWhile(/[\w]/)) return ret("atom", "tag");+ else if (ch == "|") return ret("keyword", "seperator");+ else if (ch.match(/[\(\)\[\]\-\.,\+\?>]/)) return ret(null, ch);//if(ch === ">") return ret(null, "endtag"); else+ else if (ch.match(/[\[\]]/)) return ret("rule", ch);+ else if (ch == "\"" || ch == "'") {+ state.tokenize = tokenString(ch);+ return state.tokenize(stream, state);+ } else if (stream.eatWhile(/[a-zA-Z\?\+\d]/)) {+ var sc = stream.current();+ if( sc.substr(sc.length-1,sc.length).match(/\?|\+/) !== null )stream.backUp(1);+ return ret("tag", "tag");+ } else if (ch == "%" || ch == "*" ) return ret("number", "number");+ else {+ stream.eatWhile(/[\w\\\-_%.{,]/);+ return ret(null, null);+ }+ }++ function tokenSGMLComment(stream, state) {+ var dashes = 0, ch;+ while ((ch = stream.next()) != null) {+ if (dashes >= 2 && ch == ">") {+ state.tokenize = tokenBase;+ break;+ }+ dashes = (ch == "-") ? dashes + 1 : 0;+ }+ return ret("comment", "comment");+ }++ function tokenString(quote) {+ return function(stream, state) {+ var escaped = false, ch;+ while ((ch = stream.next()) != null) {+ if (ch == quote && !escaped) {+ state.tokenize = tokenBase;+ break;+ }+ escaped = !escaped && ch == "\\";+ }+ return ret("string", "tag");+ };+ }++ function inBlock(style, terminator) {+ return function(stream, state) {+ while (!stream.eol()) {+ if (stream.match(terminator)) {+ state.tokenize = tokenBase;+ break;+ }+ stream.next();+ }+ return style;+ };+ }++ return {+ startState: function(base) {+ return {tokenize: tokenBase,+ baseIndent: base || 0,+ stack: []};+ },++ token: function(stream, state) {+ if (stream.eatSpace()) return null;+ var style = state.tokenize(stream, state);++ var context = state.stack[state.stack.length-1];+ if (stream.current() == "[" || type === "doindent" || type == "[") state.stack.push("rule");+ else if (type === "endtag") state.stack[state.stack.length-1] = "endtag";+ else if (stream.current() == "]" || type == "]" || (type == ">" && context == "rule")) state.stack.pop();+ else if (type == "[") state.stack.push("[");+ return style;+ },++ indent: function(state, textAfter) {+ var n = state.stack.length;++ if( textAfter.match(/\]\s+|\]/) )n=n-1;+ else if(textAfter.substr(textAfter.length-1, textAfter.length) === ">"){+ if(textAfter.substr(0,1) === "<")n;+ else if( type == "doindent" && textAfter.length > 1 )n;+ else if( type == "doindent")n--;+ else if( type == ">" && textAfter.length > 1)n;+ else if( type == "tag" && textAfter !== ">")n;+ else if( type == "tag" && state.stack[state.stack.length-1] == "rule")n--;+ else if( type == "tag")n++;+ else if( textAfter === ">" && state.stack[state.stack.length-1] == "rule" && type === ">")n--;+ else if( textAfter === ">" && state.stack[state.stack.length-1] == "rule")n;+ else if( textAfter.substr(0,1) !== "<" && textAfter.substr(0,1) === ">" )n=n-1;+ else if( textAfter === ">")n;+ else n=n-1;+ //over rule them all+ if(type == null || type == "]")n--;+ }++ return state.baseIndent + n * indentUnit;+ },++ electricChars: "]>"+ };+});++CodeMirror.defineMIME("application/xml-dtd", "dtd");diff --git a/data/ext/editorText/codemirror/mode/dtd/index.html b/data/ext/editorText/codemirror/mode/dtd/index.htmlnew file mode 100644index 000000000..076d827f7--- /dev/null+++ b/data/ext/editorText/codemirror/mode/dtd/index.html@@ -0,0 +1,89 @@+<!doctype html>++<title>CodeMirror: DTD mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="dtd.js"></script>+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">DTD</a>+ </ul>+</div>++<article>+<h2>DTD mode</h2>+<form><textarea id="code" name="code"><?xml version="1.0" encoding="UTF-8"?>++<!ATTLIST title+ xmlns CDATA #FIXED "http://docbook.org/ns/docbook"+ role CDATA #IMPLIED+ %db.common.attributes;+ %db.common.linking.attributes;+>++<!--+ Try: http://docbook.org/xml/5.0/dtd/docbook.dtd+-->++<!DOCTYPE xsl:stylesheet+ [+ <!ENTITY nbsp "&#160;">+ <!ENTITY copy "&#169;">+ <!ENTITY reg "&#174;">+ <!ENTITY trade "&#8482;">+ <!ENTITY mdash "&#8212;">+ <!ENTITY ldquo "&#8220;">+ <!ENTITY rdquo "&#8221;">+ <!ENTITY pound "&#163;">+ <!ENTITY yen "&#165;">+ <!ENTITY euro "&#8364;">+ <!ENTITY mathml "http://www.w3.org/1998/Math/MathML">+ ]+>++<!ELEMENT title (#PCDATA|inlinemediaobject|remark|superscript|subscript|xref|link|olink|anchor|biblioref|alt|annotation|indexterm|abbrev|acronym|date|emphasis|footnote|footnoteref|foreignphrase|phrase|quote|wordasword|firstterm|glossterm|coref|trademark|productnumber|productname|database|application|hardware|citation|citerefentry|citetitle|citebiblioid|author|person|personname|org|orgname|editor|jobtitle|replaceable|package|parameter|termdef|nonterminal|systemitem|option|optional|property|inlineequation|tag|markup|token|symbol|literal|code|constant|email|uri|guiicon|guibutton|guimenuitem|guimenu|guisubmenu|guilabel|menuchoice|mousebutton|keycombo|keycap|keycode|keysym|shortcut|accel|prompt|envar|filename|command|computeroutput|userinput|function|varname|returnvalue|type|classname|exceptionname|interfacename|methodname|modifier|initializer|ooclass|ooexception|oointerface|errorcode|errortext|errorname|errortype)*>++<!ENTITY % db.common.attributes "+ xml:id ID #IMPLIED+ version CDATA #IMPLIED+ xml:lang CDATA #IMPLIED+ xml:base CDATA #IMPLIED+ remap CDATA #IMPLIED+ xreflabel CDATA #IMPLIED+ revisionflag (changed|added|deleted|off) #IMPLIED+ dir (ltr|rtl|lro|rlo) #IMPLIED+ arch CDATA #IMPLIED+ audience CDATA #IMPLIED+ condition CDATA #IMPLIED+ conformance CDATA #IMPLIED+ os CDATA #IMPLIED+ revision CDATA #IMPLIED+ security CDATA #IMPLIED+ userlevel CDATA #IMPLIED+ vendor CDATA #IMPLIED+ wordsize CDATA #IMPLIED+ annotations CDATA #IMPLIED++"></textarea></form>+ <script>+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {+ mode: {name: "dtd", alignCDATA: true},+ lineNumbers: true,+ lineWrapping: true+ });+ </script>++ <p><strong>MIME types defined:</strong> <code>application/xml-dtd</code>.</p>+ </article>diff --git a/data/ext/editorText/codemirror/mode/ecl/index.html b/data/ext/editorText/codemirror/mode/ecl/index.htmlindex 0ba88c399..f4b612d61 100644--- a/data/ext/editorText/codemirror/mode/ecl/index.html+++ b/data/ext/editorText/codemirror/mode/ecl/index.html@@ -1,16 +1,30 @@-<!doctype html>-<html>- <head>- <title>CodeMirror: ECL mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="ecl.js"></script>- <link rel="stylesheet" href="../../doc/docs.css">- <style>.CodeMirror {border: 1px solid black;}</style>- </head>- <body>- <h1>CodeMirror: ECL mode</h1>- <form><textarea id="code" name="code">+<!doctype html>++<title>CodeMirror: ECL mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="ecl.js"></script>+<style>.CodeMirror {border: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">ECL</a>+ </ul>+</div>++<article>+<h2>ECL mode</h2>+<form><textarea id="code" name="code">/*sample useless code to demonstrate ecl syntax highlightingthis is a multiline comment!@@ -35,5 +49,4 @@ output(d);<p>Based on CodeMirror's clike mode. For more information see <a href="http://hpccsystems.com">HPCC Systems</a> web site.</p><p><strong>MIME types defined:</strong> <code>text/x-ecl</code>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/eiffel/eiffel.js b/data/ext/editorText/codemirror/mode/eiffel/eiffel.jsnew file mode 100644index 000000000..15f34a932--- /dev/null+++ b/data/ext/editorText/codemirror/mode/eiffel/eiffel.js@@ -0,0 +1,147 @@+CodeMirror.defineMode("eiffel", function() {+ function wordObj(words) {+ var o = {};+ for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true;+ return o;+ }+ var keywords = wordObj([+ 'note',+ 'across',+ 'when',+ 'variant',+ 'until',+ 'unique',+ 'undefine',+ 'then',+ 'strip',+ 'select',+ 'retry',+ 'rescue',+ 'require',+ 'rename',+ 'reference',+ 'redefine',+ 'prefix',+ 'once',+ 'old',+ 'obsolete',+ 'loop',+ 'local',+ 'like',+ 'is',+ 'inspect',+ 'infix',+ 'include',+ 'if',+ 'frozen',+ 'from',+ 'external',+ 'export',+ 'ensure',+ 'end',+ 'elseif',+ 'else',+ 'do',+ 'creation',+ 'create',+ 'check',+ 'alias',+ 'agent',+ 'separate',+ 'invariant',+ 'inherit',+ 'indexing',+ 'feature',+ 'expanded',+ 'deferred',+ 'class',+ 'Void',+ 'True',+ 'Result',+ 'Precursor',+ 'False',+ 'Current',+ 'create',+ 'attached',+ 'detachable',+ 'as',+ 'and',+ 'implies',+ 'not',+ 'or'+ ]);+ var operators = wordObj([":=", "and then","and", "or","<<",">>"]);+ var curPunc;++ function chain(newtok, stream, state) {+ state.tokenize.push(newtok);+ return newtok(stream, state);+ }++ function tokenBase(stream, state) {+ curPunc = null;+ if (stream.eatSpace()) return null;+ var ch = stream.next();+ if (ch == '"'||ch == "'") {+ return chain(readQuoted(ch, "string"), stream, state);+ } else if (ch == "-"&&stream.eat("-")) {+ stream.skipToEnd();+ return "comment";+ } else if (ch == ":"&&stream.eat("=")) {+ return "operator";+ } else if (/[0-9]/.test(ch)) {+ stream.eatWhile(/[xXbBCc0-9\.]/);+ stream.eat(/[\?\!]/);+ return "ident";+ } else if (/[a-zA-Z_0-9]/.test(ch)) {+ stream.eatWhile(/[a-zA-Z_0-9]/);+ stream.eat(/[\?\!]/);+ return "ident";+ } else if (/[=+\-\/*^%<>~]/.test(ch)) {+ stream.eatWhile(/[=+\-\/*^%<>~]/);+ return "operator";+ } else {+ return null;+ }+ }++ function readQuoted(quote, style, unescaped) {+ return function(stream, state) {+ var escaped = false, ch;+ while ((ch = stream.next()) != null) {+ if (ch == quote && (unescaped || !escaped)) {+ state.tokenize.pop();+ break;+ }+ escaped = !escaped && ch == "%";+ }+ return style;+ };+ }++ return {+ startState: function() {+ return {tokenize: [tokenBase]};+ },++ token: function(stream, state) {+ var style = state.tokenize[state.tokenize.length-1](stream, state);+ if (style == "ident") {+ var word = stream.current();+ style = keywords.propertyIsEnumerable(stream.current()) ? "keyword"+ : operators.propertyIsEnumerable(stream.current()) ? "operator"+ : /^[A-Z][A-Z_0-9]*$/g.test(word) ? "tag"+ : /^0[bB][0-1]+$/g.test(word) ? "number"+ : /^0[cC][0-7]+$/g.test(word) ? "number"+ : /^0[xX][a-fA-F0-9]+$/g.test(word) ? "number"+ : /^([0-9]+\.[0-9]*)|([0-9]*\.[0-9]+)$/g.test(word) ? "number"+ : /^[0-9]+$/g.test(word) ? "number"+ : "variable";+ }+ return style;+ },+ lineComment: "--"+ };+});++CodeMirror.defineMIME("text/x-eiffel", "eiffel");diff --git a/data/ext/editorText/codemirror/mode/eiffel/index.html b/data/ext/editorText/codemirror/mode/eiffel/index.htmlnew file mode 100644index 000000000..95c5f885b--- /dev/null+++ b/data/ext/editorText/codemirror/mode/eiffel/index.html@@ -0,0 +1,429 @@+<!doctype html>++<title>CodeMirror: Eiffel mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<link rel="stylesheet" href="../../theme/neat.css">+<script src="../../lib/codemirror.js"></script>+<script src="eiffel.js"></script>+<style>+ .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}+ .cm-s-default span.cm-arrow { color: red; }+ </style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Eiffel</a>+ </ul>+</div>++<article>+<h2>Eiffel mode</h2>+<form><textarea id="code" name="code">+note+ description: "[+ Project-wide universal properties.+ This class is an ancestor to all developer-written classes.+ ANY may be customized for individual projects or teams.+ ]"++ library: "Free implementation of ELKS library"+ status: "See notice at end of class."+ legal: "See notice at end of class."+ date: "$Date: 2013-01-25 11:49:00 -0800 (Fri, 25 Jan 2013) $"+ revision: "$Revision: 712 $"++class+ ANY++feature -- Customization++feature -- Access++ generator: STRING+ -- Name of current object's generating class+ -- (base class of the type of which it is a direct instance)+ external+ "built_in"+ ensure+ generator_not_void: Result /= Void+ generator_not_empty: not Result.is_empty+ end++ generating_type: TYPE [detachable like Current]+ -- Type of current object+ -- (type of which it is a direct instance)+ do+ Result := {detachable like Current}+ ensure+ generating_type_not_void: Result /= Void+ end++feature -- Status report++ conforms_to (other: ANY): BOOLEAN+ -- Does type of current object conform to type+ -- of `other' (as per Eiffel: The Language, chapter 13)?+ require+ other_not_void: other /= Void+ external+ "built_in"+ end++ same_type (other: ANY): BOOLEAN+ -- Is type of current object identical to type of `other'?+ require+ other_not_void: other /= Void+ external+ "built_in"+ ensure+ definition: Result = (conforms_to (other) and+ other.conforms_to (Current))+ end++feature -- Comparison++ is_equal (other: like Current): BOOLEAN+ -- Is `other' attached to an object considered+ -- equal to current object?+ require+ other_not_void: other /= Void+ external+ "built_in"+ ensure+ symmetric: Result implies other ~ Current+ consistent: standard_is_equal (other) implies Result+ end++ frozen standard_is_equal (other: like Current): BOOLEAN+ -- Is `other' attached to an object of the same type+ -- as current object, and field-by-field identical to it?+ require+ other_not_void: other /= Void+ external+ "built_in"+ ensure+ same_type: Result implies same_type (other)+ symmetric: Result implies other.standard_is_equal (Current)+ end++ frozen equal (a: detachable ANY; b: like a): BOOLEAN+ -- Are `a' and `b' either both void or attached+ -- to objects considered equal?+ do+ if a = Void then+ Result := b = Void+ else+ Result := b /= Void and then+ a.is_equal (b)+ end+ ensure+ definition: Result = (a = Void and b = Void) or else+ ((a /= Void and b /= Void) and then+ a.is_equal (b))+ end++ frozen standard_equal (a: detachable ANY; b: like a): BOOLEAN+ -- Are `a' and `b' either both void or attached to+ -- field-by-field identical objects of the same type?+ -- Always uses default object comparison criterion.+ do+ if a = Void then+ Result := b = Void+ else+ Result := b /= Void and then+ a.standard_is_equal (b)+ end+ ensure+ definition: Result = (a = Void and b = Void) or else+ ((a /= Void and b /= Void) and then+ a.standard_is_equal (b))+ end++ frozen is_deep_equal (other: like Current): BOOLEAN+ -- Are `Current' and `other' attached to isomorphic object structures?+ require+ other_not_void: other /= Void+ external+ "built_in"+ ensure+ shallow_implies_deep: standard_is_equal (other) implies Result+ same_type: Result implies same_type (other)+ symmetric: Result implies other.is_deep_equal (Current)+ end++ frozen deep_equal (a: detachable ANY; b: like a): BOOLEAN+ -- Are `a' and `b' either both void+ -- or attached to isomorphic object structures?+ do+ if a = Void then+ Result := b = Void+ else+ Result := b /= Void and then a.is_deep_equal (b)+ end+ ensure+ shallow_implies_deep: standard_equal (a, b) implies Result+ both_or_none_void: (a = Void) implies (Result = (b = Void))+ same_type: (Result and (a /= Void)) implies (b /= Void and then a.same_type (b))+ symmetric: Result implies deep_equal (b, a)+ end++feature -- Duplication++ frozen twin: like Current+ -- New object equal to `Current'+ -- `twin' calls `copy'; to change copying/twinning semantics, redefine `copy'.+ external+ "built_in"+ ensure+ twin_not_void: Result /= Void+ is_equal: Result ~ Current+ end++ copy (other: like Current)+ -- Update current object using fields of object attached+ -- to `other', so as to yield equal objects.+ require+ other_not_void: other /= Void+ type_identity: same_type (other)+ external+ "built_in"+ ensure+ is_equal: Current ~ other+ end++ frozen standard_copy (other: like Current)+ -- Copy every field of `other' onto corresponding field+ -- of current object.+ require+ other_not_void: other /= Void+ type_identity: same_type (other)+ external+ "built_in"+ ensure+ is_standard_equal: standard_is_equal (other)+ end++ frozen clone (other: detachable ANY): like other+ -- Void if `other' is void; otherwise new object+ -- equal to `other'+ --+ -- For non-void `other', `clone' calls `copy';+ -- to change copying/cloning semantics, redefine `copy'.+ obsolete+ "Use `twin' instead."+ do+ if other /= Void then+ Result := other.twin+ end+ ensure+ equal: Result ~ other+ end++ frozen standard_clone (other: detachable ANY): like other+ -- Void if `other' is void; otherwise new object+ -- field-by-field identical to `other'.+ -- Always uses default copying semantics.+ obsolete+ "Use `standard_twin' instead."+ do+ if other /= Void then+ Result := other.standard_twin+ end+ ensure+ equal: standard_equal (Result, other)+ end++ frozen standard_twin: like Current+ -- New object field-by-field identical to `other'.+ -- Always uses default copying semantics.+ external+ "built_in"+ ensure+ standard_twin_not_void: Result /= Void+ equal: standard_equal (Result, Current)+ end++ frozen deep_twin: like Current+ -- New object structure recursively duplicated from Current.+ external+ "built_in"+ ensure+ deep_twin_not_void: Result /= Void+ deep_equal: deep_equal (Current, Result)+ end++ frozen deep_clone (other: detachable ANY): like other+ -- Void if `other' is void: otherwise, new object structure+ -- recursively duplicated from the one attached to `other'+ obsolete+ "Use `deep_twin' instead."+ do+ if other /= Void then+ Result := other.deep_twin+ end+ ensure+ deep_equal: deep_equal (other, Result)+ end++ frozen deep_copy (other: like Current)+ -- Effect equivalent to that of:+ -- `copy' (`other' . `deep_twin')+ require+ other_not_void: other /= Void+ do+ copy (other.deep_twin)+ ensure+ deep_equal: deep_equal (Current, other)+ end++feature {NONE} -- Retrieval++ frozen internal_correct_mismatch+ -- Called from runtime to perform a proper dynamic dispatch on `correct_mismatch'+ -- from MISMATCH_CORRECTOR.+ local+ l_msg: STRING+ l_exc: EXCEPTIONS+ do+ if attached {MISMATCH_CORRECTOR} Current as l_corrector then+ l_corrector.correct_mismatch+ else+ create l_msg.make_from_string ("Mismatch: ")+ create l_exc+ l_msg.append (generating_type.name)+ l_exc.raise_retrieval_exception (l_msg)+ end+ end++feature -- Output++ io: STD_FILES+ -- Handle to standard file setup+ once+ create Result+ Result.set_output_default+ ensure+ io_not_void: Result /= Void+ end++ out: STRING+ -- New string containing terse printable representation+ -- of current object+ do+ Result := tagged_out+ ensure+ out_not_void: Result /= Void+ end++ frozen tagged_out: STRING+ -- New string containing terse printable representation+ -- of current object+ external+ "built_in"+ ensure+ tagged_out_not_void: Result /= Void+ end++ print (o: detachable ANY)+ -- Write terse external representation of `o'+ -- on standard output.+ do+ if o /= Void then+ io.put_string (o.out)+ end+ end++feature -- Platform++ Operating_environment: OPERATING_ENVIRONMENT+ -- Objects available from the operating system+ once+ create Result+ ensure+ operating_environment_not_void: Result /= Void+ end++feature {NONE} -- Initialization++ default_create+ -- Process instances of classes with no creation clause.+ -- (Default: do nothing.)+ do+ end++feature -- Basic operations++ default_rescue+ -- Process exception for routines with no Rescue clause.+ -- (Default: do nothing.)+ do+ end++ frozen do_nothing+ -- Execute a null action.+ do+ end++ frozen default: detachable like Current+ -- Default value of object's type+ do+ end++ frozen default_pointer: POINTER+ -- Default value of type `POINTER'+ -- (Avoid the need to write `p'.`default' for+ -- some `p' of type `POINTER'.)+ do+ ensure+ -- Result = Result.default+ end++ frozen as_attached: attached like Current+ -- Attached version of Current+ -- (Can be used during transitional period to convert+ -- non-void-safe classes to void-safe ones.)+ do+ Result := Current+ end++invariant+ reflexive_equality: standard_is_equal (Current)+ reflexive_conformance: conforms_to (Current)++note+ copyright: "Copyright (c) 1984-2012, Eiffel Software and others"+ license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"+ source: "[+ Eiffel Software+ 5949 Hollister Ave., Goleta, CA 93117 USA+ Telephone 805-685-1006, Fax 805-685-6869+ Website http://www.eiffel.com+ Customer support http://support.eiffel.com+ ]"++end++</textarea></form>+ <script>+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {+ mode: "text/x-eiffel",+ indentUnit: 4,+ lineNumbers: true,+ theme: "neat"+ });+ </script>++ <p><strong>MIME types defined:</strong> <code>text/x-eiffel</code>.</p>++ <p> Created by <a href="https://github.com/ynh">YNH</a>.</p>+ </article>diff --git a/data/ext/editorText/codemirror/mode/erlang/erlang.js b/data/ext/editorText/codemirror/mode/erlang/erlang.jsindex 79e0434d1..bc3bdce86 100644--- a/data/ext/editorText/codemirror/mode/erlang/erlang.js+++ b/data/ext/editorText/codemirror/mode/erlang/erlang.js@@ -1,52 +1,24 @@-// block; "begin", "case", "fun", "if", "receive", "try": closed by "end"-// block internal; "after", "catch", "of"-// guard; "when", closed by "->"-// "->" opens a clause, closed by ";" or "."-// "<<" opens a binary, closed by ">>"-// "," appears in arglists, lists, tuples and terminates lines of code-// "." resets indentation to 0-// obsolete; "cond", "let", "query"+/*jshint unused:true, eqnull:true, curly:true, bitwise:true */+/*jshint undef:true, latedef:true, trailing:true */+/*global CodeMirror:true */++// erlang mode.+// tokenizer -> token types -> CodeMirror styles+// tokenizer maintains a parse stack+// indenter uses the parse stack++// TODO indenter:+// bit syntax+// old guard/bif/conversion clashes (e.g. "float/1")+// type/spec/opaqueCodeMirror.defineMIME("text/x-erlang", "erlang");CodeMirror.defineMode("erlang", function(cmCfg) {+ "use strict";- function rval(state,stream,type) {- // distinguish between "." as terminator and record field operator- if (type == "record") {- state.context = "record";- }else{- state.context = false;- }-- // remember last significant bit on last line for indenting- if (type != "whitespace" && type != "comment") {- state.lastToken = stream.current();- }- // erlang -> CodeMirror tag- switch (type) {- case "atom": return "atom";- case "attribute": return "attribute";- case "builtin": return "builtin";- case "comment": return "comment";- case "fun": return "meta";- case "function": return "tag";- case "guard": return "property";- case "keyword": return "keyword";- case "macro": return "variable-2";- case "number": return "number";- case "operator": return "operator";- case "record": return "bracket";- case "string": return "string";- case "type": return "def";- case "variable": return "variable";- case "error": return "error";- case "separator": return null;- case "open_paren": return null;- case "close_paren": return null;- default: return null;- }- }+/////////////////////////////////////////////////////////////////////////////+// constantsvar typeWords = ["-type", "-spec", "-export_type", "-opaque"];@@ -55,19 +27,23 @@ CodeMirror.defineMode("erlang", function(cmCfg) {"after","begin","catch","case","cond","end","fun","if","let","of","query","receive","try","when"];+ var separatorRE = /[\->,;]/;var separatorWords = [- "->",";",":",".",","];+ "->",";",","];- var operatorWords = [+ var operatorAtomWords = ["and","andalso","band","bnot","bor","bsl","bsr","bxor","div","not","or","orelse","rem","xor"];- var symbolWords = [- "+","-","*","/",">",">=","<","=<","=:=","==","=/=","/=","||","<-"];+ var operatorSymbolRE = /[\+\-\*\/<>=\|:!]/;+ var operatorSymbolWords = [+ "=","+","-","*","/",">",">=","<","=<","=:=","==","=/=","/=","||","<-","!"];+ var openParenRE = /[<\(\[\{]/;var openParenWords = ["<<","(","[","{"];+ var closeParenRE = /[>\)\]\}]/;var closeParenWords = ["}","]",")",">>"];@@ -102,53 +78,41 @@ CodeMirror.defineMode("erlang", function(cmCfg) {"term_to_binary","time","throw","tl","trunc","tuple_size","tuple_to_list","unlink","unregister","whereis"];- // ignored for indenting purposes- var ignoreWords = [- ",", ":", "catch", "after", "of", "cond", "let", "query"];-+// upper case: [A-Z] [Ø-Þ] [À-Ö]+// lower case: [a-z] [ß-ö] [ø-ÿ]+ var anumRE = /[\w@Ø-ÞÀ-Öß-öø-ÿ]/;+ var escapesRE =+ /[0-7]{1,3}|[bdefnrstv\\"']|\^[a-zA-Z]|x[0-9a-zA-Z]{2}|x{[0-9a-zA-Z]+}/;- var smallRE = /[a-z_]/;- var largeRE = /[A-Z_]/;- var digitRE = /[0-9]/;- var octitRE = /[0-7]/;- var anumRE = /[a-z_A-Z0-9]/;- var symbolRE = /[\+\-\*\/<>=\|:]/;- var openParenRE = /[<\(\[\{]/;- var closeParenRE = /[>\)\]\}]/;- var sepRE = /[\->\.,:;]/;+/////////////////////////////////////////////////////////////////////////////+// tokenizer- function isMember(element,list) {- return (-1 < list.indexOf(element));- }+ function tokenizer(stream,state) {+ // in multi-line string+ if (state.in_string) {+ state.in_string = (!doubleQuote(stream));+ return rval(state,stream,"string");+ }- function isPrev(stream,string) {- var start = stream.start;- var len = string.length;- if (len <= start) {- var word = stream.string.slice(start-len,start);- return word == string;- }else{- return false;+ // in multi-line atom+ if (state.in_atom) {+ state.in_atom = (!singleQuote(stream));+ return rval(state,stream,"atom");}- }- function tokenize(stream, state) {+ // whitespaceif (stream.eatSpace()) {return rval(state,stream,"whitespace");}// attributes and type specs- if ((peekToken(state).token == "" || peekToken(state).token == ".") &&- stream.peek() == '-') {- stream.next();- if (stream.eat(smallRE) && stream.eatWhile(anumRE)) {- if (isMember(stream.current(),typeWords)) {- return rval(state,stream,"type");- }else{- return rval(state,stream,"attribute");- }+ if (!peekToken(state) &&+ stream.match(/-\s*[a-zß-öø-ÿ][\wØ-ÞÀ-Öß-öø-ÿ]*/)) {+ if (is_member(stream.current(),typeWords)) {+ return rval(state,stream,"type");+ }else{+ return rval(state,stream,"attribute");}- stream.backUp(1);}var ch = stream.next();@@ -159,109 +123,131 @@ CodeMirror.defineMode("erlang", function(cmCfg) {return rval(state,stream,"comment");}+ // colon+ if (ch == ":") {+ return rval(state,stream,"colon");+ }+// macroif (ch == '?') {+ stream.eatSpace();stream.eatWhile(anumRE);return rval(state,stream,"macro");}// record- if ( ch == "#") {+ if (ch == "#") {+ stream.eatSpace();stream.eatWhile(anumRE);return rval(state,stream,"record");}- // char- if ( ch == "$") {- if (stream.next() == "\\") {- if (!stream.eatWhile(octitRE)) {- stream.next();- }+ // dollar escape+ if (ch == "$") {+ if (stream.next() == "\\" && !stream.match(escapesRE)) {+ return rval(state,stream,"error");}- return rval(state,stream,"string");+ return rval(state,stream,"number");+ }++ // dot+ if (ch == ".") {+ return rval(state,stream,"dot");}// quoted atomif (ch == '\'') {- if (singleQuote(stream)) {- return rval(state,stream,"atom");- }else{- return rval(state,stream,"error");+ if (!(state.in_atom = (!singleQuote(stream)))) {+ if (stream.match(/\s*\/\s*[0-9]/,false)) {+ stream.match(/\s*\/\s*[0-9]/,true);+ return rval(state,stream,"fun"); // 'f'/0 style fun+ }+ if (stream.match(/\s*\(/,false) || stream.match(/\s*:/,false)) {+ return rval(state,stream,"function");+ }}+ return rval(state,stream,"atom");}// stringif (ch == '"') {- if (doubleQuote(stream)) {- return rval(state,stream,"string");- }else{- return rval(state,stream,"error");- }+ state.in_string = (!doubleQuote(stream));+ return rval(state,stream,"string");}// variable- if (largeRE.test(ch)) {+ if (/[A-Z_Ø-ÞÀ-Ö]/.test(ch)) {stream.eatWhile(anumRE);return rval(state,stream,"variable");}// atom/keyword/BIF/function- if (smallRE.test(ch)) {+ if (/[a-z_ß-öø-ÿ]/.test(ch)) {stream.eatWhile(anumRE);- if (stream.peek() == "/") {- stream.next();- if (stream.eatWhile(digitRE)) {- return rval(state,stream,"fun"); // f/0 style fun- }else{- stream.backUp(1);- return rval(state,stream,"atom");- }+ if (stream.match(/\s*\/\s*[0-9]/,false)) {+ stream.match(/\s*\/\s*[0-9]/,true);+ return rval(state,stream,"fun"); // f/0 style fun}var w = stream.current();- if (isMember(w,keywordWords)) {- pushToken(state,stream);+ if (is_member(w,keywordWords)) {return rval(state,stream,"keyword");- }- if (stream.peek() == "(") {+ }else if (is_member(w,operatorAtomWords)) {+ return rval(state,stream,"operator");+ }else if (stream.match(/\s*\(/,false)) {// 'put' and 'erlang:put' are bifs, 'foo:put' is not- if (isMember(w,bifWords) &&- (!isPrev(stream,":") || isPrev(stream,"erlang:"))) {+ if (is_member(w,bifWords) &&+ ((peekToken(state).token != ":") ||+ (peekToken(state,2).token == "erlang"))) {return rval(state,stream,"builtin");+ }else if (is_member(w,guardWords)) {+ return rval(state,stream,"guard");}else{return rval(state,stream,"function");}- }- if (isMember(w,guardWords)) {- return rval(state,stream,"guard");- }- if (isMember(w,operatorWords)) {+ }else if (is_member(w,operatorAtomWords)) {return rval(state,stream,"operator");- }- if (stream.peek() == ":") {+ }else if (lookahead(stream) == ":") {if (w == "erlang") {return rval(state,stream,"builtin");} else {return rval(state,stream,"function");}+ }else if (is_member(w,["true","false"])) {+ return rval(state,stream,"boolean");+ }else if (is_member(w,["true","false"])) {+ return rval(state,stream,"boolean");+ }else{+ return rval(state,stream,"atom");}- return rval(state,stream,"atom");}// number+ var digitRE = /[0-9]/;+ var radixRE = /[0-9a-zA-Z]/; // 36#zZ style intif (digitRE.test(ch)) {stream.eatWhile(digitRE);- if (stream.eat('#')) {- stream.eatWhile(digitRE); // 16#10 style integer- } else {- if (stream.eat('.')) { // float- stream.eatWhile(digitRE);+ if (stream.eat('#')) { // 36#aZ style integer+ if (!stream.eatWhile(radixRE)) {+ stream.backUp(1); //"36#" - syntax error}- if (stream.eat(/[eE]/)) {- stream.eat(/[-+]/); // float with exponent- stream.eatWhile(digitRE);+ } else if (stream.eat('.')) { // float+ if (!stream.eatWhile(digitRE)) {+ stream.backUp(1); // "3." - probably end of function+ } else {+ if (stream.eat(/[eE]/)) { // float with exponent+ if (stream.eat(/[-+]/)) {+ if (!stream.eatWhile(digitRE)) {+ stream.backUp(2); // "2e-" - syntax error+ }+ } else {+ if (!stream.eatWhile(digitRE)) {+ stream.backUp(1); // "2e" - syntax error+ }+ }+ }}}return rval(state,stream,"number"); // normal integer@@ -269,39 +255,35 @@ CodeMirror.defineMode("erlang", function(cmCfg) {// open parensif (nongreedy(stream,openParenRE,openParenWords)) {- pushToken(state,stream);return rval(state,stream,"open_paren");}// close parensif (nongreedy(stream,closeParenRE,closeParenWords)) {- pushToken(state,stream);return rval(state,stream,"close_paren");}// separators- if (greedy(stream,sepRE,separatorWords)) {- // distinguish between "." as terminator and record field operator- if (state.context == false) {- pushToken(state,stream);- }+ if (greedy(stream,separatorRE,separatorWords)) {return rval(state,stream,"separator");}// operators- if (greedy(stream,symbolRE,symbolWords)) {+ if (greedy(stream,operatorSymbolRE,operatorSymbolWords)) {return rval(state,stream,"operator");}return rval(state,stream,null);}+/////////////////////////////////////////////////////////////////////////////+// utilitiesfunction nongreedy(stream,re,words) {if (stream.current().length == 1 && re.test(stream.current())) {stream.backUp(1);while (re.test(stream.peek())) {stream.next();- if (isMember(stream.current(),words)) {+ if (is_member(stream.current(),words)) {return true;}}@@ -316,7 +298,7 @@ CodeMirror.defineMode("erlang", function(cmCfg) {stream.next();}while (0 < stream.current().length) {- if (isMember(stream.current(),words)) {+ if (is_member(stream.current(),words)) {return true;}else{stream.backUp(1);@@ -347,116 +329,277 @@ CodeMirror.defineMode("erlang", function(cmCfg) {return false;}- function Token(stream) {- this.token = stream ? stream.current() : "";- this.column = stream ? stream.column() : 0;- this.indent = stream ? stream.indentation() : 0;+ function lookahead(stream) {+ var m = stream.match(/([\n\s]+|%[^\n]*\n)*(.)/,false);+ return m ? m.pop() : "";+ }++ function is_member(element,list) {+ return (-1 < list.indexOf(element));}- function myIndent(state,textAfter) {- var indent = cmCfg.indentUnit;- var outdentWords = ["after","catch"];- var token = (peekToken(state)).token;- var wordAfter = takewhile(textAfter,/[^a-z]/);+ function rval(state,stream,type) {- if (isMember(token,openParenWords)) {- return (peekToken(state)).column+token.length;- }else if (token == "." || token == ""){- return 0;- }else if (token == "->") {- if (wordAfter == "end") {- return peekToken(state,2).column;- }else if (peekToken(state,2).token == "fun") {- return peekToken(state,2).column+indent;- }else{- return (peekToken(state)).indent+indent;- }- }else if (isMember(wordAfter,outdentWords)) {- return (peekToken(state)).indent;- }else{- return (peekToken(state)).column+indent;+ // parse stack+ pushToken(state,realToken(type,stream));++ // map erlang token type to CodeMirror style class+ // erlang -> CodeMirror tag+ switch (type) {+ case "atom": return "atom";+ case "attribute": return "attribute";+ case "boolean": return "special";+ case "builtin": return "builtin";+ case "close_paren": return null;+ case "colon": return null;+ case "comment": return "comment";+ case "dot": return null;+ case "error": return "error";+ case "fun": return "meta";+ case "function": return "tag";+ case "guard": return "property";+ case "keyword": return "keyword";+ case "macro": return "variable-2";+ case "number": return "number";+ case "open_paren": return null;+ case "operator": return "operator";+ case "record": return "bracket";+ case "separator": return null;+ case "string": return "string";+ case "type": return "def";+ case "variable": return "variable";+ default: return null;}}- function takewhile(str,re) {- var m = str.match(re);- return m ? str.slice(0,m.index) : str;+ function aToken(tok,col,ind,typ) {+ return {token: tok,+ column: col,+ indent: ind,+ type: typ};}- function popToken(state) {- return state.tokenStack.pop();+ function realToken(type,stream) {+ return aToken(stream.current(),+ stream.column(),+ stream.indentation(),+ type);+ }++ function fakeToken(type) {+ return aToken(type,0,0,type);}function peekToken(state,depth) {var len = state.tokenStack.length;var dep = (depth ? depth : 1);+if (len < dep) {- return new Token;+ return false;}else{return state.tokenStack[len-dep];}}- function pushToken(state,stream) {- var token = stream.current();- var prev_token = peekToken(state).token;- if (isMember(token,ignoreWords)) {- return false;- }else if (drop_both(prev_token,token)) {- popToken(state);- return false;- }else if (drop_first(prev_token,token)) {- popToken(state);- return pushToken(state,stream);+ function pushToken(state,token) {++ if (!(token.type == "comment" || token.type == "whitespace")) {+ state.tokenStack = maybe_drop_pre(state.tokenStack,token);+ state.tokenStack = maybe_drop_post(state.tokenStack);+ }+ }++ function maybe_drop_pre(s,token) {+ var last = s.length-1;++ if (0 < last && s[last].type === "record" && token.type === "dot") {+ s.pop();+ }else if (0 < last && s[last].type === "group") {+ s.pop();+ s.push(token);}else{- state.tokenStack.push(new Token(stream));- return true;+ s.push(token);+ }+ return s;+ }++ function maybe_drop_post(s) {+ var last = s.length-1;++ if (s[last].type === "dot") {+ return [];+ }+ if (s[last].type === "fun" && s[last-1].token === "fun") {+ return s.slice(0,last-1);+ }+ switch (s[s.length-1].token) {+ case "}": return d(s,{g:["{"]});+ case "]": return d(s,{i:["["]});+ case ")": return d(s,{i:["("]});+ case ">>": return d(s,{i:["<<"]});+ case "end": return d(s,{i:["begin","case","fun","if","receive","try"]});+ case ",": return d(s,{e:["begin","try","when","->",+ ",","(","[","{","<<"]});+ case "->": return d(s,{r:["when"],+ m:["try","if","case","receive"]});+ case ";": return d(s,{E:["case","fun","if","receive","try","when"]});+ case "catch":return d(s,{e:["try"]});+ case "of": return d(s,{e:["case"]});+ case "after":return d(s,{e:["receive","try"]});+ default: return s;}}- function drop_first(open, close) {- switch (open+" "+close) {- case "when ->": return true;- case "-> end": return true;- case "-> .": return true;- case ". .": return true;- default: return false;+ function d(stack,tt) {+ // stack is a stack of Token objects.+ // tt is an object; {type:tokens}+ // type is a char, tokens is a list of token strings.+ // The function returns (possibly truncated) stack.+ // It will descend the stack, looking for a Token such that Token.token+ // is a member of tokens. If it does not find that, it will normally (but+ // see "E" below) return stack. If it does find a match, it will remove+ // all the Tokens between the top and the matched Token.+ // If type is "m", that is all it does.+ // If type is "i", it will also remove the matched Token and the top Token.+ // If type is "g", like "i", but add a fake "group" token at the top.+ // If type is "r", it will remove the matched Token, but not the top Token.+ // If type is "e", it will keep the matched Token but not the top Token.+ // If type is "E", it behaves as for type "e", except if there is no match,+ // in which case it will return an empty stack.++ for (var type in tt) {+ var len = stack.length-1;+ var tokens = tt[type];+ for (var i = len-1; -1 < i ; i--) {+ if (is_member(stack[i].token,tokens)) {+ var ss = stack.slice(0,i);+ switch (type) {+ case "m": return ss.concat(stack[i]).concat(stack[len]);+ case "r": return ss.concat(stack[len]);+ case "i": return ss;+ case "g": return ss.concat(fakeToken("group"));+ case "E": return ss.concat(stack[i]);+ case "e": return ss.concat(stack[i]);+ }+ }+ }}+ return (type == "E" ? [] : stack);}- function drop_both(open, close) {- switch (open+" "+close) {- case "( )": return true;- case "[ ]": return true;- case "{ }": return true;- case "<< >>": return true;- case "begin end": return true;- case "case end": return true;- case "fun end": return true;- case "if end": return true;- case "receive end": return true;- case "try end": return true;- case "-> ;": return true;- default: return false;+/////////////////////////////////////////////////////////////////////////////+// indenter++ function indenter(state,textAfter) {+ var t;+ var unit = cmCfg.indentUnit;+ var wordAfter = wordafter(textAfter);+ var currT = peekToken(state,1);+ var prevT = peekToken(state,2);++ if (state.in_string || state.in_atom) {+ return CodeMirror.Pass;+ }else if (!prevT) {+ return 0;+ }else if (currT.token == "when") {+ return currT.column+unit;+ }else if (wordAfter === "when" && prevT.type === "function") {+ return prevT.indent+unit;+ }else if (wordAfter === "(" && currT.token === "fun") {+ return currT.column+3;+ }else if (wordAfter === "catch" && (t = getToken(state,["try"]))) {+ return t.column;+ }else if (is_member(wordAfter,["end","after","of"])) {+ t = getToken(state,["begin","case","fun","if","receive","try"]);+ return t ? t.column : CodeMirror.Pass;+ }else if (is_member(wordAfter,closeParenWords)) {+ t = getToken(state,openParenWords);+ return t ? t.column : CodeMirror.Pass;+ }else if (is_member(currT.token,[",","|","||"]) ||+ is_member(wordAfter,[",","|","||"])) {+ t = postcommaToken(state);+ return t ? t.column+t.token.length : unit;+ }else if (currT.token == "->") {+ if (is_member(prevT.token, ["receive","case","if","try"])) {+ return prevT.column+unit+unit;+ }else{+ return prevT.column+unit;+ }+ }else if (is_member(currT.token,openParenWords)) {+ return currT.column+currT.token.length;+ }else{+ t = defaultToken(state);+ return truthy(t) ? t.column+unit : 0;}}+ function wordafter(str) {+ var m = str.match(/,|[a-z]+|\}|\]|\)|>>|\|+|\(/);++ return truthy(m) && (m.index === 0) ? m[0] : "";+ }++ function postcommaToken(state) {+ var objs = state.tokenStack.slice(0,-1);+ var i = getTokenIndex(objs,"type",["open_paren"]);++ return truthy(objs[i]) ? objs[i] : false;+ }++ function defaultToken(state) {+ var objs = state.tokenStack;+ var stop = getTokenIndex(objs,"type",["open_paren","separator","keyword"]);+ var oper = getTokenIndex(objs,"type",["operator"]);++ if (truthy(stop) && truthy(oper) && stop < oper) {+ return objs[stop+1];+ } else if (truthy(stop)) {+ return objs[stop];+ } else {+ return false;+ }+ }++ function getToken(state,tokens) {+ var objs = state.tokenStack;+ var i = getTokenIndex(objs,"token",tokens);++ return truthy(objs[i]) ? objs[i] : false;+ }++ function getTokenIndex(objs,propname,propvals) {++ for (var i = objs.length-1; -1 < i ; i--) {+ if (is_member(objs[i][propname],propvals)) {+ return i;+ }+ }+ return false;+ }++ function truthy(x) {+ return (x !== false) && (x != null);+ }++/////////////////////////////////////////////////////////////////////////////+// this object defines the mode+return {startState:function() {return {tokenStack: [],- context: false,- lastToken: null};+ in_string: false,+ in_atom: false};},token:function(stream, state) {- return tokenize(stream, state);+ return tokenizer(stream, state);},indent:function(state, textAfter) {- return myIndent(state,textAfter);+ return indenter(state,textAfter);},lineComment: "%"diff --git a/data/ext/editorText/codemirror/mode/erlang/index.html b/data/ext/editorText/codemirror/mode/erlang/index.htmlindex fd21521c8..9cacb759f 100644--- a/data/ext/editorText/codemirror/mode/erlang/index.html+++ b/data/ext/editorText/codemirror/mode/erlang/index.html@@ -1,19 +1,31 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Erlang mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="../../addon/edit/matchbrackets.js"></script>- <script src="erlang.js"></script>- <link rel="stylesheet" href="../../theme/erlang-dark.css">- <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>- <link rel="stylesheet" href="../../doc/docs.css">- </head>- <body>- <h1>CodeMirror: Erlang mode</h1>+<title>CodeMirror: Erlang mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<link rel="stylesheet" href="../../theme/erlang-dark.css">+<script src="../../lib/codemirror.js"></script>+<script src="../../addon/edit/matchbrackets.js"></script>+<script src="erlang.js"></script>+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Erlang</a>+ </ul>+</div>++<article>+<h2>Erlang mode</h2><form><textarea id="code" name="code">%% -*- mode: erlang; erlang-indent-level: 2 -*-%%% Created : 7 May 2012 by mats cronqvist <[email protected]>@@ -32,18 +44,19 @@rec_info(demo) -> record_info(fields,demo).demo() -> expand_recs(?MODULE,#demo{a="A",b="BB"}).-+expand_recs(M,List) when is_list(List) ->[expand_recs(M,L)||L<-List];expand_recs(M,Tup) when is_tuple(Tup) ->case tuple_size(Tup) ofL when L < 1 -> Tup;L ->- try Fields = M:rec_info(element(1,Tup)),- L = length(Fields)+1,- lists:zip(Fields,expand_recs(M,tl(tuple_to_list(Tup))))- catch _:_ ->- list_to_tuple(expand_recs(M,tuple_to_list(Tup)))+ try+ Fields = M:rec_info(element(1,Tup)),+ L = length(Fields)+1,+ lists:zip(Fields,expand_recs(M,tl(tuple_to_list(Tup))))+ catch+ _:_ -> list_to_tuple(expand_recs(M,tuple_to_list(Tup)))endend;expand_recs(_,Term) ->@@ -60,5 +73,4 @@ expand_recs(_,Term) -></script><p><strong>MIME types defined:</strong> <code>text/x-erlang</code>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/fortran/fortran.js b/data/ext/editorText/codemirror/mode/fortran/fortran.jsnew file mode 100644index 000000000..83fd8fde8--- /dev/null+++ b/data/ext/editorText/codemirror/mode/fortran/fortran.js@@ -0,0 +1,173 @@+CodeMirror.defineMode("fortran", function() {+ function words(array) {+ var keys = {};+ for (var i = 0; i < array.length; ++i) {+ keys[array[i]] = true;+ }+ return keys;+ }++ var keywords = words([+ "abstract", "accept", "allocatable", "allocate",+ "array", "assign", "asynchronous", "backspace",+ "bind", "block", "byte", "call", "case",+ "class", "close", "common", "contains",+ "continue", "cycle", "data", "deallocate",+ "decode", "deferred", "dimension", "do",+ "elemental", "else", "encode", "end",+ "endif", "entry", "enumerator", "equivalence",+ "exit", "external", "extrinsic", "final",+ "forall", "format", "function", "generic",+ "go", "goto", "if", "implicit", "import", "include",+ "inquire", "intent", "interface", "intrinsic",+ "module", "namelist", "non_intrinsic",+ "non_overridable", "none", "nopass",+ "nullify", "open", "optional", "options",+ "parameter", "pass", "pause", "pointer",+ "print", "private", "program", "protected",+ "public", "pure", "read", "recursive", "result",+ "return", "rewind", "save", "select", "sequence",+ "stop", "subroutine", "target", "then", "to", "type",+ "use", "value", "volatile", "where", "while",+ "write"]);+ var builtins = words(["abort", "abs", "access", "achar", "acos",+ "adjustl", "adjustr", "aimag", "aint", "alarm",+ "all", "allocated", "alog", "amax", "amin",+ "amod", "and", "anint", "any", "asin",+ "associated", "atan", "besj", "besjn", "besy",+ "besyn", "bit_size", "btest", "cabs", "ccos",+ "ceiling", "cexp", "char", "chdir", "chmod",+ "clog", "cmplx", "command_argument_count",+ "complex", "conjg", "cos", "cosh", "count",+ "cpu_time", "cshift", "csin", "csqrt", "ctime",+ "c_funloc", "c_loc", "c_associated", "c_null_ptr",+ "c_null_funptr", "c_f_pointer", "c_null_char",+ "c_alert", "c_backspace", "c_form_feed",+ "c_new_line", "c_carriage_return",+ "c_horizontal_tab", "c_vertical_tab", "dabs",+ "dacos", "dasin", "datan", "date_and_time",+ "dbesj", "dbesj", "dbesjn", "dbesy", "dbesy",+ "dbesyn", "dble", "dcos", "dcosh", "ddim", "derf",+ "derfc", "dexp", "digits", "dim", "dint", "dlog",+ "dlog", "dmax", "dmin", "dmod", "dnint",+ "dot_product", "dprod", "dsign", "dsinh",+ "dsin", "dsqrt", "dtanh", "dtan", "dtime",+ "eoshift", "epsilon", "erf", "erfc", "etime",+ "exit", "exp", "exponent", "extends_type_of",+ "fdate", "fget", "fgetc", "float", "floor",+ "flush", "fnum", "fputc", "fput", "fraction",+ "fseek", "fstat", "ftell", "gerror", "getarg",+ "get_command", "get_command_argument",+ "get_environment_variable", "getcwd",+ "getenv", "getgid", "getlog", "getpid",+ "getuid", "gmtime", "hostnm", "huge", "iabs",+ "iachar", "iand", "iargc", "ibclr", "ibits",+ "ibset", "ichar", "idate", "idim", "idint",+ "idnint", "ieor", "ierrno", "ifix", "imag",+ "imagpart", "index", "int", "ior", "irand",+ "isatty", "ishft", "ishftc", "isign",+ "iso_c_binding", "is_iostat_end", "is_iostat_eor",+ "itime", "kill", "kind", "lbound", "len", "len_trim",+ "lge", "lgt", "link", "lle", "llt", "lnblnk", "loc",+ "log", "logical", "long", "lshift", "lstat", "ltime",+ "matmul", "max", "maxexponent", "maxloc", "maxval",+ "mclock", "merge", "move_alloc", "min", "minexponent",+ "minloc", "minval", "mod", "modulo", "mvbits",+ "nearest", "new_line", "nint", "not", "or", "pack",+ "perror", "precision", "present", "product", "radix",+ "rand", "random_number", "random_seed", "range",+ "real", "realpart", "rename", "repeat", "reshape",+ "rrspacing", "rshift", "same_type_as", "scale",+ "scan", "second", "selected_int_kind",+ "selected_real_kind", "set_exponent", "shape",+ "short", "sign", "signal", "sinh", "sin", "sleep",+ "sngl", "spacing", "spread", "sqrt", "srand", "stat",+ "sum", "symlnk", "system", "system_clock", "tan",+ "tanh", "time", "tiny", "transfer", "transpose",+ "trim", "ttynam", "ubound", "umask", "unlink",+ "unpack", "verify", "xor", "zabs", "zcos", "zexp",+ "zlog", "zsin", "zsqrt"]);++ var dataTypes = words(["c_bool", "c_char", "c_double", "c_double_complex",+ "c_float", "c_float_complex", "c_funptr", "c_int",+ "c_int16_t", "c_int32_t", "c_int64_t", "c_int8_t",+ "c_int_fast16_t", "c_int_fast32_t", "c_int_fast64_t",+ "c_int_fast8_t", "c_int_least16_t", "c_int_least32_t",+ "c_int_least64_t", "c_int_least8_t", "c_intmax_t",+ "c_intptr_t", "c_long", "c_long_double",+ "c_long_double_complex", "c_long_long", "c_ptr",+ "c_short", "c_signed_char", "c_size_t", "character",+ "complex", "double", "integer", "logical", "real"]);+ var isOperatorChar = /[+\-*&=<>\/\:]/;+ var litOperator = new RegExp("(\.and\.|\.or\.|\.eq\.|\.lt\.|\.le\.|\.gt\.|\.ge\.|\.ne\.|\.not\.|\.eqv\.|\.neqv\.)", "i");++ function tokenBase(stream, state) {++ if (stream.match(litOperator)){+ return 'operator';+ }++ var ch = stream.next();+ if (ch == "!") {+ stream.skipToEnd();+ return "comment";+ }+ if (ch == '"' || ch == "'") {+ state.tokenize = tokenString(ch);+ return state.tokenize(stream, state);+ }+ if (/[\[\]\(\),]/.test(ch)) {+ return null;+ }+ if (/\d/.test(ch)) {+ stream.eatWhile(/[\w\.]/);+ return "number";+ }+ if (isOperatorChar.test(ch)) {+ stream.eatWhile(isOperatorChar);+ return "operator";+ }+ stream.eatWhile(/[\w\$_]/);+ var word = stream.current().toLowerCase();++ if (keywords.hasOwnProperty(word)){+ return 'keyword';+ }+ if (builtins.hasOwnProperty(word) || dataTypes.hasOwnProperty(word)) {+ return 'builtin';+ }+ return "variable";+ }++ function tokenString(quote) {+ return function(stream, state) {+ var escaped = false, next, end = false;+ while ((next = stream.next()) != null) {+ if (next == quote && !escaped) {+ end = true;+ break;+ }+ escaped = !escaped && next == "\\";+ }+ if (end || !escaped) state.tokenize = null;+ return "string";+ };+ }++ // Interface++ return {+ startState: function() {+ return {tokenize: null};+ },++ token: function(stream, state) {+ if (stream.eatSpace()) return null;+ var style = (state.tokenize || tokenBase)(stream, state);+ if (style == "comment" || style == "meta") return style;+ return style;+ }+ };+});++CodeMirror.defineMIME("text/x-fortran", "fortran");diff --git a/data/ext/editorText/codemirror/mode/fortran/index.html b/data/ext/editorText/codemirror/mode/fortran/index.htmlnew file mode 100644index 000000000..efa55ec89--- /dev/null+++ b/data/ext/editorText/codemirror/mode/fortran/index.html@@ -0,0 +1,81 @@+<!doctype html>++<title>CodeMirror: Fortran mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="fortran.js"></script>+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Fortran</a>+ </ul>+</div>++<article>+<h2>Fortran mode</h2>+++<div><textarea id="code" name="code">+! Example Fortran code+ program average++ ! Read in some numbers and take the average+ ! As written, if there are no data points, an average of zero is returned+ ! While this may not be desired behavior, it keeps this example simple++ implicit none++ real, dimension(:), allocatable :: points+ integer :: number_of_points+ real :: average_points=0., positive_average=0., negative_average=0.++ write (*,*) "Input number of points to average:"+ read (*,*) number_of_points++ allocate (points(number_of_points))++ write (*,*) "Enter the points to average:"+ read (*,*) points++ ! Take the average by summing points and dividing by number_of_points+ if (number_of_points > 0) average_points = sum(points) / number_of_points++ ! Now form average over positive and negative points only+ if (count(points > 0.) > 0) then+ positive_average = sum(points, points > 0.) / count(points > 0.)+ end if++ if (count(points < 0.) > 0) then+ negative_average = sum(points, points < 0.) / count(points < 0.)+ end if++ deallocate (points)++ ! Print result to terminal+ write (*,'(a,g12.4)') 'Average = ', average_points+ write (*,'(a,g12.4)') 'Average of positive points = ', positive_average+ write (*,'(a,g12.4)') 'Average of negative points = ', negative_average++ end program average+</textarea></div>++ <script>+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {+ lineNumbers: true,+ mode: "text/x-fortran"+ });+ </script>++ <p><strong>MIME types defined:</strong> <code>text/x-Fortran</code>.</p>+ </article>diff --git a/data/ext/editorText/codemirror/mode/gas/gas.js b/data/ext/editorText/codemirror/mode/gas/gas.jsindex a6e689290..0606b18e3 100644--- a/data/ext/editorText/codemirror/mode/gas/gas.js+++ b/data/ext/editorText/codemirror/mode/gas/gas.js@@ -211,7 +211,7 @@ CodeMirror.defineMode("gas", function(_config, parserConfig) {});}- var arch = parserConfig.architecture.toLowerCase();+ var arch = (parserConfig.architecture || "x86").toLowerCase();if (arch === "x86") {x86(parserConfig);} else if (arch === "arm" || arch === "armv6") {diff --git a/data/ext/editorText/codemirror/mode/gas/index.html b/data/ext/editorText/codemirror/mode/gas/index.htmlindex 7684bc18d..cd8a2ff5a 100644--- a/data/ext/editorText/codemirror/mode/gas/index.html+++ b/data/ext/editorText/codemirror/mode/gas/index.html@@ -1,18 +1,30 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Gas mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="gas.js"></script>- <link rel="stylesheet" href="../../doc/docs.css">- <style>.CodeMirror {border: 2px inset #dee;}</style>- </head>- <body>- <h1>CodeMirror: Gas mode</h1>-- <form>++<title>CodeMirror: Gas mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="gas.js"></script>+<style>.CodeMirror {border: 2px inset #dee;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Gas</a>+ </ul>+</div>++<article>+<h2>Gas mode</h2>+<form><textarea id="code" name="code">.syntax unified.global main@@ -53,5 +65,4 @@ message:directives for the supplied architecture.<p><strong>MIME types defined:</strong> <code>text/x-gas</code></p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/gfm/gfm.js b/data/ext/editorText/codemirror/mode/gfm/gfm.jsindex 1179b53dc..10d5e05c0 100644--- a/data/ext/editorText/codemirror/mode/gfm/gfm.js+++ b/data/ext/editorText/codemirror/mode/gfm/gfm.js@@ -1,4 +1,4 @@-CodeMirror.defineMode("gfm", function(config) {+CodeMirror.defineMode("gfm", function(config, modeConfig) {var codeDepth = 0;function blankLine(state) {state.code = false;@@ -75,7 +75,8 @@ CodeMirror.defineMode("gfm", function(config) {return "link";}}- if (stream.match(/^((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i)) {+ if (stream.match(/^((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i) &&+ stream.string.slice(stream.start - 2, stream.start) != "](") {// URLs// Taken from http://daringfireball.net/2010/07/improved_regex_for_matching_urls// And then (issue #1160) simplified to make it not crash the Chrome Regexp engine@@ -86,11 +87,16 @@ CodeMirror.defineMode("gfm", function(config) {},blankLine: blankLine};- CodeMirror.defineMIME("gfmBase", {- name: "markdown",++ var markdownConfig = {underscoresBreakWords: false,taskLists: true,fencedCodeBlocks: true- });+ };+ for (var attr in modeConfig) {+ markdownConfig[attr] = modeConfig[attr];+ }+ markdownConfig.name = "markdown";+ CodeMirror.defineMIME("gfmBase", markdownConfig);return CodeMirror.overlayMode(CodeMirror.getMode(config, "gfmBase"), gfmOverlay);}, "markdown");diff --git a/data/ext/editorText/codemirror/mode/gfm/index.html b/data/ext/editorText/codemirror/mode/gfm/index.htmlindex 826a96d2d..b71cd5c75 100644--- a/data/ext/editorText/codemirror/mode/gfm/index.html+++ b/data/ext/editorText/codemirror/mode/gfm/index.html@@ -1,27 +1,36 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: GFM mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="../../addon/mode/overlay.js"></script>- <script src="../xml/xml.js"></script>- <script src="../markdown/markdown.js"></script>- <script src="gfm.js"></script>-- <!-- Code block highlighting modes -->- <script src="../javascript/javascript.js"></script>- <script src="../css/css.js"></script>- <script src="../htmlmixed/htmlmixed.js"></script>- <script src="../clike/clike.js"></script>-- <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>- <link rel="stylesheet" href="../../doc/docs.css">- </head>- <body>- <h1>CodeMirror: GFM mode</h1>+<title>CodeMirror: GFM mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="../../addon/mode/overlay.js"></script>+<script src="../xml/xml.js"></script>+<script src="../markdown/markdown.js"></script>+<script src="gfm.js"></script>+<script src="../javascript/javascript.js"></script>+<script src="../css/css.js"></script>+<script src="../htmlmixed/htmlmixed.js"></script>+<script src="../clike/clike.js"></script>+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">GFM</a>+ </ul>+</div>++<article>+<h2>GFM mode</h2><form><textarea id="code" name="code">GitHub Flavored Markdown========================@@ -70,5 +79,4 @@ See http://github.github.com/github-flavored-markdown/.<p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#gfm_*">normal</a>, <a href="../../test/index.html#verbose,gfm_*">verbose</a>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/gfm/test.js b/data/ext/editorText/codemirror/mode/gfm/test.jsindex 3ccaec501..e5c3486eb 100644--- a/data/ext/editorText/codemirror/mode/gfm/test.js+++ b/data/ext/editorText/codemirror/mode/gfm/test.js@@ -1,6 +1,23 @@(function() {var mode = CodeMirror.getMode({tabSize: 4}, "gfm");function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }+ var modeHighlightFormatting = CodeMirror.getMode({tabSize: 4}, {name: "gfm", highlightFormatting: true});+ function FT(name) { test.mode(name, modeHighlightFormatting, Array.prototype.slice.call(arguments, 1)); }++ FT("codeBackticks",+ "[comment&formatting&formatting-code `][comment foo][comment&formatting&formatting-code `]");++ FT("doubleBackticks",+ "[comment&formatting&formatting-code ``][comment foo ` bar][comment&formatting&formatting-code ``]");++ FT("codeBlock",+ "[comment&formatting&formatting-code-block ```css]",+ "[tag foo]",+ "[comment&formatting&formatting-code-block ```]");++ FT("taskList",+ "[variable-2&formatting&formatting-list&formatting-list-ul - ][meta&formatting&formatting-task [ ]]][variable-2 foo]",+ "[variable-2&formatting&formatting-list&formatting-list-ul - ][property&formatting&formatting-task [x]]][variable-2 foo]");MT("emInWordAsterisk","foo[em *bar*]hello");@@ -97,7 +114,7 @@MT("notALink","[comment ```css]",- "[tag foo] {[property color][operator :][keyword black];}",+ "[tag foo] {[property color]:[keyword black];}","[comment ```][link http://www.example.com/]");MT("notALink",diff --git a/data/ext/editorText/codemirror/mode/gherkin/gherkin.js b/data/ext/editorText/codemirror/mode/gherkin/gherkin.jsnew file mode 100644index 000000000..685b373df--- /dev/null+++ b/data/ext/editorText/codemirror/mode/gherkin/gherkin.js@@ -0,0 +1,163 @@+/*+Gherkin mode - http://www.cukes.info/+Report bugs/issues here: https://github.com/marijnh/CodeMirror/issues+*/++// Following Objs from Brackets implementation: https://github.com/tregusti/brackets-gherkin/blob/master/main.js+//var Quotes = {+// SINGLE: 1,+// DOUBLE: 2+//};++//var regex = {+// keywords: /(Feature| {2}(Scenario|In order to|As|I)| {4}(Given|When|Then|And))/+//};++CodeMirror.defineMode("gherkin", function () {+ return {+ startState: function () {+ return {+ lineNumber: 0,+ tableHeaderLine: false,+ allowFeature: true,+ allowBackground: false,+ allowScenario: false,+ allowSteps: false,+ allowPlaceholders: false,+ allowMultilineArgument: false,+ inMultilineString: false,+ inMultilineTable: false,+ inKeywordLine: false+ };+ },+ token: function (stream, state) {+ if (stream.sol()) {+ state.lineNumber++;+ state.inKeywordLine = false;+ if (state.inMultilineTable) {+ state.tableHeaderLine = false;+ if (!stream.match(/\s*\|/, false)) {+ state.allowMultilineArgument = false;+ state.inMultilineTable = false;+ }+ }+ }++ stream.eatSpace();++ if (state.allowMultilineArgument) {++ // STRING+ if (state.inMultilineString) {+ if (stream.match('"""')) {+ state.inMultilineString = false;+ state.allowMultilineArgument = false;+ } else {+ stream.match(/.*/);+ }+ return "string";+ }++ // TABLE+ if (state.inMultilineTable) {+ if (stream.match(/\|\s*/)) {+ return "bracket";+ } else {+ stream.match(/[^\|]*/);+ return state.tableHeaderLine ? "header" : "string";+ }+ }++ // DETECT START+ if (stream.match('"""')) {+ // String+ state.inMultilineString = true;+ return "string";+ } else if (stream.match("|")) {+ // Table+ state.inMultilineTable = true;+ state.tableHeaderLine = true;+ return "bracket";+ }++ }++ // LINE COMMENT+ if (stream.match(/#.*/)) {+ return "comment";++ // TAG+ } else if (!state.inKeywordLine && stream.match(/@\S+/)) {+ return "tag";++ // FEATURE+ } else if (!state.inKeywordLine && state.allowFeature && stream.match(/(機能|功能|フィーチャ|기능|โครงหลัก|ความสามารถ|ความต้องการทางธุรกิจ|ಹೆಚ್ಚಳ|గుణము|ਮੁਹਾਂਦਰਾ|ਨਕਸ਼ ਨੁਹਾਰ|ਖਾਸੀਅਤ|रूप लेख|وِیژگی|خاصية|תכונה|Функціонал|Функция|Функционалност|Функционал|Үзенчәлеклелек|Свойство|Особина|Мөмкинлек|Могућност|Λειτουργία|Δυνατότητα|Właściwość|Vlastnosť|Trajto|Tính năng|Savybė|Pretty much|Požiadavka|Požadavek|Potrzeba biznesowa|Özellik|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Hwæt|Hwaet|Funzionalità|Funktionalitéit|Funktionalität|Funkcja|Funkcionalnost|Funkcionalitāte|Funkcia|Fungsi|Functionaliteit|Funcționalitate|Funcţionalitate|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalité|Fitur|Fīča|Feature|Eiginleiki|Egenskap|Egenskab|Característica|Caracteristica|Business Need|Aspekt|Arwedd|Ahoy matey!|Ability):/)) {+ state.allowScenario = true;+ state.allowBackground = true;+ state.allowPlaceholders = false;+ state.allowSteps = false;+ state.allowMultilineArgument = false;+ state.inKeywordLine = true;+ return "keyword";++ // BACKGROUND+ } else if (!state.inKeywordLine && state.allowBackground && stream.match(/(背景|배경|แนวคิด|ಹಿನ್ನೆಲೆ|నేపథ్యం|ਪਿਛੋਕੜ|पृष्ठभूमि|زمینه|الخلفية|רקע|Тарих|Предыстория|Предистория|Позадина|Передумова|Основа|Контекст|Кереш|Υπόβαθρο|Założenia|Yo\-ho\-ho|Tausta|Taust|Situācija|Rerefons|Pozadina|Pozadie|Pozadí|Osnova|Latar Belakang|Kontext|Konteksts|Kontekstas|Kontekst|Háttér|Hannergrond|Grundlage|Geçmiş|Fundo|Fono|First off|Dis is what went down|Dasar|Contexto|Contexte|Context|Contesto|Cenário de Fundo|Cenario de Fundo|Cefndir|Bối cảnh|Bakgrunnur|Bakgrunn|Bakgrund|Baggrund|Background|B4|Antecedents|Antecedentes|Ær|Aer|Achtergrond):/)) {+ state.allowPlaceholders = false;+ state.allowSteps = true;+ state.allowBackground = false;+ state.allowMultilineArgument = false;+ state.inKeywordLine = true;+ return "keyword";++ // SCENARIO OUTLINE+ } else if (!state.inKeywordLine && state.allowScenario && stream.match(/(場景大綱|场景大纲|劇本大綱|剧本大纲|テンプレ|シナリオテンプレート|シナリオテンプレ|シナリオアウトライン|시나리오 개요|สรุปเหตุการณ์|โครงสร้างของเหตุการณ์|ವಿವರಣೆ|కథనం|ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਟਕਥਾ ਢਾਂਚਾ|परिदृश्य रूपरेखा|سيناريو مخطط|الگوی سناریو|תבנית תרחיש|Сценарийның төзелеше|Сценарий структураси|Структура сценарію|Структура сценария|Структура сценарија|Скица|Рамка на сценарий|Концепт|Περιγραφή Σεναρίου|Wharrimean is|Template Situai|Template Senario|Template Keadaan|Tapausaihio|Szenariogrundriss|Szablon scenariusza|Swa hwær swa|Swa hwaer swa|Struktura scenarija|Structură scenariu|Structura scenariu|Skica|Skenario konsep|Shiver me timbers|Senaryo taslağı|Schema dello scenario|Scenariomall|Scenariomal|Scenario Template|Scenario Outline|Scenario Amlinellol|Scenārijs pēc parauga|Scenarijaus šablonas|Reckon it's like|Raamstsenaarium|Plang vum Szenario|Plan du Scénario|Plan du scénario|Osnova scénáře|Osnova Scenára|Náčrt Scenáru|Náčrt Scénáře|Náčrt Scenára|MISHUN SRSLY|Menggariskan Senario|Lýsing Dæma|Lýsing Atburðarásar|Konturo de la scenaro|Koncept|Khung tình huống|Khung kịch bản|Forgatókönyv vázlat|Esquema do Cenário|Esquema do Cenario|Esquema del escenario|Esquema de l'escenari|Esbozo do escenario|Delineação do Cenário|Delineacao do Cenario|All y'all|Abstrakt Scenario|Abstract Scenario):/)) {+ state.allowPlaceholders = true;+ state.allowSteps = true;+ state.allowMultilineArgument = false;+ state.inKeywordLine = true;+ return "keyword";++ // EXAMPLES+ } else if (state.allowScenario && stream.match(/(例子|例|サンプル|예|ชุดของเหตุการณ์|ชุดของตัวอย่าง|ಉದಾಹರಣೆಗಳು|ఉదాహరణలు|ਉਦਾਹਰਨਾਂ|उदाहरण|نمونه ها|امثلة|דוגמאות|Үрнәкләр|Сценарији|Примеры|Примери|Приклади|Мисоллар|Мисаллар|Σενάρια|Παραδείγματα|You'll wanna|Voorbeelden|Variantai|Tapaukset|Se þe|Se the|Se ðe|Scenarios|Scenariji|Scenarijai|Przykłady|Primjeri|Primeri|Příklady|Príklady|Piemēri|Példák|Pavyzdžiai|Paraugs|Örnekler|Juhtumid|Exemplos|Exemples|Exemple|Exempel|EXAMPLZ|Examples|Esempi|Enghreifftiau|Ekzemploj|Eksempler|Ejemplos|Dữ liệu|Dead men tell no tales|Dæmi|Contoh|Cenários|Cenarios|Beispiller|Beispiele|Atburðarásir):/)) {+ state.allowPlaceholders = false;+ state.allowSteps = true;+ state.allowBackground = false;+ state.allowMultilineArgument = true;+ return "keyword";++ // SCENARIO+ } else if (!state.inKeywordLine && state.allowScenario && stream.match(/(場景|场景|劇本|剧本|シナリオ|시나리오|เหตุการณ์|ಕಥಾಸಾರಾಂಶ|సన్నివేశం|ਪਟਕਥਾ|परिदृश्य|سيناريو|سناریو|תרחיש|Сценарій|Сценарио|Сценарий|Пример|Σενάριο|Tình huống|The thing of it is|Tapaus|Szenario|Swa|Stsenaarium|Skenario|Situai|Senaryo|Senario|Scenaro|Scenariusz|Scenariu|Scénario|Scenario|Scenarijus|Scenārijs|Scenarij|Scenarie|Scénář|Scenár|Primer|MISHUN|Kịch bản|Keadaan|Heave to|Forgatókönyv|Escenario|Escenari|Cenário|Cenario|Awww, look mate|Atburðarás):/)) {+ state.allowPlaceholders = false;+ state.allowSteps = true;+ state.allowBackground = false;+ state.allowMultilineArgument = false;+ state.inKeywordLine = true;+ return "keyword";++ // STEPS+ } else if (!state.inKeywordLine && state.allowSteps && stream.match(/(那麼|那么|而且|當|当|并且|同時|同时|前提|假设|假設|假定|假如|但是|但し|並且|もし|ならば|ただし|しかし|かつ|하지만|조건|먼저|만일|만약|단|그리고|그러면|และ |เมื่อ |แต่ |ดังนั้น |กำหนดให้ |ಸ್ಥಿತಿಯನ್ನು |ಮತ್ತು |ನೀಡಿದ |ನಂತರ |ಆದರೆ |మరియు |చెప్పబడినది |కాని |ఈ పరిస్థితిలో |అప్పుడు |ਪਰ |ਤਦ |ਜੇਕਰ |ਜਿਵੇਂ ਕਿ |ਜਦੋਂ |ਅਤੇ |यदि |परन्तु |पर |तब |तदा |तथा |जब |चूंकि |किन्तु |कदा |और |अगर |و |هنگامی |متى |لكن |عندما |ثم |بفرض |با فرض |اما |اذاً |آنگاه |כאשר |וגם |בהינתן |אזי |אז |אבל |Якщо |Һәм |Унда |Тоді |Тогда |То |Также |Та |Пусть |Припустимо, що |Припустимо |Онда |Но |Нехай |Нәтиҗәдә |Лекин |Ләкин |Коли |Когда |Когато |Када |Кад |К тому же |І |И |Задато |Задати |Задате |Если |Допустим |Дано |Дадено |Вә |Ва |Бирок |Әмма |Әйтик |Әгәр |Аммо |Али |Але |Агар |А також |А |Τότε |Όταν |Και |Δεδομένου |Αλλά |Þurh |Þegar |Þa þe |Þá |Þa |Zatati |Zakładając |Zadato |Zadate |Zadano |Zadani |Zadan |Za předpokladu |Za predpokladu |Youse know when youse got |Youse know like when |Yna |Yeah nah |Y'know |Y |Wun |Wtedy |When y'all |When |Wenn |WEN |wann |Ve |Và |Und |Un |ugeholl |Too right |Thurh |Thì |Then y'all |Then |Tha the |Tha |Tetapi |Tapi |Tak |Tada |Tad |Stel |Soit |Siis |Și |Şi |Si |Sed |Se |Så |Quando |Quand |Quan |Pryd |Potom |Pokud |Pokiaľ |Però |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |Niin |Nhưng |När |Når |Mutta |Men |Mas |Maka |Majd |Mając |Mais |Maar |mä |Ma |Lorsque |Lorsqu'|Logo |Let go and haul |Kun |Kuid |Kui |Kiedy |Khi |Ketika |Kemudian |Keď |Když |Kaj |Kai |Kada |Kad |Jeżeli |Jeśli |Ja |It's just unbelievable |Ir |I CAN HAZ |I |Ha |Givun |Givet |Given y'all |Given |Gitt |Gegeven |Gegeben seien |Gegeben sei |Gdy |Gangway! |Fakat |Étant donnés |Etant donnés |Étant données |Etant données |Étant donnée |Etant donnée |Étant donné |Etant donné |Et |És |Entonces |Entón |Então |Entao |En |Eğer ki |Ef |Eeldades |E |Ðurh |Duota |Dun |Donitaĵo |Donat |Donada |Do |Diyelim ki |Diberi |Dengan |Den youse gotta |DEN |De |Dato |Dați fiind |Daţi fiind |Dati fiind |Dati |Date fiind |Date |Data |Dat fiind |Dar |Dann |dann |Dan |Dados |Dado |Dadas |Dada |Ða ðe |Ða |Cuando |Cho |Cando |Când |Cand |Cal |But y'all |But at the end of the day I reckon |BUT |But |Buh |Blimey! |Biết |Bet |Bagi |Aye |awer |Avast! |Atunci |Atesa |Atès |Apabila |Anrhegedig a |Angenommen |And y'all |And |AN |An |an |Amikor |Amennyiben |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Ak |Adott |Ac |Aber |A zároveň |A tiež |A taktiež |A také |A |a |7 |\* )/)) {+ state.inStep = true;+ state.allowPlaceholders = true;+ state.allowMultilineArgument = true;+ state.inKeywordLine = true;+ return "keyword";++ // INLINE STRING+ } else if (stream.match(/"[^"]*"?/)) {+ return "string";++ // PLACEHOLDER+ } else if (state.allowPlaceholders && stream.match(/<[^>]*>?/)) {+ return "variable";++ // Fall through+ } else {+ stream.next();+ stream.eatWhile(/[^@"<#]/);+ return null;+ }+ }+ };+});++CodeMirror.defineMIME("text/x-feature", "gherkin");diff --git a/data/ext/editorText/codemirror/mode/gherkin/index.html b/data/ext/editorText/codemirror/mode/gherkin/index.htmlnew file mode 100644index 000000000..b76877acd--- /dev/null+++ b/data/ext/editorText/codemirror/mode/gherkin/index.html@@ -0,0 +1,48 @@+<!doctype html>++<title>CodeMirror: Gherkin mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="gherkin.js"></script>+<style>.CodeMirror { border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; }</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Gherkin</a>+ </ul>+</div>++<article>+<h2>Gherkin mode</h2>+<form><textarea id="code" name="code">+Feature: Using Google+ Background:+ Something something+ Something else+ Scenario: Has a homepage+ When I navigate to the google home page+ Then the home page should contain the menu and the search form+ Scenario: Searching for a term+ When I navigate to the google home page+ When I search for Tofu+ Then the search results page is displayed+ Then the search results page contains 10 individual search results+ Then the search results contain a link to the wikipedia tofu page+</textarea></form>+ <script>+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});+ </script>++ <p><strong>MIME types defined:</strong> <code>text/x-feature</code>.</p>++ </article>diff --git a/data/ext/editorText/codemirror/mode/go/go.js b/data/ext/editorText/codemirror/mode/go/go.jsindex 6a458a6fe..862c09112 100644--- a/data/ext/editorText/codemirror/mode/go/go.js+++ b/data/ext/editorText/codemirror/mode/go/go.js@@ -158,7 +158,7 @@ CodeMirror.defineMode("go", function(config) {else return ctx.indented + (closing ? 0 : indentUnit);},- electricChars: "{}:",+ electricChars: "{}):",blockCommentStart: "/*",blockCommentEnd: "*/",lineComment: "//"diff --git a/data/ext/editorText/codemirror/mode/go/index.html b/data/ext/editorText/codemirror/mode/go/index.htmlindex 8a6aafca2..3673fa0b0 100644--- a/data/ext/editorText/codemirror/mode/go/index.html+++ b/data/ext/editorText/codemirror/mode/go/index.html@@ -1,19 +1,31 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Go mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <link rel="stylesheet" href="../../theme/elegant.css">- <script src="../../lib/codemirror.js"></script>- <script src="../../addon/edit/matchbrackets.js"></script>- <script src="go.js"></script>- <link rel="stylesheet" href="../../doc/docs.css">- <style>.CodeMirror {border:1px solid #999; background:#ffc}</style>- </head>- <body>- <h1>CodeMirror: Go mode</h1>+<title>CodeMirror: Go mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<link rel="stylesheet" href="../../theme/elegant.css">+<script src="../../lib/codemirror.js"></script>+<script src="../../addon/edit/matchbrackets.js"></script>+<script src="go.js"></script>+<style>.CodeMirror {border:1px solid #999; background:#ffc}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Go</a>+ </ul>+</div>++<article>+<h2>Go mode</h2><form><textarea id="code" name="code">// Prime Sieve in Go.// Taken from the Go specification.@@ -70,5 +82,4 @@ func main() {</script><p><strong>MIME type:</strong> <code>text/x-go</code></p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/groovy/groovy.js b/data/ext/editorText/codemirror/mode/groovy/groovy.jsindex 92b948192..6800e0aaf 100644--- a/data/ext/editorText/codemirror/mode/groovy/groovy.js+++ b/data/ext/editorText/codemirror/mode/groovy/groovy.js@@ -203,7 +203,8 @@ CodeMirror.defineMode("groovy", function(config) {else return ctx.indented + (closing ? 0 : config.indentUnit);},- electricChars: "{}"+ electricChars: "{}",+ fold: "brace"};});diff --git a/data/ext/editorText/codemirror/mode/groovy/index.html b/data/ext/editorText/codemirror/mode/groovy/index.htmlindex 3d3959577..f5efdf758 100644--- a/data/ext/editorText/codemirror/mode/groovy/index.html+++ b/data/ext/editorText/codemirror/mode/groovy/index.html@@ -1,18 +1,30 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Groovy mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="../../addon/edit/matchbrackets.js"></script>- <script src="groovy.js"></script>- <link rel="stylesheet" href="../../doc/docs.css">- <style>.CodeMirror {border-top: 1px solid #500; border-bottom: 1px solid #500;}</style>- </head>- <body>- <h1>CodeMirror: Groovy mode</h1>+<title>CodeMirror: Groovy mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="../../addon/edit/matchbrackets.js"></script>+<script src="groovy.js"></script>+<style>.CodeMirror {border-top: 1px solid #500; border-bottom: 1px solid #500;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Groovy</a>+ </ul>+</div>++<article>+<h2>Groovy mode</h2><form><textarea id="code" name="code">//Pattern for groovy scriptdef p = ~/.*\.groovy/@@ -69,5 +81,4 @@ def change(currency, amount) {</script><p><strong>MIME types defined:</strong> <code>text/x-groovy</code></p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/haml/haml.js b/data/ext/editorText/codemirror/mode/haml/haml.jsindex 793308f6f..5ea4ed12c 100644--- a/data/ext/editorText/codemirror/mode/haml/haml.js+++ b/data/ext/editorText/codemirror/mode/haml/haml.js@@ -141,10 +141,6 @@style = null;}return style;- },-- indent: function(state) {- return state.indented;}};}, "htmlmixed", "ruby");diff --git a/data/ext/editorText/codemirror/mode/haml/index.html b/data/ext/editorText/codemirror/mode/haml/index.htmlindex 7da378fc8..a73787554 100644--- a/data/ext/editorText/codemirror/mode/haml/index.html+++ b/data/ext/editorText/codemirror/mode/haml/index.html@@ -1,21 +1,34 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: HAML mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="../xml/xml.js"></script>- <script src="../htmlmixed/htmlmixed.js"></script>- <script src="../javascript/javascript.js"></script>- <script src="../ruby/ruby.js"></script>- <script src="haml.js"></script>- <style>.CodeMirror {background: #f8f8f8;}</style>- <link rel="stylesheet" href="../../doc/docs.css">- </head>- <body>- <h1>CodeMirror: HAML mode</h1>- <form><textarea id="code" name="code">++<title>CodeMirror: HAML mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="../xml/xml.js"></script>+<script src="../htmlmixed/htmlmixed.js"></script>+<script src="../javascript/javascript.js"></script>+<script src="../ruby/ruby.js"></script>+<script src="haml.js"></script>+<style>.CodeMirror {background: #f8f8f8;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">HAML</a>+ </ul>+</div>++<article>+<h2>HAML mode</h2>+<form><textarea id="code" name="code">!!!#content.left.column(title="title"){:href => "/hello", :test => "#{hello}_#{world}"}@@ -63,5 +76,4 @@<p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#haml_*">normal</a>, <a href="../../test/index.html#verbose,haml_*">verbose</a>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/haml/test.js b/data/ext/editorText/codemirror/mode/haml/test.jsindex b7178d40f..163b09f8d 100644--- a/data/ext/editorText/codemirror/mode/haml/test.js+++ b/data/ext/editorText/codemirror/mode/haml/test.js@@ -1,5 +1,5 @@(function() {- var mode = CodeMirror.getMode({tabSize: 4}, "haml");+ var mode = CodeMirror.getMode({tabSize: 4, indentUnit: 2}, "haml");function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }// Requires at least one media querydiff --git a/data/ext/editorText/codemirror/mode/haskell/haskell.js b/data/ext/editorText/codemirror/mode/haskell/haskell.jsindex b18d5ced1..facfd00a6 100644--- a/data/ext/editorText/codemirror/mode/haskell/haskell.js+++ b/data/ext/editorText/codemirror/mode/haskell/haskell.js@@ -1,4 +1,4 @@-CodeMirror.defineMode("haskell", function() {+CodeMirror.defineMode("haskell", function(_config, modeConfig) {function switchState(source, setState, f) {setState(f);@@ -8,7 +8,7 @@ CodeMirror.defineMode("haskell", function() {// These should all be Unicode extended, as per the Haskell 2010 reportvar smallRE = /[a-z_]/;var largeRE = /[A-Z]/;- var digitRE = /[0-9]/;+ var digitRE = /\d/;var hexitRE = /[0-9A-Fa-f]/;var octitRE = /[0-7]/;var idRE = /[a-z_A-Z0-9']/;@@ -76,9 +76,8 @@ CodeMirror.defineMode("haskell", function() {}source.eatWhile(digitRE);var t = "number";- if (source.eat('.')) {+ if (source.match(/^\.\d+/)) {t = "number";- source.eatWhile(digitRE); // should require at least 1}if (source.eat(/[eE]/)) {t = "number";@@ -88,6 +87,9 @@ CodeMirror.defineMode("haskell", function() {return t;}+ if (ch == "." && source.eat("."))+ return "keyword";+if (symbolRE.test(ch)) {if (ch == '-' && source.eat(/-/)) {source.eatWhile(/-/);@@ -221,6 +223,10 @@ CodeMirror.defineMode("haskell", function() {"unwords", "unzip", "unzip3", "userError", "words", "writeFile", "zip","zip3", "zipWith", "zipWith3");+ var override = modeConfig.overrideKeywords;+ if (override) for (var word in override) if (override.hasOwnProperty(word))+ wkw[word] = override[word];+return wkw;})();@@ -233,7 +239,7 @@ CodeMirror.defineMode("haskell", function() {token: function(stream, state) {var t = state.f(stream, function(s) { state.f = s; });var w = stream.current();- return (w in wellKnownWords) ? wellKnownWords[w] : t;+ return wellKnownWords.hasOwnProperty(w) ? wellKnownWords[w] : t;},blockCommentStart: "{-",diff --git a/data/ext/editorText/codemirror/mode/haskell/index.html b/data/ext/editorText/codemirror/mode/haskell/index.htmlindex 56307b8a9..056b01d46 100644--- a/data/ext/editorText/codemirror/mode/haskell/index.html+++ b/data/ext/editorText/codemirror/mode/haskell/index.html@@ -1,19 +1,31 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Haskell mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="../../addon/edit/matchbrackets.js"></script>- <script src="haskell.js"></script>- <link rel="stylesheet" href="../../theme/elegant.css">- <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>- <link rel="stylesheet" href="../../doc/docs.css">- </head>- <body>- <h1>CodeMirror: Haskell mode</h1>+<title>CodeMirror: Haskell mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<link rel="stylesheet" href="../../theme/elegant.css">+<script src="../../lib/codemirror.js"></script>+<script src="../../addon/edit/matchbrackets.js"></script>+<script src="haskell.js"></script>+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Haskell</a>+ </ul>+</div>++<article>+<h2>Haskell mode</h2><form><textarea id="code" name="code">module UniquePerms (uniquePerms@@ -58,5 +70,4 @@ permBag bs = concatMap (\(f,cs) -> map (f:) $ permBag cs) . oneOfEach $ bs</script><p><strong>MIME types defined:</strong> <code>text/x-haskell</code>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/haxe/haxe.js b/data/ext/editorText/codemirror/mode/haxe/haxe.jsindex 28f9b00ec..cb761ad1c 100644--- a/data/ext/editorText/codemirror/mode/haxe/haxe.js+++ b/data/ext/editorText/codemirror/mode/haxe/haxe.js@@ -297,7 +297,7 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) {function metadef(type) {if(type == ":") return cont(metadef);if(type == "variable") return cont(metadef);- if(type == "(") return cont(pushlex(")"), comasep(metaargs, ")"), poplex, statement);+ if(type == "(") return cont(pushlex(")"), commasep(metaargs, ")"), poplex, statement);}function metaargs(type) {if(type == "variable") return cont();diff --git a/data/ext/editorText/codemirror/mode/haxe/index.html b/data/ext/editorText/codemirror/mode/haxe/index.htmlindex 1125741ad..ec3b8e0e7 100644--- a/data/ext/editorText/codemirror/mode/haxe/index.html+++ b/data/ext/editorText/codemirror/mode/haxe/index.html@@ -1,16 +1,30 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Haxe mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="haxe.js"></script>- <link rel="stylesheet" href="../../doc/docs.css">- <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>- </head>- <body>- <h1>CodeMirror: Haxe mode</h1>++<title>CodeMirror: Haxe mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="haxe.js"></script>+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Haxe</a>+ </ul>+</div>++<article>+<h2>Haxe mode</h2>+<div><textarea id="code" name="code">import one.two.Three;@@ -86,5 +100,4 @@ enum Color</script><p><strong>MIME types defined:</strong> <code>text/x-haxe</code>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/htmlembedded/htmlembedded.js b/data/ext/editorText/codemirror/mode/htmlembedded/htmlembedded.jsindex ff6dfd2f9..c316cd340 100644--- a/data/ext/editorText/codemirror/mode/htmlembedded/htmlembedded.js+++ b/data/ext/editorText/codemirror/mode/htmlembedded/htmlembedded.js@@ -58,8 +58,6 @@ CodeMirror.defineMode("htmlembedded", function(config, parserConfig) {};},- electricChars: "/{}:",-innerMode: function(state) {if (state.token == scriptingDispatch) return {state: state.scriptState, mode: scriptingMode};else return {state: state.htmlState, mode: htmlMixedMode};diff --git a/data/ext/editorText/codemirror/mode/htmlembedded/index.html b/data/ext/editorText/codemirror/mode/htmlembedded/index.htmlindex 5a37dd637..fee119683 100644--- a/data/ext/editorText/codemirror/mode/htmlembedded/index.html+++ b/data/ext/editorText/codemirror/mode/htmlembedded/index.html@@ -1,21 +1,33 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Html Embedded Scripts mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="../xml/xml.js"></script>- <script src="../javascript/javascript.js"></script>- <script src="../css/css.js"></script>- <script src="../htmlmixed/htmlmixed.js"></script>- <script src="htmlembedded.js"></script>- <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>- <link rel="stylesheet" href="../../doc/docs.css">- </head>- <body>- <h1>CodeMirror: Html Embedded Scripts mode</h1>+<title>CodeMirror: Html Embedded Scripts mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="../xml/xml.js"></script>+<script src="../javascript/javascript.js"></script>+<script src="../css/css.js"></script>+<script src="../htmlmixed/htmlmixed.js"></script>+<script src="htmlembedded.js"></script>+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Html Embedded Scripts</a>+ </ul>+</div>++<article>+<h2>Html Embedded Scripts mode</h2><form><textarea id="code" name="code"><%function hello(who) {@@ -34,9 +46,7 @@ This is an example of EJS (embedded javascript)lineNumbers: true,mode: "application/x-ejs",indentUnit: 4,- indentWithTabs: true,- enterMode: "keep",- tabMode: "shift"+ indentWithTabs: true});</script>@@ -45,5 +55,4 @@ This is an example of EJS (embedded javascript)<p><strong>MIME types defined:</strong> <code>application/x-aspx</code> (ASP.NET),<code>application/x-ejs</code> (Embedded Javascript), <code>application/x-jsp</code> (JavaServer Pages)</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/htmlmixed/htmlmixed.js b/data/ext/editorText/codemirror/mode/htmlmixed/htmlmixed.jsindex ec0c21d24..8cc9c4e72 100644--- a/data/ext/editorText/codemirror/mode/htmlmixed/htmlmixed.js+++ b/data/ext/editorText/codemirror/mode/htmlmixed/htmlmixed.js@@ -1,5 +1,8 @@CodeMirror.defineMode("htmlmixed", function(config, parserConfig) {- var htmlMode = CodeMirror.getMode(config, {name: "xml", htmlMode: true});+ var htmlMode = CodeMirror.getMode(config, {name: "xml",+ htmlMode: true,+ multilineTagIndentFactor: parserConfig.multilineTagIndentFactor,+ multilineTagIndentPastTag: parserConfig.multilineTagIndentPastTag});var cssMode = CodeMirror.getMode(config, "css");var scriptTypes = [], scriptTypesConf = parserConfig && parserConfig.scriptTypes;@@ -44,7 +47,7 @@ CodeMirror.defineMode("htmlmixed", function(config, parserConfig) {if (close > -1) stream.backUp(cur.length - close);else if (m = cur.match(/<\/?$/)) {stream.backUp(cur.length);- if (!stream.match(pat, false)) stream.match(cur[0]);+ if (!stream.match(pat, false)) stream.match(cur);}return style;}@@ -93,8 +96,6 @@ CodeMirror.defineMode("htmlmixed", function(config, parserConfig) {return CodeMirror.Pass;},- electricChars: "/{}:",-innerMode: function(state) {return {state: state.localState || state.htmlState, mode: state.localMode || htmlMode};}diff --git a/data/ext/editorText/codemirror/mode/htmlmixed/index.html b/data/ext/editorText/codemirror/mode/htmlmixed/index.htmlindex c56559e55..bd06bb504 100644--- a/data/ext/editorText/codemirror/mode/htmlmixed/index.html+++ b/data/ext/editorText/codemirror/mode/htmlmixed/index.html@@ -1,21 +1,34 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: HTML mixed mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="../xml/xml.js"></script>- <script src="../javascript/javascript.js"></script>- <script src="../css/css.js"></script>- <script src="../vbscript/vbscript.js"></script>- <script src="htmlmixed.js"></script>- <link rel="stylesheet" href="../../doc/docs.css">- <style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>- </head>- <body>- <h1>CodeMirror: HTML mixed mode</h1>- <form><textarea id="code" name="code">++<title>CodeMirror: HTML mixed mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="../xml/xml.js"></script>+<script src="../javascript/javascript.js"></script>+<script src="../css/css.js"></script>+<script src="../vbscript/vbscript.js"></script>+<script src="htmlmixed.js"></script>+<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">HTML mixed</a>+ </ul>+</div>++<article>+<h2>HTML mixed mode</h2>+<form><textarea id="code" name="code"><html style="color: green"><!-- this is a comment --><head>@@ -49,7 +62,7 @@{matches: /(text|application)\/(x-)?vb(a|script)/i,mode: "vbscript"}]};- var editor = CodeMirror.fromTextArea(document.getElementById("code"), {mode: mixedMode, tabMode: "indent"});+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {mode: mixedMode});</script><p>The HTML mixed mode depends on the XML, JavaScript, and CSS modes.</p>@@ -69,5 +82,4 @@(redefined, only takes effect if you load this parser after theXML parser).</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/http/index.html b/data/ext/editorText/codemirror/mode/http/index.htmlindex 124eb84f9..705085e22 100644--- a/data/ext/editorText/codemirror/mode/http/index.html+++ b/data/ext/editorText/codemirror/mode/http/index.html@@ -1,16 +1,30 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: HTTP mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="http.js"></script>- <link rel="stylesheet" href="../../doc/docs.css">- <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>- </head>- <body>- <h1>CodeMirror: HTTP mode</h1>++<title>CodeMirror: HTTP mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="http.js"></script>+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">HTTP</a>+ </ul>+</div>++<article>+<h2>HTTP mode</h2>+<div><textarea id="code" name="code">POST /somewhere HTTP/1.1@@ -28,5 +42,4 @@ This is the request body!</script><p><strong>MIME types defined:</strong> <code>message/http</code>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/index.html b/data/ext/editorText/codemirror/mode/index.htmlnew file mode 100644index 000000000..26ea93ef0--- /dev/null+++ b/data/ext/editorText/codemirror/mode/index.html@@ -0,0 +1,117 @@+<!doctype html>++<title>CodeMirror: Language Modes</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../doc/docs.css">++<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../doc/logo.png"></a>++ <ul>+ <li><a href="../index.html">Home</a>+ <li><a href="../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a class=active href="#">Language modes</a>+ </ul>+</div>++<article>++<h2>Language modes</h2>++<p>This is a list of every mode in the distribution. Each mode lives+in a subdirectory of the <code>mode/</code> directory, and typically+defines a single JavaScript file that implements the mode. Loading+such file will make the language available to CodeMirror, through+the <a href="manual.html#option_mode"><code>mode</code></a>+option.</p>++<div style="-webkit-columns: 100px 2; -moz-columns: 100px 2; columns: 100px 2;">+ <ul>+ <li><a href="apl/index.html">APL</a></li>+ <li><a href="asterisk/index.html">Asterisk dialplan</a></li>+ <li><a href="clike/index.html">C, C++, C#</a></li>+ <li><a href="clojure/index.html">Clojure</a></li>+ <li><a href="cobol/index.html">COBOL</a></li>+ <li><a href="coffeescript/index.html">CoffeeScript</a></li>+ <li><a href="commonlisp/index.html">Common Lisp</a></li>+ <li><a href="css/index.html">CSS</a></li>+ <li><a href="python/index.html">Cython</a></li>+ <li><a href="d/index.html">D</a></li>+ <li><a href="diff/index.html">diff</a></li>+ <li><a href="dtd/index.html">DTD</a></li>+ <li><a href="ecl/index.html">ECL</a></li>+ <li><a href="eiffel/index.html">Eiffel</a></li>+ <li><a href="erlang/index.html">Erlang</a></li>+ <li><a href="fortran/index.html">Fortran</a></li>+ <li><a href="mllike/index.html">F#</a></li>+ <li><a href="gas/index.html">Gas</a> (AT&T-style assembly)</li>+ <li><a href="gherkin/index.html">Gherkin</a></li>+ <li><a href="go/index.html">Go</a></li>+ <li><a href="groovy/index.html">Groovy</a></li>+ <li><a href="haml/index.html">HAML</a></li>+ <li><a href="haskell/index.html">Haskell</a></li>+ <li><a href="haxe/index.html">Haxe</a></li>+ <li><a href="htmlembedded/index.html">HTML embedded scripts</a></li>+ <li><a href="htmlmixed/index.html">HTML mixed-mode</a></li>+ <li><a href="http/index.html">HTTP</a></li>+ <li><a href="clike/index.html">Java</a></li>+ <li><a href="jade/index.html">Jade</a></li>+ <li><a href="javascript/index.html">JavaScript</a></li>+ <li><a href="jinja2/index.html">Jinja2</a></li>+ <li><a href="julia/index.html">Julia</a></li>+ <li><a href="css/less.html">LESS</a></li>+ <li><a href="livescript/index.html">LiveScript</a></li>+ <li><a href="lua/index.html">Lua</a></li>+ <li><a href="markdown/index.html">Markdown</a> (<a href="gfm/index.html">GitHub-flavour</a>)</li>+ <li><a href="mirc/index.html">mIRC</a></li>+ <li><a href="nginx/index.html">Nginx</a></li>+ <li><a href="ntriples/index.html">NTriples</a></li>+ <li><a href="mllike/index.html">OCaml</a></li>+ <li><a href="octave/index.html">Octave</a> (MATLAB)</li>+ <li><a href="pascal/index.html">Pascal</a></li>+ <li><a href="pegjs/index.html">PEG.js</a></li>+ <li><a href="perl/index.html">Perl</a></li>+ <li><a href="php/index.html">PHP</a></li>+ <li><a href="pig/index.html">Pig Latin</a></li>+ <li><a href="properties/index.html">Properties files</a></li>+ <li><a href="puppet/index.html">Puppet</a></li>+ <li><a href="python/index.html">Python</a></li>+ <li><a href="q/index.html">Q</a></li>+ <li><a href="r/index.html">R</a></li>+ <li>RPM <a href="rpm/spec/index.html">spec</a> and <a href="rpm/changes/index.html">changelog</a></li>+ <li><a href="rst/index.html">reStructuredText</a></li>+ <li><a href="ruby/index.html">Ruby</a></li>+ <li><a href="rust/index.html">Rust</a></li>+ <li><a href="sass/index.html">Sass</a></li>+ <li><a href="clike/scala.html">Scala</a></li>+ <li><a href="scheme/index.html">Scheme</a></li>+ <li><a href="css/scss.html">SCSS</a></li>+ <li><a href="shell/index.html">Shell</a></li>+ <li><a href="sieve/index.html">Sieve</a></li>+ <li><a href="smalltalk/index.html">Smalltalk</a></li>+ <li><a href="smarty/index.html">Smarty</a></li>+ <li><a href="smartymixed/index.html">Smarty/HTML mixed</a></li>+ <li><a href="solr/index.html">Solr</a></li>+ <li><a href="sql/index.html">SQL</a> (several dialects)</li>+ <li><a href="sparql/index.html">SPARQL</a></li>+ <li><a href="stex/index.html">sTeX, LaTeX</a></li>+ <li><a href="tcl/index.html">Tcl</a></li>+ <li><a href="tiddlywiki/index.html">Tiddlywiki</a></li>+ <li><a href="tiki/index.html">Tiki wiki</a></li>+ <li><a href="toml/index.html">TOML</a></li>+ <li><a href="turtle/index.html">Turtle</a></li>+ <li><a href="vb/index.html">VB.NET</a></li>+ <li><a href="vbscript/index.html">VBScript</a></li>+ <li><a href="velocity/index.html">Velocity</a></li>+ <li><a href="verilog/index.html">Verilog</a></li>+ <li><a href="xml/index.html">XML/HTML</a></li>+ <li><a href="xquery/index.html">XQuery</a></li>+ <li><a href="yaml/index.html">YAML</a></li>+ <li><a href="z80/index.html">Z80</a></li>+ </ul>+ </div>++</article>diff --git a/data/ext/editorText/codemirror/mode/jade/index.html b/data/ext/editorText/codemirror/mode/jade/index.htmlnew file mode 100644index 000000000..e22b15e65--- /dev/null+++ b/data/ext/editorText/codemirror/mode/jade/index.html@@ -0,0 +1,66 @@+<!doctype html>++<title>CodeMirror: Jade Templating Mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="jade.js"></script>+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Jade Templating Mode</a>+ </ul>+</div>++<article>+<h2>Jade Templating Mode</h2>+<form><textarea id="code" name="code">+doctype 5+ html+ head+ title= "Jade Templating CodeMirror Mode Example"+ link(rel='stylesheet', href='/css/bootstrap.min.css')+ link(rel='stylesheet', href='/css/index.css')+ script(type='text/javascript', src='/js/jquery-1.9.1.min.js')+ script(type='text/javascript', src='/js/bootstrap.min.js')+ body+ div.header+ h1 Welcome to this Example+ div.spots+ if locals.spots+ each spot in spots+ div.spot.well+ div+ if spot.logo+ img.img-rounded.logo(src=spot.logo)+ else+ img.img-rounded.logo(src="img/placeholder.png")+ h3+ a(href=spot.hash) ##{spot.hash}+ if spot.title+ span.title #{spot.title}+ if spot.desc+ div #{spot.desc}+ else+ h3 There are no spots currently available.+</textarea></form>+ <script>+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {+ mode: {name: "jade", alignCDATA: true},+ lineNumbers: true+ });+ </script>+ <h3>The Jade Templating Mode</h3>+ <p> Created by Drew Bratcher. Managed as part of an Adobe Brackets extension at <a href="https://github.com/dbratcher/brackets-jade">https://github.com/dbratcher/brackets-jade</a>.</p>+ <p><strong>MIME type defined:</strong> <code>text/x-jade</code>.</p>+ </article>diff --git a/data/ext/editorText/codemirror/mode/jade/jade.js b/data/ext/editorText/codemirror/mode/jade/jade.jsnew file mode 100644index 000000000..61abb27ab--- /dev/null+++ b/data/ext/editorText/codemirror/mode/jade/jade.js@@ -0,0 +1,90 @@+CodeMirror.defineMode("jade", function () {+ var symbol_regex1 = /^(?:~|!|%|\^|\*|\+|=|\\|:|;|,|\/|\?|&|<|>|\|)/;+ var open_paren_regex = /^(\(|\[)/;+ var close_paren_regex = /^(\)|\])/;+ var keyword_regex1 = /^(if|else|return|var|function|include|doctype|each)/;+ var keyword_regex2 = /^(#|{|}|\.)/;+ var keyword_regex3 = /^(in)/;+ var html_regex1 = /^(html|head|title|meta|link|script|body|br|div|input|span|a|img)/;+ var html_regex2 = /^(h1|h2|h3|h4|h5|p|strong|em)/;+ return {+ startState: function () {+ return {+ inString: false,+ stringType: "",+ beforeTag: true,+ justMatchedKeyword: false,+ afterParen: false+ };+ },+ token: function (stream, state) {+ //check for state changes+ if (!state.inString && ((stream.peek() == '"') || (stream.peek() == "'"))) {+ state.stringType = stream.peek();+ stream.next(); // Skip quote+ state.inString = true; // Update state+ }++ //return state+ if (state.inString) {+ if (stream.skipTo(state.stringType)) { // Quote found on this line+ stream.next(); // Skip quote+ state.inString = false; // Clear flag+ } else {+ stream.skipToEnd(); // Rest of line is string+ }+ state.justMatchedKeyword = false;+ return "string"; // Token style+ } else if (stream.sol() && stream.eatSpace()) {+ if (stream.match(keyword_regex1)) {+ state.justMatchedKeyword = true;+ stream.eatSpace();+ return "keyword";+ }+ if (stream.match(html_regex1) || stream.match(html_regex2)) {+ state.justMatchedKeyword = true;+ return "variable";+ }+ } else if (stream.sol() && stream.match(keyword_regex1)) {+ state.justMatchedKeyword = true;+ stream.eatSpace();+ return "keyword";+ } else if (stream.sol() && (stream.match(html_regex1) || stream.match(html_regex2))) {+ state.justMatchedKeyword = true;+ return "variable";+ } else if (stream.eatSpace()) {+ state.justMatchedKeyword = false;+ if (stream.match(keyword_regex3) && stream.eatSpace()) {+ state.justMatchedKeyword = true;+ return "keyword";+ }+ } else if (stream.match(symbol_regex1)) {+ state.justMatchedKeyword = false;+ return "atom";+ } else if (stream.match(open_paren_regex)) {+ state.afterParen = true;+ state.justMatchedKeyword = true;+ return "def";+ } else if (stream.match(close_paren_regex)) {+ state.afterParen = false;+ state.justMatchedKeyword = true;+ return "def";+ } else if (stream.match(keyword_regex2)) {+ state.justMatchedKeyword = true;+ return "keyword";+ } else if (stream.eatSpace()) {+ state.justMatchedKeyword = false;+ } else {+ stream.next();+ if (state.justMatchedKeyword) {+ return "property";+ } else if (state.afterParen) {+ return "property";+ }+ }+ return null;+ }+ };+});++CodeMirror.defineMIME('text/x-jade', 'jade');diff --git a/data/ext/editorText/codemirror/mode/javascript/index.html b/data/ext/editorText/codemirror/mode/javascript/index.htmlindex db063b772..faf50363e 100644--- a/data/ext/editorText/codemirror/mode/javascript/index.html+++ b/data/ext/editorText/codemirror/mode/javascript/index.html@@ -1,19 +1,33 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: JavaScript mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="../../addon/edit/matchbrackets.js"></script>- <script src="../../addon/edit/continuecomment.js"></script>- <script src="../../addon/comment/comment.js"></script>- <script src="javascript.js"></script>- <link rel="stylesheet" href="../../doc/docs.css">- <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>- </head>- <body>- <h1>CodeMirror: JavaScript mode</h1>++<title>CodeMirror: JavaScript mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="../../addon/edit/matchbrackets.js"></script>+<script src="../../addon/comment/continuecomment.js"></script>+<script src="../../addon/comment/comment.js"></script>+<script src="javascript.js"></script>+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">JavaScript</a>+ </ul>+</div>++<article>+<h2>JavaScript mode</h2>+<div><textarea id="code" name="code">// Demo code (the actual new parser character stream implementation)@@ -75,11 +89,13 @@ StringStream.prototype = {</script><p>- JavaScript mode supports a two configuration- options:+ JavaScript mode supports several configuration options:<ul><li><code>json</code> which will set the mode to expect JSONdata rather than a JavaScript program.</li>+ <li><code>jsonld</code> which will set the mode to expect+ <a href="http://json-ld.org">JSON-LD</a> linked data rather+ than a JavaScript program (<a href="json-ld.html">demo</a>).</li><li><code>typescript</code> which will activate additionalsyntax highlighting and some other things for TypeScript code(<a href="typescript.html">demo</a>).</li>@@ -89,6 +105,5 @@ StringStream.prototype = {</ul></p>- <p><strong>MIME types defined:</strong> <code>text/javascript</code>, <code>application/json</code>, <code>text/typescript</code>, <code>application/typescript</code>.</p>- </body>-</html>+ <p><strong>MIME types defined:</strong> <code>text/javascript</code>, <code>application/json</code>, <code>application/ld+json</code>, <code>text/typescript</code>, <code>application/typescript</code>.</p>+ </article>diff --git a/data/ext/editorText/codemirror/mode/javascript/javascript.js b/data/ext/editorText/codemirror/mode/javascript/javascript.jsindex 6435e138d..07ba8a6f4 100644--- a/data/ext/editorText/codemirror/mode/javascript/javascript.js+++ b/data/ext/editorText/codemirror/mode/javascript/javascript.js@@ -3,7 +3,8 @@CodeMirror.defineMode("javascript", function(config, parserConfig) {var indentUnit = config.indentUnit;var statementIndent = parserConfig.statementIndent;- var jsonMode = parserConfig.json;+ var jsonldMode = parserConfig.jsonld;+ var jsonMode = parserConfig.json || jsonldMode;var isTS = parserConfig.typescript;// Tokenizer@@ -15,13 +16,14 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {var jsKeywords = {"if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B,- "return": C, "break": C, "continue": C, "new": C, "delete": C, "throw": C,+ "return": C, "break": C, "continue": C, "new": C, "delete": C, "throw": C, "debugger": C,"var": kw("var"), "const": kw("var"), "let": kw("var"),"function": kw("function"), "catch": kw("catch"),"for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),"in": operator, "typeof": operator, "instanceof": operator,"true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom,- "this": kw("this")+ "this": kw("this"), "module": kw("module"), "class": kw("class"), "super": kw("atom"),+ "yield": C, "export": kw("export"), "import": kw("import"), "extends": C};// Extend the 'normal' keywords with the TypeScript language extensions@@ -30,7 +32,6 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {var tsKeywords = {// object-like things"interface": kw("interface"),- "class": kw("class"),"extends": kw("extends"),"constructor": kw("constructor"),@@ -40,8 +41,6 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {"protected": kw("protected"),"static": kw("static"),- "super": kw("super"),-// types"string": type, "number": type, "bool": type, "any": type};@@ -55,20 +54,18 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {}();var isOperatorChar = /[+\-*&%=<>!?|~^]/;+ var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;- function chain(stream, state, f) {- state.tokenize = f;- return f(stream, state);- }-- function nextUntilUnescaped(stream, end) {- var escaped = false, next;+ function readRegexp(stream) {+ var escaped = false, next, inSet = false;while ((next = stream.next()) != null) {- if (next == end && !escaped)- return false;+ if (!escaped) {+ if (next == "/" && !inSet) return;+ if (next == "[") inSet = true;+ else if (inSet && next == "]") inSet = false;+ }escaped = !escaped && next == "\\";}- return escaped;}// Used as scratch variables to communicate multiple values without@@ -78,49 +75,51 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {type = tp; content = cont;return style;}-- function jsTokenBase(stream, state) {+ function tokenBase(stream, state) {var ch = stream.next();- if (ch == '"' || ch == "'")- return chain(stream, state, jsTokenString(ch));- else if (/[\[\]{}\(\),;\:\.]/.test(ch))+ if (ch == '"' || ch == "'") {+ state.tokenize = tokenString(ch);+ return state.tokenize(stream, state);+ } else if (ch == "." && stream.match(/^\d+(?:[eE][+\-]?\d+)?/)) {+ return ret("number", "number");+ } else if (ch == "." && stream.match("..")) {+ return ret("spread", "meta");+ } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) {return ret(ch);- else if (ch == "0" && stream.eat(/x/i)) {+ } else if (ch == "=" && stream.eat(">")) {+ return ret("=>", "operator");+ } else if (ch == "0" && stream.eat(/x/i)) {stream.eatWhile(/[\da-f]/i);return ret("number", "number");- }- else if (/\d/.test(ch) || ch == "-" && stream.eat(/\d/)) {+ } else if (/\d/.test(ch)) {stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);return ret("number", "number");- }- else if (ch == "/") {+ } else if (ch == "/") {if (stream.eat("*")) {- return chain(stream, state, jsTokenComment);- }- else if (stream.eat("/")) {+ state.tokenize = tokenComment;+ return tokenComment(stream, state);+ } else if (stream.eat("/")) {stream.skipToEnd();return ret("comment", "comment");- }- else if (state.lastType == "operator" || state.lastType == "keyword c" ||- /^[\[{}\(,;:]$/.test(state.lastType)) {- nextUntilUnescaped(stream, "/");+ } else if (state.lastType == "operator" || state.lastType == "keyword c" ||+ state.lastType == "sof" || /^[\[{}\(,;:]$/.test(state.lastType)) {+ readRegexp(stream);stream.eatWhile(/[gimy]/); // 'y' is "sticky" option in Mozillareturn ret("regexp", "string-2");- }- else {+ } else {stream.eatWhile(isOperatorChar);- return ret("operator", null, stream.current());+ return ret("operator", "operator", stream.current());}- }- else if (ch == "#") {+ } else if (ch == "`") {+ state.tokenize = tokenQuasi;+ return tokenQuasi(stream, state);+ } else if (ch == "#") {stream.skipToEnd();return ret("error", "error");- }- else if (isOperatorChar.test(ch)) {+ } else if (isOperatorChar.test(ch)) {stream.eatWhile(isOperatorChar);- return ret("operator", null, stream.current());- }- else {+ return ret("operator", "operator", stream.current());+ } else {stream.eatWhile(/[\w\$_]/);var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word];return (known && state.lastType != ".") ? ret(known.type, known.style, word) :@@ -128,19 +127,27 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {}}- function jsTokenString(quote) {+ function tokenString(quote) {return function(stream, state) {- if (!nextUntilUnescaped(stream, quote))- state.tokenize = jsTokenBase;+ var escaped = false, next;+ if (jsonldMode && stream.peek() == "@" && stream.match(isJsonldKeyword)){+ state.tokenize = tokenBase;+ return ret("jsonld-keyword", "meta");+ }+ while ((next = stream.next()) != null) {+ if (next == quote && !escaped) break;+ escaped = !escaped && next == "\\";+ }+ if (!escaped) state.tokenize = tokenBase;return ret("string", "string");};}- function jsTokenComment(stream, state) {+ function tokenComment(stream, state) {var maybeEnd = false, ch;while (ch = stream.next()) {if (ch == "/" && maybeEnd) {- state.tokenize = jsTokenBase;+ state.tokenize = tokenBase;break;}maybeEnd = (ch == "*");@@ -148,9 +155,53 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {return ret("comment", "comment");}+ function tokenQuasi(stream, state) {+ var escaped = false, next;+ while ((next = stream.next()) != null) {+ if (!escaped && (next == "`" || next == "$" && stream.eat("{"))) {+ state.tokenize = tokenBase;+ break;+ }+ escaped = !escaped && next == "\\";+ }+ return ret("quasi", "string-2", stream.current());+ }++ var brackets = "([{}])";+ // This is a crude lookahead trick to try and notice that we're+ // parsing the argument patterns for a fat-arrow function before we+ // actually hit the arrow token. It only works if the arrow is on+ // the same line as the arguments and there's no strange noise+ // (comments) in between. Fallback is to only notice when we hit the+ // arrow, and not declare the arguments as locals for the arrow+ // body.+ function findFatArrow(stream, state) {+ if (state.fatArrowAt) state.fatArrowAt = null;+ var arrow = stream.string.indexOf("=>", stream.start);+ if (arrow < 0) return;++ var depth = 0, sawSomething = false;+ for (var pos = arrow - 1; pos >= 0; --pos) {+ var ch = stream.string.charAt(pos);+ var bracket = brackets.indexOf(ch);+ if (bracket >= 0 && bracket < 3) {+ if (!depth) { ++pos; break; }+ if (--depth == 0) break;+ } else if (bracket >= 3 && bracket < 6) {+ ++depth;+ } else if (/[$\w]/.test(ch)) {+ sawSomething = true;+ } else if (sawSomething && !depth) {+ ++pos;+ break;+ }+ }+ if (sawSomething && !depth) state.fatArrowAt = pos;+ }+// Parser- var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true, "this": true};+ var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true, "this": true, "jsonld-keyword": true};function JSLexical(indented, column, type, align, prev, info) {this.indented = indented;@@ -164,6 +215,10 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {function inScope(state, varname) {for (var v = state.localVars; v; v = v.next)if (v.name == varname) return true;+ for (var cx = state.context; cx; cx = cx.prev) {+ for (var v = cx.vars; v; v = v.next)+ if (v.name == varname) return true;+ }}function parseJS(state, style, type, content, stream) {@@ -210,7 +265,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {state.localVars = {name: varname, next: state.localVars};} else {if (inList(state.globalVars)) return;- state.globalVars = {name: varname, next: state.globalVars};+ if (parserConfig.globalVars)+ state.globalVars = {name: varname, next: state.globalVars};}}@@ -252,23 +308,26 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {};}- function statement(type) {- if (type == "var") return cont(pushlex("vardef"), vardef1, expect(";"), poplex);+ function statement(type, value) {+ if (type == "var") return cont(pushlex("vardef", value.length), vardef, expect(";"), poplex);if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex);if (type == "keyword b") return cont(pushlex("form"), statement, poplex);if (type == "{") return cont(pushlex("}"), block, poplex);if (type == ";") return cont();- if (type == "if") return cont(pushlex("form"), expression, statement, poplex, maybeelse(cx.state.indented));+ if (type == "if") return cont(pushlex("form"), expression, statement, poplex, maybeelse);if (type == "function") return cont(functiondef);- if (type == "for") return cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"),- poplex, statement, poplex);+ if (type == "for") return cont(pushlex("form"), forspec, statement, poplex);if (type == "variable") return cont(pushlex("stat"), maybelabel);if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"),- block, poplex, poplex);+ block, poplex, poplex);if (type == "case") return cont(expression, expect(":"));if (type == "default") return cont(expect(":"));if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"),- statement, poplex, popcontext);+ statement, poplex, popcontext);+ if (type == "module") return cont(pushlex("form"), pushcontext, afterModule, popcontext, poplex);+ if (type == "class") return cont(pushlex("form"), className, objlit, poplex);+ if (type == "export") return cont(pushlex("form"), afterExport, poplex);+ if (type == "import") return cont(pushlex("form"), afterImport, poplex);return pass(pushlex("stat"), expression, expect(";"), poplex);}function expression(type) {@@ -278,14 +337,20 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {return expressionInner(type, true);}function expressionInner(type, noComma) {+ if (cx.state.fatArrowAt == cx.stream.start) {+ var body = noComma ? arrowBodyNoComma : arrowBody;+ if (type == "(") return cont(pushcontext, pushlex(")"), commasep(pattern, ")"), poplex, expect("=>"), body, popcontext);+ else if (type == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext);+ }+var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);if (type == "function") return cont(functiondef);if (type == "keyword c") return cont(noComma ? maybeexpressionNoComma : maybeexpression);- if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeop);- if (type == "operator") return cont(noComma ? expressionNoComma : expression);- if (type == "[") return cont(pushlex("]"), commasep(expressionNoComma, "]"), poplex, maybeop);- if (type == "{") return cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeop);+ if (type == "(") return cont(pushlex(")"), maybeexpression, comprehension, expect(")"), poplex, maybeop);+ if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression);+ if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop);+ if (type == "{") return contCommasep(objprop, "}", null, maybeop);return cont();}function maybeexpression(type) {@@ -299,19 +364,43 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {function maybeoperatorComma(type, value) {if (type == ",") return cont(expression);- return maybeoperatorNoComma(type, value, maybeoperatorComma);+ return maybeoperatorNoComma(type, value, false);}- function maybeoperatorNoComma(type, value, me) {- if (!me) me = maybeoperatorNoComma;+ function maybeoperatorNoComma(type, value, noComma) {+ var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma;+ var expr = noComma == false ? expression : expressionNoComma;+ if (value == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);if (type == "operator") {if (/\+\+|--/.test(value)) return cont(me);- if (value == "?") return cont(expression, expect(":"), expression);- return cont(expression);+ if (value == "?") return cont(expression, expect(":"), expr);+ return cont(expr);}+ if (type == "quasi") { cx.cc.push(me); return quasi(value); }if (type == ";") return;- if (type == "(") return cont(pushlex(")", "call"), commasep(expressionNoComma, ")"), poplex, me);+ if (type == "(") return contCommasep(expressionNoComma, ")", "call", me);if (type == ".") return cont(property, me);- if (type == "[") return cont(pushlex("]"), expression, expect("]"), poplex, me);+ if (type == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me);+ }+ function quasi(value) {+ if (value.slice(value.length - 2) != "${") return cont();+ return cont(expression, continueQuasi);+ }+ function continueQuasi(type) {+ if (type == "}") {+ cx.marked = "string-2";+ cx.state.tokenize = tokenQuasi;+ return cont();+ }+ }+ function arrowBody(type) {+ findFatArrow(cx.stream, cx.state);+ if (type == "{") return pass(statement);+ return pass(expression);+ }+ function arrowBodyNoComma(type) {+ findFatArrow(cx.stream, cx.state);+ if (type == "{") return pass(statement);+ return pass(expressionNoComma);}function maybelabel(type) {if (type == ":") return cont(poplex, statement);@@ -325,16 +414,21 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {cx.marked = "property";if (value == "get" || value == "set") return cont(getterSetter);} else if (type == "number" || type == "string") {- cx.marked = type + " property";+ cx.marked = jsonldMode ? "property" : (type + " property");+ } else if (type == "[") {+ return cont(expression, expect("]"), afterprop);}- if (atomicTypes.hasOwnProperty(type)) return cont(expect(":"), expressionNoComma);+ if (atomicTypes.hasOwnProperty(type)) return cont(afterprop);}function getterSetter(type) {- if (type == ":") return cont(expression);- if (type != "variable") return cont(expect(":"), expression);+ if (type != "variable") return pass(afterprop);cx.marked = "property";return cont(functiondef);}+ function afterprop(type) {+ if (type == ":") return cont(expressionNoComma);+ if (type == "(") return pass(functiondef);+ }function commasep(what, end) {function proceed(type) {if (type == ",") {@@ -347,81 +441,138 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {}return function(type) {if (type == end) return cont();- else return pass(what, proceed);+ return pass(what, proceed);};}+ function contCommasep(what, end, info) {+ for (var i = 3; i < arguments.length; i++)+ cx.cc.push(arguments[i]);+ return cont(pushlex(end, info), commasep(what, end), poplex);+ }function block(type) {if (type == "}") return cont();return pass(statement, block);}function maybetype(type) {- if (type == ":") return cont(typedef);- return pass();+ if (isTS && type == ":") return cont(typedef);}function typedef(type) {if (type == "variable"){cx.marked = "variable-3"; return cont();}- return pass();}- function vardef1(type, value) {- if (type == "variable") {+ function vardef() {+ return pass(pattern, maybetype, maybeAssign, vardefCont);+ }+ function pattern(type, value) {+ if (type == "variable") { register(value); return cont(); }+ if (type == "[") return contCommasep(pattern, "]");+ if (type == "{") return contCommasep(proppattern, "}");+ }+ function proppattern(type, value) {+ if (type == "variable" && !cx.stream.match(/^\s*:/, false)) {register(value);- return isTS ? cont(maybetype, vardef2) : cont(vardef2);+ return cont(maybeAssign);}- return pass();+ if (type == "variable") cx.marked = "property";+ return cont(expect(":"), pattern, maybeAssign);}- function vardef2(type, value) {- if (value == "=") return cont(expressionNoComma, vardef2);- if (type == ",") return cont(vardef1);+ function maybeAssign(_type, value) {+ if (value == "=") return cont(expressionNoComma);}- function maybeelse(indent) {- return function(type, value) {- if (type == "keyword b" && value == "else") {- cx.state.lexical = new JSLexical(indent, 0, "form", null, cx.state.lexical);- return cont(statement, poplex);- }- return pass();- };+ function vardefCont(type) {+ if (type == ",") return cont(vardef);+ }+ function maybeelse(type, value) {+ if (type == "keyword b" && value == "else") return cont(pushlex("form"), statement, poplex);+ }+ function forspec(type) {+ if (type == "(") return cont(pushlex(")"), forspec1, expect(")"), poplex);}function forspec1(type) {- if (type == "var") return cont(vardef1, expect(";"), forspec2);+ if (type == "var") return cont(vardef, expect(";"), forspec2);if (type == ";") return cont(forspec2);- if (type == "variable") return cont(formaybein);+ if (type == "variable") return cont(formaybeinof);return pass(expression, expect(";"), forspec2);}- function formaybein(_type, value) {- if (value == "in") return cont(expression);+ function formaybeinof(_type, value) {+ if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); }return cont(maybeoperatorComma, forspec2);}function forspec2(type, value) {if (type == ";") return cont(forspec3);- if (value == "in") return cont(expression);+ if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); }return pass(expression, expect(";"), forspec3);}function forspec3(type) {if (type != ")") cont(expression);}function functiondef(type, value) {+ if (value == "*") {cx.marked = "keyword"; return cont(functiondef);}if (type == "variable") {register(value); return cont(functiondef);}- if (type == "(") return cont(pushlex(")"), pushcontext, commasep(funarg, ")"), poplex, statement, popcontext);+ if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, statement, popcontext);+ }+ function funarg(type) {+ if (type == "spread") return cont(funarg);+ return pass(pattern, maybetype);+ }+ function className(type, value) {+ if (type == "variable") {register(value); return cont(classNameAfter);}+ }+ function classNameAfter(_type, value) {+ if (value == "extends") return cont(expression);+ }+ function objlit(type) {+ if (type == "{") return contCommasep(objprop, "}");+ }+ function afterModule(type, value) {+ if (type == "string") return cont(statement);+ if (type == "variable") { register(value); return cont(maybeFrom); }+ }+ function afterExport(_type, value) {+ if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); }+ if (value == "default") { cx.marked = "keyword"; return cont(expression, expect(";")); }+ return pass(statement);}- function funarg(type, value) {- if (type == "variable") {register(value); return isTS ? cont(maybetype) : cont();}+ function afterImport(type) {+ if (type == "string") return cont();+ return pass(importSpec, maybeFrom);+ }+ function importSpec(type, value) {+ if (type == "{") return contCommasep(importSpec, "}");+ if (type == "variable") register(value);+ return cont();+ }+ function maybeFrom(_type, value) {+ if (value == "from") { cx.marked = "keyword"; return cont(expression); }+ }+ function arrayLiteral(type) {+ if (type == "]") return cont();+ return pass(expressionNoComma, maybeArrayComprehension);+ }+ function maybeArrayComprehension(type) {+ if (type == "for") return pass(comprehension, expect("]"));+ if (type == ",") return cont(commasep(expressionNoComma, "]"));+ return pass(commasep(expressionNoComma, "]"));+ }+ function comprehension(type) {+ if (type == "for") return cont(forspec, comprehension);+ if (type == "if") return cont(expression, comprehension);}// Interfacereturn {startState: function(basecolumn) {- return {- tokenize: jsTokenBase,- lastType: null,+ var state = {+ tokenize: tokenBase,+ lastType: "sof",cc: [],lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false),localVars: parserConfig.localVars,- globalVars: parserConfig.globalVars,context: parserConfig.localVars && {vars: parserConfig.localVars},indented: 0};+ if (parserConfig.globalVars) state.globalVars = parserConfig.globalVars;+ return state;},token: function(stream, state) {@@ -429,8 +580,9 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {if (!state.lexical.hasOwnProperty("align"))state.lexical.align = false;state.indented = stream.indentation();+ findFatArrow(stream, state);}- if (state.tokenize != jsTokenComment && stream.eatSpace()) return null;+ if (state.tokenize != tokenComment && stream.eatSpace()) return null;var style = state.tokenize(stream, state);if (type == "comment") return style;state.lastType = type == "operator" && (content == "++" || content == "--") ? "incdec" : type;@@ -438,15 +590,21 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {},indent: function(state, textAfter) {- if (state.tokenize == jsTokenComment) return CodeMirror.Pass;- if (state.tokenize != jsTokenBase) return 0;+ if (state.tokenize == tokenComment) return CodeMirror.Pass;+ if (state.tokenize != tokenBase) return 0;var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical;+ // Kludge to prevent 'maybelse' from blocking lexical scope pops+ for (var i = state.cc.length - 1; i >= 0; --i) {+ var c = state.cc[i];+ if (c == poplex) lexical = lexical.prev;+ else if (c != maybeelse) break;+ }if (lexical.type == "stat" && firstChar == "}") lexical = lexical.prev;if (statementIndent && lexical.type == ")" && lexical.prev.type == "stat")lexical = lexical.prev;var type = lexical.type, closing = firstChar == type;- if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? 4 : 0);+ if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? lexical.info + 1 : 0);else if (type == "form" && firstChar == "{") return lexical.indented;else if (type == "form") return lexical.indented + indentUnit;else if (type == "stat")@@ -461,7 +619,10 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {blockCommentStart: jsonMode ? null : "/*",blockCommentEnd: jsonMode ? null : "*/",lineComment: jsonMode ? null : "//",+ fold: "brace",+ helperType: jsonMode ? "json" : "javascript",+ jsonldMode: jsonldMode,jsonMode: jsonMode};});@@ -472,5 +633,6 @@ CodeMirror.defineMIME("application/javascript", "javascript");CodeMirror.defineMIME("application/ecmascript", "javascript");CodeMirror.defineMIME("application/json", {name: "javascript", json: true});CodeMirror.defineMIME("application/x-json", {name: "javascript", json: true});+CodeMirror.defineMIME("application/ld+json", {name: "javascript", jsonld: true});CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true });CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true });diff --git a/data/ext/editorText/codemirror/mode/javascript/json-ld.html b/data/ext/editorText/codemirror/mode/javascript/json-ld.htmlnew file mode 100644index 000000000..256bb0f62--- /dev/null+++ b/data/ext/editorText/codemirror/mode/javascript/json-ld.html@@ -0,0 +1,72 @@+<!doctype html>++<title>CodeMirror: JSON-LD mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="../../addon/edit/matchbrackets.js"></script>+<script src="../../addon/comment/continuecomment.js"></script>+<script src="../../addon/comment/comment.js"></script>+<script src="javascript.js"></script>+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id="nav">+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"/></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">JSON-LD</a>+ </ul>+</div>++<article>+<h2>JSON-LD mode</h2>+++<div><textarea id="code" name="code">+{+ "@context": {+ "name": "http://schema.org/name",+ "description": "http://schema.org/description",+ "image": {+ "@id": "http://schema.org/image",+ "@type": "@id"+ },+ "geo": "http://schema.org/geo",+ "latitude": {+ "@id": "http://schema.org/latitude",+ "@type": "xsd:float"+ },+ "longitude": {+ "@id": "http://schema.org/longitude",+ "@type": "xsd:float"+ },+ "xsd": "http://www.w3.org/2001/XMLSchema#"+ },+ "name": "The Empire State Building",+ "description": "The Empire State Building is a 102-story landmark in New York City.",+ "image": "http://www.civil.usherbrooke.ca/cours/gci215a/empire-state-building.jpg",+ "geo": {+ "latitude": "40.75",+ "longitude": "73.98"+ }+}+</textarea></div>++ <script>+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {+ matchBrackets: true,+ autoCloseBrackets: true,+ mode: "application/ld+json",+ lineWrapping: true+ });+ </script>++ <p>This is a specialization of the <a href="index.html">JavaScript mode</a>.</p>+ </article>diff --git a/data/ext/editorText/codemirror/mode/javascript/test.js b/data/ext/editorText/codemirror/mode/javascript/test.jsnew file mode 100644index 000000000..3f7319611--- /dev/null+++ b/data/ext/editorText/codemirror/mode/javascript/test.js@@ -0,0 +1,151 @@+(function() {+ var mode = CodeMirror.getMode({indentUnit: 2}, "javascript");+ function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }++ MT("locals",+ "[keyword function] [variable foo]([def a], [def b]) { [keyword var] [def c] [operator =] [number 10]; [keyword return] [variable-2 a] [operator +] [variable-2 c] [operator +] [variable d]; }");++ MT("comma-and-binop",+ "[keyword function](){ [keyword var] [def x] [operator =] [number 1] [operator +] [number 2], [def y]; }");++ MT("destructuring",+ "([keyword function]([def a], [[[def b], [def c] ]]) {",+ " [keyword let] {[def d], [property foo]: [def c][operator =][number 10], [def x]} [operator =] [variable foo]([variable-2 a]);",+ " [[[variable-2 c], [variable y] ]] [operator =] [variable-2 c];",+ "})();");++ MT("class",+ "[keyword class] [variable Point] [keyword extends] [variable SuperThing] {",+ " [[ [string-2 /expr/] ]]: [number 24],",+ " [property constructor]([def x], [def y]) {",+ " [keyword super]([string 'something']);",+ " [keyword this].[property x] [operator =] [variable-2 x];",+ " }",+ "}");++ MT("module",+ "[keyword module] [string 'foo'] {",+ " [keyword export] [keyword let] [def x] [operator =] [number 42];",+ " [keyword export] [keyword *] [keyword from] [string 'somewhere'];",+ "}");++ MT("import",+ "[keyword function] [variable foo]() {",+ " [keyword import] [def $] [keyword from] [string 'jquery'];",+ " [keyword module] [def crypto] [keyword from] [string 'crypto'];",+ " [keyword import] { [def encrypt], [def decrypt] } [keyword from] [string 'crypto'];",+ "}");++ MT("const",+ "[keyword function] [variable f]() {",+ " [keyword const] [[ [def a], [def b] ]] [operator =] [[ [number 1], [number 2] ]];",+ "}");++ MT("for/of",+ "[keyword for]([keyword let] [variable of] [keyword of] [variable something]) {}");++ MT("generator",+ "[keyword function*] [variable repeat]([def n]) {",+ " [keyword for]([keyword var] [def i] [operator =] [number 0]; [variable-2 i] [operator <] [variable-2 n]; [operator ++][variable-2 i])",+ " [keyword yield] [variable-2 i];",+ "}");++ MT("fatArrow",+ "[variable array].[property filter]([def a] [operator =>] [variable-2 a] [operator +] [number 1]);",+ "[variable a];", // No longer in scope+ "[keyword let] [variable f] [operator =] ([[ [def a], [def b] ]], [def c]) [operator =>] [variable-2 a] [operator +] [variable-2 c];",+ "[variable c];");++ MT("spread",+ "[keyword function] [variable f]([def a], [meta ...][def b]) {",+ " [variable something]([variable-2 a], [meta ...][variable-2 b]);",+ "}");++ MT("comprehension",+ "[keyword function] [variable f]() {",+ " [[([variable x] [operator +] [number 1]) [keyword for] ([keyword var] [def x] [keyword in] [variable y]) [keyword if] [variable pred]([variable-2 x]) ]];",+ " ([variable u] [keyword for] ([keyword var] [def u] [keyword of] [variable generateValues]()) [keyword if] ([variable-2 u].[property color] [operator ===] [string 'blue']));",+ "}");++ MT("quasi",+ "[variable re][string-2 `fofdlakj${][variable x] [operator +] ([variable re][string-2 `foo`]) [operator +] [number 1][string-2 }fdsa`] [operator +] [number 2]");++ MT("indent_statement",+ "[keyword var] [variable x] [operator =] [number 10]",+ "[variable x] [operator +=] [variable y] [operator +]",+ " [atom Infinity]",+ "[keyword debugger];");++ MT("indent_if",+ "[keyword if] ([number 1])",+ " [keyword break];",+ "[keyword else] [keyword if] ([number 2])",+ " [keyword continue];",+ "[keyword else]",+ " [number 10];",+ "[keyword if] ([number 1]) {",+ " [keyword break];",+ "} [keyword else] [keyword if] ([number 2]) {",+ " [keyword continue];",+ "} [keyword else] {",+ " [number 10];",+ "}");++ MT("indent_for",+ "[keyword for] ([keyword var] [variable i] [operator =] [number 0];",+ " [variable i] [operator <] [number 100];",+ " [variable i][operator ++])",+ " [variable doSomething]([variable i]);",+ "[keyword debugger];");++ MT("indent_c_style",+ "[keyword function] [variable foo]()",+ "{",+ " [keyword debugger];",+ "}");++ MT("multilinestring",+ "[keyword var] [variable x] [operator =] [string 'foo\\]",+ "[string bar'];");++ MT("scary_regexp",+ "[string-2 /foo[[/]]bar/];");++ var jsonld_mode = CodeMirror.getMode(+ {indentUnit: 2},+ {name: "javascript", jsonld: true}+ );+ function LD(name) {+ test.mode(name, jsonld_mode, Array.prototype.slice.call(arguments, 1));+ }++ LD("json_ld_keywords",+ '{',+ ' [meta "@context"]: {',+ ' [meta "@base"]: [string "http://example.com"],',+ ' [meta "@vocab"]: [string "http://xmlns.com/foaf/0.1/"],',+ ' [property "likesFlavor"]: {',+ ' [meta "@container"]: [meta "@list"]',+ ' [meta "@reverse"]: [string "@beFavoriteOf"]',+ ' },',+ ' [property "nick"]: { [meta "@container"]: [meta "@set"] },',+ ' [property "nick"]: { [meta "@container"]: [meta "@index"] }',+ ' },',+ ' [meta "@graph"]: [[ {',+ ' [meta "@id"]: [string "http://dbpedia.org/resource/John_Lennon"],',+ ' [property "name"]: [string "John Lennon"],',+ ' [property "modified"]: {',+ ' [meta "@value"]: [string "2010-05-29T14:17:39+02:00"],',+ ' [meta "@type"]: [string "http://www.w3.org/2001/XMLSchema#dateTime"]',+ ' }',+ ' } ]]',+ '}');++ LD("json_ld_fake",+ '{',+ ' [property "@fake"]: [string "@fake"],',+ ' [property "@contextual"]: [string "@identifier"],',+ ' [property "[email protected]"]: [string "@graphical"],',+ ' [property "@ID"]: [string "@@ID"]',+ '}');+})();diff --git a/data/ext/editorText/codemirror/mode/javascript/typescript.html b/data/ext/editorText/codemirror/mode/javascript/typescript.htmlindex 58315e7ac..9cc5f4932 100644--- a/data/ext/editorText/codemirror/mode/javascript/typescript.html+++ b/data/ext/editorText/codemirror/mode/javascript/typescript.html@@ -1,16 +1,30 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: TypeScript mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="javascript.js"></script>- <link rel="stylesheet" href="../../doc/docs.css">- <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>- </head>- <body>- <h1>CodeMirror: TypeScript mode</h1>++<title>CodeMirror: TypeScript mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="javascript.js"></script>+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">TypeScript</a>+ </ul>+</div>++<article>+<h2>TypeScript mode</h2>+<div><textarea id="code" name="code">class Greeter {@@ -44,5 +58,4 @@ document.body.appendChild(button)</script><p>This is a specialization of the <a href="index.html">JavaScript mode</a>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/jinja2/index.html b/data/ext/editorText/codemirror/mode/jinja2/index.htmlindex 7cd1da233..66bf2ec60 100644--- a/data/ext/editorText/codemirror/mode/jinja2/index.html+++ b/data/ext/editorText/codemirror/mode/jinja2/index.html@@ -1,17 +1,30 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Jinja2 mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="jinja2.js"></script>- <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>- <link rel="stylesheet" href="../../doc/docs.css">- </head>- <body>- <h1>CodeMirror: Jinja2 mode</h1>- <form><textarea id="code" name="code">++<title>CodeMirror: Jinja2 mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="jinja2.js"></script>+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Jinja2</a>+ </ul>+</div>++<article>+<h2>Jinja2 mode</h2>+<form><textarea id="code" name="code"><html style="color: green"><!-- this is a comment --><head>@@ -34,5 +47,4 @@CodeMirror.fromTextArea(document.getElementById("code"), {mode:{name: "jinja2", htmlMode: true}});</script>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/jinja2/jinja2.js b/data/ext/editorText/codemirror/mode/jinja2/jinja2.jsindex 16b06c48e..b28af098d 100644--- a/data/ext/editorText/codemirror/mode/jinja2/jinja2.js+++ b/data/ext/editorText/codemirror/mode/jinja2/jinja2.js@@ -1,7 +1,17 @@CodeMirror.defineMode("jinja2", function() {- var keywords = ["block", "endblock", "for", "endfor", "in", "true", "false",- "loop", "none", "self", "super", "if", "as", "not", "and",- "else", "import", "with", "without", "context"];+ var keywords = ["and", "as", "block", "endblock", "by", "cycle", "debug", "else", "elif",+ "extends", "filter", "endfilter", "firstof", "for",+ "endfor", "if", "endif", "ifchanged", "endifchanged",+ "ifequal", "endifequal", "ifnotequal",+ "endifnotequal", "in", "include", "load", "not", "now", "or",+ "parsed", "regroup", "reversed", "spaceless",+ "endspaceless", "ssi", "templatetag", "openblock",+ "closeblock", "openvariable", "closevariable",+ "openbrace", "closebrace", "opencomment",+ "closecomment", "widthratio", "url", "with", "endwith",+ "get_current_language", "trans", "noop", "blocktrans",+ "endblocktrans", "get_available_languages",+ "get_current_language_bidi", "plural"];keywords = new RegExp("^((" + keywords.join(")|(") + "))\\b");function tokenBase (stream, state) {diff --git a/data/ext/editorText/codemirror/mode/julia/index.html b/data/ext/editorText/codemirror/mode/julia/index.htmlnew file mode 100644index 000000000..945e1a91f--- /dev/null+++ b/data/ext/editorText/codemirror/mode/julia/index.html@@ -0,0 +1,186 @@+<!doctype html>++<title>CodeMirror: Julia mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="julia.js"></script>+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Julia</a>+ </ul>+</div>++<article>+<h2>Julia mode</h2>++ <div><textarea id="code" name="code">+#numbers+1234+1234im+.234+.234im+2.23im+2.3f3+23e2+0x234++#strings+'a'+"asdf"+r"regex"+b"bytestring"++"""+multiline string+"""++#identifiers+a+as123+function_name!++#literal identifier multiples+3x+4[1, 2, 3]++#dicts and indexing+x=[1, 2, 3]+x[end-1]+x={"julia"=>"language of technical computing"}++#exception handling+try+ f()+catch+ @printf "Error"+finally+ g()+end++#types+immutable Color{T<:Number}+ r::T+ g::T+ b::T+end++#functions+function change!(x::Vector{Float64})+ for i = 1:length(x)+ x[i] *= 2+ end+end++#function invocation+f('b', (2, 3)...)++#operators+|=+&=+^=+\-+%=+*=++=+-=+<=+>=+!=+==+%+*+++-+<+>+!+=+|+&+^+\+?+~+:+$+<:+.<+.>+<<+<<=+>>+>>>>+>>=+>>>=+<<=+<<<=+.<=+.>=+.==+->+//+in+...+//+:=+.//=+.*=+./=+.^=+.%=+.+=+.-=+\=+\\=+||+===+&&+|=+.|=+<:+>:+|>+<|+::+x ? y : z++#macros+@spawnat 2 1+1+@eval(:x)++#keywords and operators+if else elseif while for+ begin let end do+try catch finally return break continue+global local const+export import importall using+function macro module baremodule+type immutable quote+true false enumerate+++ </textarea></div>+ <script>+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {+ mode: {name: "julia",+ },+ lineNumbers: true,+ indentUnit: 4,+ matchBrackets: true+ });+ </script>++ <p><strong>MIME types defined:</strong> <code>text/x-julia</code>.</p>+</article>diff --git a/data/ext/editorText/codemirror/mode/julia/julia.js b/data/ext/editorText/codemirror/mode/julia/julia.jsnew file mode 100644index 000000000..cc17eb015--- /dev/null+++ b/data/ext/editorText/codemirror/mode/julia/julia.js@@ -0,0 +1,286 @@+CodeMirror.defineMode("julia", function(_conf, parserConf) {+ var ERRORCLASS = 'error';++ function wordRegexp(words) {+ return new RegExp("^((" + words.join(")|(") + "))\\b");+ }++ var operators = parserConf.operators || /^\.?[|&^\\%*+\-<>!=\/]=?|\?|~|:|\$|\.[<>]|<<=?|>>>?=?|\.[<>=]=|->?|\/\/|\bin\b/;+ var delimiters = parserConf.delimiters || /^[;,()[\]{}]/;+ var identifiers = parserConf.identifiers|| /^[_A-Za-z][_A-Za-z0-9]*!*/;+ var blockOpeners = ["begin", "function", "type", "immutable", "let", "macro", "for", "while", "quote", "if", "else", "elseif", "try", "finally", "catch", "do"];+ var blockClosers = ["end", "else", "elseif", "catch", "finally"];+ var keywordList = ['if', 'else', 'elseif', 'while', 'for', 'begin', 'let', 'end', 'do', 'try', 'catch', 'finally', 'return', 'break', 'continue', 'global', 'local', 'const', 'export', 'import', 'importall', 'using', 'function', 'macro', 'module', 'baremodule', 'type', 'immutable', 'quote', 'typealias', 'abstract', 'bitstype', 'ccall'];+ var builtinList = ['true', 'false', 'enumerate', 'open', 'close', 'nothing', 'NaN', 'Inf', 'print', 'println', 'Int', 'Int8', 'Uint8', 'Int16', 'Uint16', 'Int32', 'Uint32', 'Int64', 'Uint64', 'Int128', 'Uint128', 'Bool', 'Char', 'Float16', 'Float32', 'Float64', 'Array', 'Vector', 'Matrix', 'String', 'UTF8String', 'ASCIIString', 'error', 'warn', 'info', '@printf'];++ //var stringPrefixes = new RegExp("^[br]?('|\")")+ var stringPrefixes = /^(`|'|"{3}|([br]?"))/;+ var keywords = wordRegexp(keywordList);+ var builtins = wordRegexp(builtinList);+ var openers = wordRegexp(blockOpeners);+ var closers = wordRegexp(blockClosers);+ var macro = /^@[_A-Za-z][_A-Za-z0-9]*/;+ var symbol = /^:[_A-Za-z][_A-Za-z0-9]*/;+ var indentInfo = null;++ function in_array(state) {+ var ch = cur_scope(state);+ if(ch=="[" || ch=="{") {+ return true;+ }+ else {+ return false;+ }+ }++ function cur_scope(state) {+ if(state.scopes.length==0) {+ return null;+ }+ return state.scopes[state.scopes.length - 1];+ }++ // tokenizers+ function tokenBase(stream, state) {+ // Handle scope changes+ var leaving_expr = state.leaving_expr;+ if(stream.sol()) {+ leaving_expr = false;+ }+ state.leaving_expr = false;+ if(leaving_expr) {+ if(stream.match(/^'+/)) {+ return 'operator';+ }++ }++ if(stream.match(/^\.{2,3}/)) {+ return 'operator';+ }++ if (stream.eatSpace()) {+ return null;+ }++ var ch = stream.peek();+ // Handle Comments+ if (ch === '#') {+ stream.skipToEnd();+ return 'comment';+ }+ if(ch==='[') {+ state.scopes.push("[");+ }++ if(ch==='{') {+ state.scopes.push("{");+ }++ var scope=cur_scope(state);++ if(scope==='[' && ch===']') {+ state.scopes.pop();+ state.leaving_expr=true;+ }++ if(scope==='{' && ch==='}') {+ state.scopes.pop();+ state.leaving_expr=true;+ }++ if(ch===')') {+ state.leaving_expr = true;+ }++ var match;+ if(!in_array(state) && (match=stream.match(openers, false))) {+ state.scopes.push(match);+ }++ if(!in_array(state) && stream.match(closers, false)) {+ state.scopes.pop();+ }++ if(in_array(state)) {+ if(stream.match(/^end/)) {+ return 'number';+ }++ }++ if(stream.match(/^=>/)) {+ return 'operator';+ }+++ // Handle Number Literals+ if (stream.match(/^[0-9\.]/, false)) {+ var imMatcher = RegExp(/^im\b/);+ var floatLiteral = false;+ // Floats+ if (stream.match(/^\d*\.(?!\.)\d+([ef][\+\-]?\d+)?/i)) { floatLiteral = true; }+ if (stream.match(/^\d+\.(?!\.)\d*/)) { floatLiteral = true; }+ if (stream.match(/^\.\d+/)) { floatLiteral = true; }+ if (floatLiteral) {+ // Float literals may be "imaginary"+ stream.match(imMatcher);+ state.leaving_expr = true;+ return 'number';+ }+ // Integers+ var intLiteral = false;+ // Hex+ if (stream.match(/^0x[0-9a-f]+/i)) { intLiteral = true; }+ // Binary+ if (stream.match(/^0b[01]+/i)) { intLiteral = true; }+ // Octal+ if (stream.match(/^0o[0-7]+/i)) { intLiteral = true; }+ // Decimal+ if (stream.match(/^[1-9]\d*(e[\+\-]?\d+)?/)) {+ intLiteral = true;+ }+ // Zero by itself with no other piece of number.+ if (stream.match(/^0(?![\dx])/i)) { intLiteral = true; }+ if (intLiteral) {+ // Integer literals may be "long"+ stream.match(imMatcher);+ state.leaving_expr = true;+ return 'number';+ }+ }++ if(stream.match(/^(::)|(<:)/)) {+ return 'operator';+ }++ // Handle symbols+ if(!leaving_expr && stream.match(symbol)) {+ return 'string';+ }++ // Handle operators and Delimiters+ if (stream.match(operators)) {+ return 'operator';+ }+++ // Handle Strings+ if (stream.match(stringPrefixes)) {+ state.tokenize = tokenStringFactory(stream.current());+ return state.tokenize(stream, state);+ }++ if (stream.match(macro)) {+ return 'meta';+ }+++ if (stream.match(delimiters)) {+ return null;+ }++ if (stream.match(keywords)) {+ return 'keyword';+ }++ if (stream.match(builtins)) {+ return 'builtin';+ }+++ if (stream.match(identifiers)) {+ state.leaving_expr=true;+ return 'variable';+ }+ // Handle non-detected items+ stream.next();+ return ERRORCLASS;+ }++ function tokenStringFactory(delimiter) {+ while ('rub'.indexOf(delimiter.charAt(0).toLowerCase()) >= 0) {+ delimiter = delimiter.substr(1);+ }+ var singleline = delimiter.length == 1;+ var OUTCLASS = 'string';++ function tokenString(stream, state) {+ while (!stream.eol()) {+ stream.eatWhile(/[^'"\\]/);+ if (stream.eat('\\')) {+ stream.next();+ if (singleline && stream.eol()) {+ return OUTCLASS;+ }+ } else if (stream.match(delimiter)) {+ state.tokenize = tokenBase;+ return OUTCLASS;+ } else {+ stream.eat(/['"]/);+ }+ }+ if (singleline) {+ if (parserConf.singleLineStringErrors) {+ return ERRORCLASS;+ } else {+ state.tokenize = tokenBase;+ }+ }+ return OUTCLASS;+ }+ tokenString.isString = true;+ return tokenString;+ }++ function tokenLexer(stream, state) {+ indentInfo = null;+ var style = state.tokenize(stream, state);+ var current = stream.current();++ // Handle '.' connected identifiers+ if (current === '.') {+ style = stream.match(identifiers, false) ? null : ERRORCLASS;+ if (style === null && state.lastStyle === 'meta') {+ // Apply 'meta' style to '.' connected identifiers when+ // appropriate.+ style = 'meta';+ }+ return style;+ }++ return style;+ }++ var external = {+ startState: function() {+ return {+ tokenize: tokenBase,+ scopes: [],+ leaving_expr: false+ };+ },++ token: function(stream, state) {+ var style = tokenLexer(stream, state);+ state.lastStyle = style;+ return style;+ },++ indent: function(state, textAfter) {+ var delta = 0;+ if(textAfter=="end" || textAfter=="]" || textAfter=="}" || textAfter=="else" || textAfter=="elseif" || textAfter=="catch" || textAfter=="finally") {+ delta = -1;+ }+ return (state.scopes.length + delta) * 4;+ },++ lineComment: "#",+ fold: "indent",+ electricChars: "edlsifyh]}"+ };+ return external;+});+++CodeMirror.defineMIME("text/x-julia", "julia");diff --git a/data/ext/editorText/codemirror/mode/less/index.html b/data/ext/editorText/codemirror/mode/less/index.htmlindex 78c1e5307..7239143c8 100644--- a/data/ext/editorText/codemirror/mode/less/index.html+++ b/data/ext/editorText/codemirror/mode/less/index.html@@ -1,19 +1,32 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: LESS mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="../../addon/edit/matchbrackets.js"></script>- <script src="less.js"></script>- <style>.CodeMirror {background: #f8f8f8; border: 1px solid #ddd; font-size:12px; height: 400px}</style>- <link rel="stylesheet" href="../../doc/docs.css">- <link rel="stylesheet" href="../../theme/lesser-dark.css">- </head>- <body>- <h1>CodeMirror: LESS mode</h1>- <form><textarea id="code" name="code">@media screen and (device-aspect-ratio: 16/9) { … }++<title>CodeMirror: LESS mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<link rel="stylesheet" href="../../theme/lesser-dark.css">+<script src="../../lib/codemirror.js"></script>+<script src="../../addon/edit/matchbrackets.js"></script>+<script src="less.js"></script>+<style>.CodeMirror {background: #f8f8f8; border: 1px solid #ddd; font-size:12px; height: 400px}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">LESS</a>+ </ul>+</div>++<article>+<h2>LESS mode</h2>+<form><textarea id="code" name="code">@media screen and (device-aspect-ratio: 16/9) { … }@media screen and (device-aspect-ratio: 32/18) { … }@media screen and (device-aspect-ratio: 1280/720) { … }@media screen and (device-aspect-ratio: 2560/1440) { … }@@ -737,5 +750,4 @@ td {</script><p><strong>MIME types defined:</strong> <code>text/x-less</code>, <code>text/css</code> (if not previously defined).</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/less/less.js b/data/ext/editorText/codemirror/mode/less/less.jsindex 09f510e03..da681ea67 100644--- a/data/ext/editorText/codemirror/mode/less/less.js+++ b/data/ext/editorText/codemirror/mode/less/less.js@@ -1,7 +1,8 @@/*LESS mode - http://www.lesscss.org/Ported to CodeMirror by Peter Kroon <[email protected]>- Report bugs/issues here: https://github.com/marijnh/CodeMirror/issues GitHub: @peterkroon+ Report bugs/issues here: https://github.com/marijnh/CodeMirror/issues+ GitHub: @peterkroon*/CodeMirror.defineMode("less", function(config) {@@ -17,68 +18,63 @@ CodeMirror.defineMode("less", function(config) {else if (ch == "/" && stream.eat("*")) {state.tokenize = tokenCComment;return tokenCComment(stream, state);- }- else if (ch == "<" && stream.eat("!")) {+ } else if (ch == "<" && stream.eat("!")) {state.tokenize = tokenSGMLComment;return tokenSGMLComment(stream, state);- }- else if (ch == "=") ret(null, "compare");+ } else if (ch == "=") ret(null, "compare");else if (ch == "|" && stream.eat("=")) return ret(null, "compare");else if (ch == "\"" || ch == "'") {state.tokenize = tokenString(ch);return state.tokenize(stream, state);- }- else if (ch == "/") { // e.g.: .png will not be parsed as a class+ } else if (ch == "/") { // e.g.: .png will not be parsed as a classif(stream.eat("/")){state.tokenize = tokenSComment;return tokenSComment(stream, state);- }else{- if(type == "string" || type == "(")return ret("string", "string");- if(state.stack[state.stack.length-1] != undefined)return ret(null, ch);+ } else {+ if(type == "string" || type == "(") return ret("string", "string");+ if(state.stack[state.stack.length-1] !== undefined) return ret(null, ch);stream.eatWhile(/[\a-zA-Z0-9\-_.\s]/);- if( /\/|\)|#/.test(stream.peek() || (stream.eatSpace() && stream.peek() == ")")) || stream.eol() )return ret("string", "string"); // let url(/images/logo.png) without quotes return as string+ if( /\/|\)|#/.test(stream.peek() || (stream.eatSpace() && stream.peek() === ")")) || stream.eol() )return ret("string", "string"); // let url(/images/logo.png) without quotes return as string}- }- else if (ch == "!") {+ } else if (ch == "!") {stream.match(/^\s*\w*/);return ret("keyword", "important");- }- else if (/\d/.test(ch)) {+ } else if (/\d/.test(ch)) {stream.eatWhile(/[\w.%]/);return ret("number", "unit");- }- else if (/[,+<>*\/]/.test(ch)) {+ } else if (/[,+<>*\/]/.test(ch)) {if(stream.peek() == "=" || type == "a")return ret("string", "string");+ if(ch === ",")return ret(null, ch);return ret(null, "select-op");- }- else if (/[;{}:\[\]()~\|]/.test(ch)) {+ } else if (/[;{}:\[\]()~\|]/.test(ch)) {if(ch == ":"){stream.eatWhile(/[a-z\\\-]/);if( selectors.test(stream.current()) ){return ret("tag", "tag");- }else if(stream.peek() == ":"){//::-webkit-search-decoration+ } else if(stream.peek() == ":"){//::-webkit-search-decorationstream.next();stream.eatWhile(/[a-z\\\-]/);if(stream.current().match(/\:\:\-(o|ms|moz|webkit)\-/))return ret("string", "string");if( selectors.test(stream.current().substring(1)) )return ret("tag", "tag");return ret(null, ch);- }else{+ } else {return ret(null, ch);}- }else if(ch == "~"){+ } else if(ch == "~"){if(type == "r")return ret("string", "string");- }else{+ } else {return ret(null, ch);}- }- else if (ch == ".") {- if(type == "(" || type == "string")return ret("string", "string"); // allow url(../image.png)+ } else if (ch == ".") {+ if(type == "(")return ret("string", "string"); // allow url(../image.png)stream.eatWhile(/[\a-zA-Z0-9\-_]/);- if(stream.peek() == " ")stream.eatSpace();- if(stream.peek() == ")")return ret("number", "unit");//rgba(0,0,0,.25);+ if(stream.peek() === " ")stream.eatSpace();+ if(stream.peek() === ")" || type === ":")return ret("number", "unit");//rgba(0,0,0,.25);+ else if(stream.current().length >1){+ if(state.stack[state.stack.length-1] === "rule" && !stream.match(/^[{,+(]/, false)) return ret("number", "unit");+ }return ret("tag", "tag");- }- else if (ch == "#") {+ } else if (ch == "#") {//we don't eat white-space, we want the hex color and or id onlystream.eatWhile(/[A-Za-z0-9]/);//check if there is a proper hex color length e.g. #eee || #eeeEEE@@ -89,7 +85,9 @@ CodeMirror.defineMode("less", function(config) {//eat white-spacestream.eatSpace();//when hex value declaration doesn't end with [;,] but is does with a slash/cc comment treat it as an id, just like the other hex values that don't end with[;,]- if( /[\/<>.(){!$%^&*_\-\\?=+\|#'~`]/.test(stream.peek()) )return ret("atom", "tag");+ if( /[\/<>.(){!$%^&*_\-\\?=+\|#'~`]/.test(stream.peek()) ){+ if(type === "select-op")return ret("number", "unit"); else return ret("atom", "tag");+ }//#time { color: #aaa }else if(stream.peek() == "}" )return ret("number", "unit");//we have a valid hex color value, parse as id whenever an element/class is defined after the hex(id) value e.g. #eee aaa || #eee .aaa@@ -98,38 +96,53 @@ CodeMirror.defineMode("less", function(config) {else if(stream.eol())return ret("atom", "tag");//defaultelse return ret("number", "unit");- }else{//when not a valid hexvalue in the current stream e.g. #footer+ } else {//when not a valid hexvalue in the current stream e.g. #footerstream.eatWhile(/[\w\\\-]/);- return ret("atom", "tag");+ return ret("atom", stream.current());}- }else{//when not a valid hexvalue length+ } else {//when not a valid hexvalue lengthstream.eatWhile(/[\w\\\-]/);+ if(state.stack[state.stack.length-1] === "rule")return ret("atom", stream.current());return ret("atom", stream.current());return ret("atom", "tag");}- }- else if (ch == "&") {+ } else if (ch == "&") {stream.eatWhile(/[\w\-]/);return ret(null, ch);- }- else {+ } else {stream.eatWhile(/[\w\\\-_%.{]/);- if(type == "string"){- return ret("string", "string");- }else if(stream.current().match(/(^http$|^https$)/) != null){+ if(stream.current().match(/\\/) !== null){+ if(stream.current().charAt(stream.current().length-1) === "\\"){+ stream.eat(/\'|\"|\)|\(/);+ while(stream.eatWhile(/[\w\\\-_%.{]/)){+ stream.eat(/\'|\"|\)|\(/);+ }+ return ret("string", stream.current());+ }+ } //else if(type === "tag")return ret("tag", "tag");+ else if(type == "string"){+ if(state.stack[state.stack.length-1] === "{" && stream.peek() === ":")return ret("variable", "variable");+ if(stream.peek() === "/")stream.eatWhile(/[\w\\\-_%.{:\/]/);+ return ret(type, stream.current());+ } else if(stream.current().match(/(^http$|^https$)/) != null){stream.eatWhile(/[\w\\\-_%.{:\/]/);+ if(stream.peek() === "/")stream.eatWhile(/[\w\\\-_%.{:\/]/);return ret("string", "string");- }else if(stream.peek() == "<" || stream.peek() == ">"){+ } else if(stream.peek() == "<" || stream.peek() == ">" || stream.peek() == "+"){+ if(type === "(" && (stream.current() === "n" || stream.current() === "-n"))return ret("string", stream.current());return ret("tag", "tag");- }else if( /\(/.test(stream.peek()) ){+ } else if( /\(/.test(stream.peek()) ){+ if(stream.current() === "when")return ret("variable","variable");+ else if(state.stack[state.stack.length-1] === "@media" && stream.current() === "and")return ret("variable",stream.current());return ret(null, ch);- }else if (stream.peek() == "/" && state.stack[state.stack.length-1] != undefined){ // url(dir/center/image.png)- return ret("string", "string");- }else if( stream.current().match(/\-\d|\-.\d/) ){ // match e.g.: -5px -0.4 etc... only colorize the minus sign+ } else if (stream.peek() == "/" && state.stack[state.stack.length-1] !== undefined){ // url(dir/center/image.png)+ if(stream.peek() === "/")stream.eatWhile(/[\w\\\-_%.{:\/]/);+ return ret("string", stream.current());+ } else if( stream.current().match(/\-\d|\-.\d/) ){ // match e.g.: -5px -0.4 etc... only colorize the minus sign//commment out these 2 comment if you want the minus sign to be parsed as null -500px//stream.backUp(stream.current().length-1);- //return ret(null, ch); //console.log( stream.current() );+ //return ret(null, ch);return ret("number", "unit");- }else if( /\/|[\s\)]/.test(stream.peek() || stream.eol() || (stream.eatSpace() && stream.peek() == "/")) && stream.current().indexOf(".") !== -1){+ } else if( /\/|[\s\)]/.test(stream.peek() || stream.eol() || (stream.eatSpace() && stream.peek() == "/")) && stream.current().indexOf(".") !== -1){if(stream.current().substring(stream.current().length-1,stream.current().length) == "{"){stream.backUp(1);return ret("tag", "tag");@@ -137,14 +150,34 @@ CodeMirror.defineMode("less", function(config) {stream.eatSpace();if( /[{<>.a-zA-Z\/]/.test(stream.peek()) || stream.eol() )return ret("tag", "tag"); // e.g. button.icon-plusreturn ret("string", "string"); // let url(/images/logo.png) without quotes return as string- }else if( stream.eol() || stream.peek() == "[" || stream.peek() == "#" || type == "tag" ){+ } else if( stream.eol() || stream.peek() == "[" || stream.peek() == "#" || type == "tag" ){+if(stream.current().substring(stream.current().length-1,stream.current().length) == "{")stream.backUp(1);+ else if(state.stack[state.stack.length-1] === "border-color" || state.stack[state.stack.length-1] === "background-position" || state.stack[state.stack.length-1] === "font-family")return ret(null, stream.current());+ else if(type === "tag")return ret("tag", "tag");+ else if((type === ":" || type === "unit") && state.stack[state.stack.length-1] === "rule")return ret(null, stream.current());+ else if(state.stack[state.stack.length-1] === "rule" && type === "tag")return ret("string", stream.current());+ else if(state.stack[state.stack.length-1] === ";" && type === ":")return ret(null, stream.current());+ //else if(state.stack[state.stack.length-1] === ";" || type === "")return ret("variable", stream.current());+ else if(stream.peek() === "#" && type !== undefined && type.match(/\+|,|tag|select\-op|}|{|;/g) === null)return ret("string", stream.current());+ else if(type === "variable")return ret(null, stream.current());+ else if(state.stack[state.stack.length-1] === "{" && type === "comment")return ret("variable", stream.current());+ else if(state.stack.length === 0 && (type === ";" || type === "comment"))return ret("tag", stream.current());+ else if((state.stack[state.stack.length-1] === "{" || type === ";") && state.stack[state.stack.length-1] !== "@media{")return ret("variable", stream.current());+ else if(state.stack[state.stack.length-2] === "{" && state.stack[state.stack.length-1] === ";")return ret("variable", stream.current());+return ret("tag", "tag");- }else if(type == "compare" || type == "a" || type == "("){+ } else if(type == "compare" || type == "a" || type == "("){return ret("string", "string");- }else if(type == "|" || stream.current() == "-" || type == "["){+ } else if(type == "|" || stream.current() == "-" || type == "["){+ if (type == "|" && stream.match(/^[\]=~]/, false)) return ret("number", stream.current());+ else if(type == "|" )return ret("tag", "tag");+ else if(type == "["){+ stream.eatWhile(/\w\-/);+ return ret("number", stream.current());+ }return ret(null, ch);- }else if(stream.peek() == ":") {+ } else if((stream.peek() == ":") || ( stream.eatSpace() && stream.peek() == ":")) {stream.next();var t_v = stream.peek() == ":" ? true : false;if(!t_v){@@ -156,12 +189,55 @@ CodeMirror.defineMode("less", function(config) {stream.backUp(new_pos-(old_pos-1));return ret("tag", "tag");} else stream.backUp(new_pos-(old_pos-1));- }else{+ } else {stream.backUp(1);}if(t_v)return ret("tag", "tag"); else return ret("variable", "variable");- }else{- return ret("variable", "variable");+ } else if(state.stack[state.stack.length-1] === "font-family" || state.stack[state.stack.length-1] === "background-position" || state.stack[state.stack.length-1] === "border-color"){+ return ret(null, null);+ } else {++ if(state.stack[state.stack.length-1] === null && type === ":")return ret(null, stream.current());++ //else if((type === ")" && state.stack[state.stack.length-1] === "rule") || (state.stack[state.stack.length-2] === "{" && state.stack[state.stack.length-1] === "rule" && type === "variable"))return ret(null, stream.current());++ else if (/\^|\$/.test(stream.current()) && stream.match(/^[~=]/, false)) return ret("string", "string");//att^=val++ else if(type === "unit" && state.stack[state.stack.length-1] === "rule")return ret(null, "unit");+ else if(type === "unit" && state.stack[state.stack.length-1] === ";")return ret(null, "unit");+ else if(type === ")" && state.stack[state.stack.length-1] === "rule")return ret(null, "unit");+ else if(type && type.match("@") !== null && state.stack[state.stack.length-1] === "rule")return ret(null, "unit");+ //else if(type === "unit" && state.stack[state.stack.length-1] === "rule")return ret(null, stream.current());++ else if((type === ";" || type === "}" || type === ",") && state.stack[state.stack.length-1] === ";")return ret("tag", stream.current());+ else if((type === ";" && stream.peek() !== undefined && !stream.match(/^[{\.]/, false)) ||+ (type === ";" && stream.eatSpace() && !stream.match(/^[{\.]/))) return ret("variable", stream.current());+ else if((type === "@media" && state.stack[state.stack.length-1] === "@media") || type === "@namespace")return ret("tag", stream.current());++ else if(type === "{" && state.stack[state.stack.length-1] === ";" && stream.peek() === "{")return ret("tag", "tag");+ else if((type === "{" || type === ":") && state.stack[state.stack.length-1] === ";")return ret(null, stream.current());+ else if((state.stack[state.stack.length-1] === "{" && stream.eatSpace() && !stream.match(/^[\.#]/)) || type === "select-op" || (state.stack[state.stack.length-1] === "rule" && type === ",") )return ret("tag", "tag");+ else if(type === "variable" && state.stack[state.stack.length-1] === "rule")return ret("tag", "tag");+ else if((stream.eatSpace() && stream.peek() === "{") || stream.eol() || stream.peek() === "{")return ret("tag", "tag");+ //this one messes up indentation+ //else if((type === "}" && stream.peek() !== ":") || (type === "}" && stream.eatSpace() && stream.peek() !== ":"))return(type, "tag");++ else if(type === ")" && (stream.current() == "and" || stream.current() == "and "))return ret("variable", "variable");+ else if(type === ")" && (stream.current() == "when" || stream.current() == "when "))return ret("variable", "variable");+ else if(type === ")" || type === "comment" || type === "{")return ret("tag", "tag");+ else if(stream.sol())return ret("tag", "tag");+ else if((stream.eatSpace() && stream.peek() === "#") || stream.peek() === "#")return ret("tag", "tag");+ else if(state.stack.length === 0)return ret("tag", "tag");+ else if(type === ";" && stream.peek() !== undefined && stream.match(/^[\.|#]/g)) return ret("tag", "tag");++ else if(type === ":"){stream.eatSpace();return ret(null, stream.current());}++ else if(stream.current() === "and " || stream.current() === "and")return ret("variable", stream.current());+ else if(type === ";" && state.stack[state.stack.length-1] === "{")return ret("variable", stream.current());++ else if(state.stack[state.stack.length-1] === "rule")return ret(null, stream.current());++ return ret("tag", stream.current());}}}@@ -238,18 +314,31 @@ CodeMirror.defineMode("less", function(config) {}else if (type == "}") state.stack.pop();else if (type == "@media") state.stack.push("@media");- else if (context == "{" && type != "comment") state.stack.push("rule");+ else if (stream.current() === "font-family") state.stack[state.stack.length-1] = "font-family";+ else if (stream.current() === "background-position") state.stack[state.stack.length-1] = "background-position";+ else if (stream.current() === "border-color") state.stack[state.stack.length-1] = "border-color";+ else if (context == "{" && type != "comment" && type !== "tag") state.stack.push("rule");+ else if (stream.peek() === ":" && stream.current().match(/@|#/) === null) style = type;+ if(type === ";" && (state.stack[state.stack.length-1] == "font-family" || state.stack[state.stack.length-1] == "background-position" || state.stack[state.stack.length-1] == "border-color"))state.stack[state.stack.length-1] = stream.current();+ else if(type === "tag" && stream.peek() === ")" && stream.current().match(/\:/) === null){type = null; style = null;}+ // ????+ else if((type === "variable" && stream.peek() === ")") || (type === "variable" && stream.eatSpace() && stream.peek() === ")"))return ret(null,stream.current());return style;},indent: function(state, textAfter) {var n = state.stack.length;if (/^\}/.test(textAfter))- n -= state.stack[state.stack.length-1] == "rule" ? 2 : 1;+ n -= state.stack[state.stack.length-1] === "rule" ? 2 : 1;+ else if (state.stack[state.stack.length-2] === "{")+ n -= state.stack[state.stack.length-1] === "rule" ? 1 : 0;return state.baseIndent + n * indentUnit;},- electricChars: "}"+ electricChars: "}",+ blockCommentStart: "/*",+ blockCommentEnd: "*/",+ lineComment: "//"};});diff --git a/data/ext/editorText/codemirror/mode/livescript/LICENSE b/data/ext/editorText/codemirror/mode/livescript/LICENSEdeleted file mode 100644index a675c4023..000000000--- a/data/ext/editorText/codemirror/mode/livescript/LICENSE+++ /dev/null@@ -1,23 +0,0 @@-The MIT License--Copyright (c) 2013 Kenneth Bentley-Modified from the CoffeeScript CodeMirror mode, Copyright (c) 2011 Jeff Pickhardt-Modified from the Python CodeMirror mode, Copyright (c) 2010 Timothy Farrell--Permission is hereby granted, free of charge, to any person obtaining a copy-of this software and associated documentation files (the "Software"), to deal-in the Software without restriction, including without limitation the rights-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell-copies of the Software, and to permit persons to whom the Software is-furnished to do so, subject to the following conditions:--The above copyright notice and this permission notice shall be included in-all copies or substantial portions of the Software.--THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN-THE SOFTWARE.diff --git a/data/ext/editorText/codemirror/mode/livescript/index.html b/data/ext/editorText/codemirror/mode/livescript/index.htmlindex 3054e35b0..3ce897485 100644--- a/data/ext/editorText/codemirror/mode/livescript/index.html+++ b/data/ext/editorText/codemirror/mode/livescript/index.html@@ -1,17 +1,31 @@<!doctype html>-<html>- <head>- <title>CodeMirror: LiveScript mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="livescript.js"></script>- <style>.CodeMirror {font-size: 80%;border-top: 1px solid silver; border-bottom: 1px solid silver;}</style>- <link rel="stylesheet" href="../../doc/docs.css">- <link rel="stylesheet" href="../../theme/solarized.css">- </head>- <body>- <h1>CodeMirror: LiveScript mode</h1>- <form><textarea id="code" name="code">++<title>CodeMirror: LiveScript mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<link rel="stylesheet" href="../../theme/solarized.css">+<script src="../../lib/codemirror.js"></script>+<script src="livescript.js"></script>+<style>.CodeMirror {font-size: 80%;border-top: 1px solid silver; border-bottom: 1px solid silver;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">LiveScript</a>+ </ul>+</div>++<article>+<h2>LiveScript mode</h2>+<form><textarea id="code" name="code"># LiveScript mode for CodeMirror# The following script, prelude.ls, is used to# demonstrate LiveScript mode for CodeMirror.@@ -440,7 +454,6 @@ export prelude = out$<p><strong>MIME types defined:</strong> <code>text/x-livescript</code>.</p>- <p>The LiveScript mode was written by Kenneth Bentley (<a href="LICENSE">license</a>).</p>+ <p>The LiveScript mode was written by Kenneth Bentley.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/lua/index.html b/data/ext/editorText/codemirror/mode/lua/index.htmlindex a0a42d91c..7f4eb2c84 100644--- a/data/ext/editorText/codemirror/mode/lua/index.html+++ b/data/ext/editorText/codemirror/mode/lua/index.html@@ -1,19 +1,32 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Lua mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../addon/edit/matchbrackets.js"></script>- <script src="../../lib/codemirror.js"></script>- <script src="lua.js"></script>- <link rel="stylesheet" href="../../theme/neat.css">- <style>.CodeMirror {border: 1px solid black;}</style>- <link rel="stylesheet" href="../../doc/docs.css">- </head>- <body>- <h1>CodeMirror: Lua mode</h1>- <form><textarea id="code" name="code">++<title>CodeMirror: Lua mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<link rel="stylesheet" href="../../theme/neat.css">+<script src="../../addon/edit/matchbrackets.js"></script>+<script src="../../lib/codemirror.js"></script>+<script src="lua.js"></script>+<style>.CodeMirror {border: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Lua</a>+ </ul>+</div>++<article>+<h2>Lua mode</h2>+<form><textarea id="code" name="code">--[[example useless code to show lua syntax highlightingthis is multiline comment@@ -56,7 +69,6 @@ end</textarea></form><script>var editor = CodeMirror.fromTextArea(document.getElementById("code"), {- tabMode: "indent",matchBrackets: true,theme: "neat"});@@ -70,5 +82,4 @@ endthe <code>lua-special</code> style.</p><p><strong>MIME types defined:</strong> <code>text/x-lua</code>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/markdown/index.html b/data/ext/editorText/codemirror/mode/markdown/index.htmlindex 6f97b10e7..a6b541e2e 100644--- a/data/ext/editorText/codemirror/mode/markdown/index.html+++ b/data/ext/editorText/codemirror/mode/markdown/index.html@@ -1,20 +1,36 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Markdown mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="../../addon/edit/continuelist.js"></script>- <script src="../xml/xml.js"></script>- <script src="markdown.js"></script>- <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>- <link rel="stylesheet" href="../../doc/docs.css">- </head>- <body>- <h1>CodeMirror: Markdown mode</h1>--<!-- source: http://daringfireball.net/projects/markdown/basics.text -->++<title>CodeMirror: Markdown mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="../../addon/edit/continuelist.js"></script>+<script src="../xml/xml.js"></script>+<script src="markdown.js"></script>+<style type="text/css">+ .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}+ .cm-s-default .cm-trailing-space-a:before,+ .cm-s-default .cm-trailing-space-b:before {position: absolute; content: "\00B7"; color: #777;}+ .cm-s-default .cm-trailing-space-new-line:before {position: absolute; content: "\21B5"; color: #777;}+ </style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Markdown</a>+ </ul>+</div>++<article>+<h2>Markdown mode</h2><form><textarea id="code" name="code">Markdown: Basics================@@ -340,5 +356,4 @@ Output:<p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#markdown_*">normal</a>, <a href="../../test/index.html#verbose,markdown_*">verbose</a>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/markdown/markdown.js b/data/ext/editorText/codemirror/mode/markdown/markdown.jsindex 72b0d6ced..a571df294 100644--- a/data/ext/editorText/codemirror/mode/markdown/markdown.js+++ b/data/ext/editorText/codemirror/mode/markdown/markdown.js@@ -42,6 +42,16 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {};}());+ // Should characters that affect highlighting be highlighted separate?+ // Does not include characters that will be output (such as `1.` and `-` for lists)+ if (modeCfg.highlightFormatting === undefined)+ modeCfg.highlightFormatting = false;++ // Maximum number of nested blockquotes. Set to 0 for infinite nesting.+ // Excess `>` will emit `error` token.+ if (modeCfg.maxBlockquoteDepth === undefined)+ modeCfg.maxBlockquoteDepth = 0;+// Should underscores in words open/close em/strong?if (modeCfg.underscoresBreakWords === undefined)modeCfg.underscoresBreakWords = true;@@ -56,13 +66,13 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {var header = 'header', code = 'comment'- , quote1 = 'atom'- , quote2 = 'number'+ , quote = 'quote', list1 = 'variable-2', list2 = 'variable-3', list3 = 'keyword', hr = 'hr', image = 'tag'+ , formatting = 'formatting', linkinline = 'link', linkemail = 'link', linktext = 'link'@@ -74,8 +84,9 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {, ulRE = /^[*\-+]\s+/, olRE = /^[0-9]+\.\s+/, taskListRE = /^\[(x| )\](?=\s)/ // Must follow ulRE or olRE- , headerRE = /^(?:\={1,}|-{1,})$/- , textRE = /^[^!\[\]*_\\<>` "'(]+/;+ , atxHeaderRE = /^#+/+ , setextHeaderRE = /^(?:\={1,}|-{1,})$/+ , textRE = /^[^#!\[\]*_\\<>` "'(]+/;function switchInline(stream, state, f) {state.f = state.inline = f;@@ -103,6 +114,9 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {state.f = inlineNormal;state.block = blockNormal;}+ // Reset state.trailingSpace+ state.trailingSpace = 0;+ state.trailingSpaceNewLine = false;// Mark this line as blankstate.thisLineHasContent = false;return null;@@ -110,6 +124,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {function blockNormal(stream, state) {+ var sol = stream.sol();+var prevLineIsList = (state.list !== false);if (state.list !== false && state.indentationDiff >= 0) { // Continued listif (state.indentationDiff < 4) { // Only adjust indentation if *not* a code block@@ -124,39 +140,58 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {state.listDepth = 0;}+ var match = null;if (state.indentationDiff >= 4) {state.indentation -= 4;stream.skipToEnd();return code;} else if (stream.eatSpace()) {return null;- } else if (stream.peek() === '#' || (state.prevLineHasContent && stream.match(headerRE)) ) {- state.header = true;+ } else if (match = stream.match(atxHeaderRE)) {+ state.header = match[0].length <= 6 ? match[0].length : 6;+ if (modeCfg.highlightFormatting) state.formatting = "header";+ state.f = state.inline;+ return getType(state);+ } else if (state.prevLineHasContent && (match = stream.match(setextHeaderRE))) {+ state.header = match[0].charAt(0) == '=' ? 1 : 2;+ if (modeCfg.highlightFormatting) state.formatting = "header";+ state.f = state.inline;+ return getType(state);} else if (stream.eat('>')) {state.indentation++;- state.quote = 1;+ state.quote = sol ? 1 : state.quote + 1;+ if (modeCfg.highlightFormatting) state.formatting = "quote";stream.eatSpace();- while (stream.eat('>')) {- stream.eatSpace();- state.quote++;- }+ return getType(state);} else if (stream.peek() === '[') {return switchInline(stream, state, footnoteLink);} else if (stream.match(hrRE, true)) {return hr;- } else if ((!state.prevLineHasContent || prevLineIsList) && (stream.match(ulRE, true) || stream.match(olRE, true))) {+ } else if ((!state.prevLineHasContent || prevLineIsList) && (stream.match(ulRE, false) || stream.match(olRE, false))) {+ var listType = null;+ if (stream.match(ulRE, true)) {+ listType = 'ul';+ } else {+ stream.match(olRE, true);+ listType = 'ol';+ }state.indentation += 4;state.list = true;state.listDepth++;if (modeCfg.taskLists && stream.match(taskListRE, false)) {state.taskList = true;}+ state.f = state.inline;+ if (modeCfg.highlightFormatting) state.formatting = ["list", "list-" + listType];+ return getType(state);} else if (modeCfg.fencedCodeBlocks && stream.match(/^```([\w+#]*)/, true)) {// try switching modestate.localMode = getMode(RegExp.$1);if (state.localMode) state.localState = state.localMode.startState();switchBlock(stream, state, local);- return code;+ if (modeCfg.highlightFormatting) state.formatting = "code-block";+ state.code = true;+ return getType(state);}return switchInline(stream, state, state.inline);@@ -164,14 +199,11 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {function htmlBlock(stream, state) {var style = htmlMode.token(stream, state.htmlState);- if (htmlFound && style === 'tag' && state.htmlState.type !== 'openTag' && !state.htmlState.context) {+ if ((htmlFound && !state.htmlState.tagName && !state.htmlState.context) ||+ (state.md_inside && stream.current().indexOf(">") > -1)) {state.f = inlineNormal;state.block = blockNormal;- }- if (state.md_inside && stream.current().indexOf(">")!=-1) {- state.f = inlineNormal;- state.block = blockNormal;- state.htmlState.context = undefined;+ state.htmlState = null;}return style;}@@ -181,7 +213,11 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {state.localMode = state.localState = null;state.f = inlineNormal;state.block = blockNormal;- return code;+ if (modeCfg.highlightFormatting) state.formatting = "code-block";+ state.code = true;+ var returnType = getType(state);+ state.code = false;+ return returnType;} else if (state.localMode) {return state.localMode.token(stream, state.localState);} else {@@ -194,8 +230,43 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {function getType(state) {var styles = [];- if (state.taskOpen) { return "meta"; }- if (state.taskClosed) { return "property"; }+ if (state.formatting) {+ styles.push(formatting);++ if (typeof state.formatting === "string") state.formatting = [state.formatting];++ for (var i = 0; i < state.formatting.length; i++) {+ styles.push(formatting + "-" + state.formatting[i]);++ if (state.formatting[i] === "header") {+ styles.push(formatting + "-" + state.formatting[i] + "-" + state.header);+ }++ // Add `formatting-quote` and `formatting-quote-#` for blockquotes+ // Add `error` instead if the maximum blockquote nesting depth is passed+ if (state.formatting[i] === "quote") {+ if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) {+ styles.push(formatting + "-" + state.formatting[i] + "-" + state.quote);+ } else {+ styles.push("error");+ }+ }+ }+ }++ if (state.taskOpen) {+ styles.push("meta");+ return styles.length ? styles.join(' ') : null;+ }+ if (state.taskClosed) {+ styles.push("property");+ return styles.length ? styles.join(' ') : null;+ }++ if (state.linkHref) {+ styles.push(linkhref);+ return styles.length ? styles.join(' ') : null;+ }if (state.strong) { styles.push(strong); }if (state.em) { styles.push(em); }@@ -204,8 +275,19 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {if (state.code) { styles.push(code); }- if (state.header) { styles.push(header); }- if (state.quote) { styles.push(state.quote % 2 ? quote1 : quote2); }+ if (state.header) { styles.push(header); styles.push(header + "-" + state.header); }++ if (state.quote) {+ styles.push(quote);++ // Add `quote-#` where the maximum for `#` is modeCfg.maxBlockquoteDepth+ if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) {+ styles.push(quote + "-" + state.quote);+ } else {+ styles.push(quote + "-" + modeCfg.maxBlockquoteDepth);+ }+ }+if (state.list !== false) {var listMod = (state.listDepth - 1) % 3;if (!listMod) {@@ -217,6 +299,12 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {}}+ if (state.trailingSpaceNewLine) {+ styles.push("trailing-space-new-line");+ } else if (state.trailingSpace) {+ styles.push("trailing-space-" + (state.trailingSpace % 2 ? "a" : "b"));+ }+return styles.length ? styles.join(' ') : null;}@@ -241,6 +329,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {var taskOpen = stream.match(taskListRE, true)[1] !== "x";if (taskOpen) state.taskOpen = true;else state.taskClosed = true;+ if (modeCfg.highlightFormatting) state.formatting = "task";state.taskList = false;return getType(state);}@@ -248,10 +337,24 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {state.taskOpen = false;state.taskClosed = false;+ if (state.header && stream.match(/^#+$/, true)) {+ if (modeCfg.highlightFormatting) state.formatting = "header";+ return getType(state);+ }++ // Get sol() value now, before character is consumed+ var sol = stream.sol();+var ch = stream.next();+ if (state.escape) {+ state.escape = false;+ return getType(state);+ }+if (ch === '\\') {- stream.next();+ if (modeCfg.highlightFormatting) state.formatting = "escape";+ state.escape = true;return getType(state);}@@ -271,6 +374,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {// If this block is changed, it may need to be updated in GFM modeif (ch === '`') {+ var previousFormatting = state.formatting;+ if (modeCfg.highlightFormatting) state.formatting = "code";var t = getType(state);var before = stream.pos;stream.eatWhile('`');@@ -284,6 +389,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {state.code = false;return t;}+ state.formatting = previousFormatting;return getType(state);}} else if (state.code) {@@ -298,10 +404,12 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {if (ch === '[' && stream.match(/.*\](\(| ?\[)/, false)) {state.linkText = true;+ if (modeCfg.highlightFormatting) state.formatting = "link";return getType(state);}if (ch === ']' && state.linkText) {+ if (modeCfg.highlightFormatting) state.formatting = "link";var type = getType(state);state.linkText = false;state.inline = state.f = linkHref;@@ -309,21 +417,38 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {}if (ch === '<' && stream.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/, false)) {- return switchInline(stream, state, inlineElement(linkinline, '>'));+ state.f = state.inline = linkInline;+ if (modeCfg.highlightFormatting) state.formatting = "link";+ var type = getType(state);+ if (type){+ type += " ";+ } else {+ type = "";+ }+ return type + linkinline;}if (ch === '<' && stream.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/, false)) {- return switchInline(stream, state, inlineElement(linkemail, '>'));+ state.f = state.inline = linkInline;+ if (modeCfg.highlightFormatting) state.formatting = "link";+ var type = getType(state);+ if (type){+ type += " ";+ } else {+ type = "";+ }+ return type + linkemail;}if (ch === '<' && stream.match(/^\w/, false)) {- if (stream.string.indexOf(">")!=-1) {+ if (stream.string.indexOf(">") != -1) {var atts = stream.string.substring(1,stream.string.indexOf(">"));if (/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(atts)) {state.md_inside = true;}}stream.backUp(1);+ state.htmlState = CodeMirror.startState(htmlMode);return switchBlock(stream, state, htmlBlock);}@@ -344,19 +469,26 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {}}}- var t = getType(state);if (ch === '*' || (ch === '_' && !ignoreUnderscore)) {- if (state.strong === ch && stream.eat(ch)) { // Remove STRONG+ if (sol && stream.peek() === ' ') {+ // Do nothing, surrounded by newline and space+ } else if (state.strong === ch && stream.eat(ch)) { // Remove STRONG+ if (modeCfg.highlightFormatting) state.formatting = "strong";+ var t = getType(state);state.strong = false;return t;} else if (!state.strong && stream.eat(ch)) { // Add STRONGstate.strong = ch;+ if (modeCfg.highlightFormatting) state.formatting = "strong";return getType(state);} else if (state.em === ch) { // Remove EM+ if (modeCfg.highlightFormatting) state.formatting = "em";+ var t = getType(state);state.em = false;return t;} else if (!state.em) { // Add EMstate.em = ch;+ if (modeCfg.highlightFormatting) state.formatting = "em";return getType(state);}} else if (ch === ' ') {@@ -369,9 +501,37 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {}}+ if (ch === ' ') {+ if (stream.match(/ +$/, false)) {+ state.trailingSpace++;+ } else if (state.trailingSpace) {+ state.trailingSpaceNewLine = true;+ }+ }+return getType(state);}+ function linkInline(stream, state) {+ var ch = stream.next();++ if (ch === ">") {+ state.f = state.inline = inlineNormal;+ if (modeCfg.highlightFormatting) state.formatting = "link";+ var type = getType(state);+ if (type){+ type += " ";+ } else {+ type = "";+ }+ return type + linkinline;+ }++ stream.match(/^[^>]+/, true);++ return linkinline;+ }+function linkHref(stream, state) {// Check if space, and return NULL if so (to avoid marking the space)if(stream.eatSpace()){@@ -379,19 +539,60 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {}var ch = stream.next();if (ch === '(' || ch === '[') {- return switchInline(stream, state, inlineElement(linkhref, ch === '(' ? ')' : ']'));+ state.f = state.inline = getLinkHrefInside(ch === "(" ? ")" : "]");+ if (modeCfg.highlightFormatting) state.formatting = "link-string";+ state.linkHref = true;+ return getType(state);}return 'error';}+ function getLinkHrefInside(endChar) {+ return function(stream, state) {+ var ch = stream.next();++ if (ch === endChar) {+ state.f = state.inline = inlineNormal;+ if (modeCfg.highlightFormatting) state.formatting = "link-string";+ var returnState = getType(state);+ state.linkHref = false;+ return returnState;+ }++ if (stream.match(inlineRE(endChar), true)) {+ stream.backUp(1);+ }++ state.linkHref = true;+ return getType(state);+ };+ }+function footnoteLink(stream, state) {- if (stream.match(/^[^\]]*\]:/, true)) {- state.f = footnoteUrl;- return linktext;+ if (stream.match(/^[^\]]*\]:/, false)) {+ state.f = footnoteLinkInside;+ stream.next(); // Consume [+ if (modeCfg.highlightFormatting) state.formatting = "link";+ state.linkText = true;+ return getType(state);}return switchInline(stream, state, inlineNormal);}+ function footnoteLinkInside(stream, state) {+ if (stream.match(/^\]:/, true)) {+ state.f = state.inline = footnoteUrl;+ if (modeCfg.highlightFormatting) state.formatting = "link";+ var returnType = getType(state);+ state.linkText = false;+ return returnType;+ }++ stream.match(/^[^\]]+/, true);++ return linktext;+ }+function footnoteUrl(stream, state) {// Check if space, and return NULL if so (to avoid marking the space)if(stream.eatSpace()){@@ -421,16 +622,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {return savedInlineRE[endChar];}- function inlineElement(type, endChar, next) {- next = next || inlineNormal;- return function(stream, state) {- stream.match(inlineRE(endChar));- state.inline = state.f = next;- return type;- };- }-- return {+ var mode = {startState: function() {return {f: blockNormal,@@ -439,21 +631,26 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {thisLineHasContent: false,block: blockNormal,- htmlState: CodeMirror.startState(htmlMode),+ htmlState: null,indentation: 0,inline: inlineNormal,text: handleText,+ escape: false,+ formatting: false,linkText: false,+ linkHref: false,linkTitle: false,em: false,strong: false,- header: false,+ header: 0,taskList: false,list: false,listDepth: 0,- quote: 0+ quote: 0,+ trailingSpace: 0,+ trailingSpaceNewLine: false};},@@ -465,7 +662,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {thisLineHasContent: s.thisLineHasContent,block: s.block,- htmlState: CodeMirror.copyState(htmlMode, s.htmlState),+ htmlState: s.htmlState && CodeMirror.copyState(htmlMode, s.htmlState),indentation: s.indentation,localMode: s.localMode,@@ -473,6 +670,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {inline: s.inline,text: s.text,+ escape: false,+ formatting: false,linkTitle: s.linkTitle,em: s.em,strong: s.strong,@@ -481,13 +680,24 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {list: s.list,listDepth: s.listDepth,quote: s.quote,+ trailingSpace: s.trailingSpace,+ trailingSpaceNewLine: s.trailingSpaceNewLine,md_inside: s.md_inside};},token: function(stream, state) {++ // Reset state.formatting+ state.formatting = false;+if (stream.sol()) {- if (stream.match(/^\s*$/, true)) {+ var forceBlankLine = stream.match(/^\s*$/, true) || state.header;++ // Reset state.header+ state.header = 0;++ if (forceBlankLine) {state.prevLineHasContent = false;return blankLine(state);} else {@@ -495,8 +705,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {state.thisLineHasContent = true;}- // Reset state.header- state.header = false;+ // Reset state.escape+ state.escape = false;// Reset state.taskListstate.taskList = false;@@ -504,6 +714,10 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {// Reset state.codestate.code = false;+ // Reset state.trailingSpace+ state.trailingSpace = 0;+ state.trailingSpaceNewLine = false;+state.f = state.block;var indentation = stream.match(/^\s*/, true)[0].replace(/\t/g, ' ').length;var difference = Math.floor((indentation - state.indentation) / 4) * 4;@@ -516,11 +730,19 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {return state.f(stream, state);},+ innerMode: function(state) {+ if (state.block == htmlBlock) return {state: state.htmlState, mode: htmlMode};+ if (state.localState) return {state: state.localState, mode: state.localMode};+ return {state: state, mode: mode};+ },+blankLine: blankLine,- getType: getType- };+ getType: getType,+ fold: "markdown"+ };+ return mode;}, "xml");CodeMirror.defineMIME("text/x-markdown", "markdown");diff --git a/data/ext/editorText/codemirror/mode/markdown/test.js b/data/ext/editorText/codemirror/mode/markdown/test.jsindex 99ae05613..c3016d3a6 100644--- a/data/ext/editorText/codemirror/mode/markdown/test.js+++ b/data/ext/editorText/codemirror/mode/markdown/test.js@@ -1,10 +1,75 @@(function() {var mode = CodeMirror.getMode({tabSize: 4}, "markdown");function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }+ var modeHighlightFormatting = CodeMirror.getMode({tabSize: 4}, {name: "markdown", highlightFormatting: true});+ function FT(name) { test.mode(name, modeHighlightFormatting, Array.prototype.slice.call(arguments, 1)); }++ FT("formatting_emAsterisk",+ "[em&formatting&formatting-em *][em foo][em&formatting&formatting-em *]");++ FT("formatting_emUnderscore",+ "[em&formatting&formatting-em _][em foo][em&formatting&formatting-em _]");++ FT("formatting_strongAsterisk",+ "[strong&formatting&formatting-strong **][strong foo][strong&formatting&formatting-strong **]");++ FT("formatting_strongUnderscore",+ "[strong&formatting&formatting-strong __][strong foo][strong&formatting&formatting-strong __]");++ FT("formatting_codeBackticks",+ "[comment&formatting&formatting-code `][comment foo][comment&formatting&formatting-code `]");++ FT("formatting_doubleBackticks",+ "[comment&formatting&formatting-code ``][comment foo ` bar][comment&formatting&formatting-code ``]");++ FT("formatting_atxHeader",+ "[header&header-1&formatting&formatting-header&formatting-header-1 #][header&header-1 foo # bar ][header&header-1&formatting&formatting-header&formatting-header-1 #]");++ FT("formatting_setextHeader",+ "foo",+ "[header&header-1&formatting&formatting-header&formatting-header-1 =]");++ FT("formatting_blockquote",+ "[quote"e-1&formatting&formatting-quote&formatting-quote-1 > ][quote"e-1 foo]");++ FT("formatting_list",+ "[variable-2&formatting&formatting-list&formatting-list-ul - ][variable-2 foo]");+ FT("formatting_list",+ "[variable-2&formatting&formatting-list&formatting-list-ol 1. ][variable-2 foo]");++ FT("formatting_link",+ "[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string (][string http://example.com/][string&formatting&formatting-link-string )]");++ FT("formatting_linkReference",+ "[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string [][string bar][string&formatting&formatting-link-string ]]]",+ "[link&formatting&formatting-link [][link bar][link&formatting&formatting-link ]]:] [string http://example.com/]");++ FT("formatting_linkWeb",+ "[link&formatting&formatting-link <][link http://example.com/][link&formatting&formatting-link >]");++ FT("formatting_linkEmail",+ "[link&formatting&formatting-link <][link [email protected]][link&formatting&formatting-link >]");++ FT("formatting_escape",+ "[formatting&formatting-escape \\]*");MT("plainText","foo");+ // Don't style single trailing space+ MT("trailingSpace1",+ "foo ");++ // Two or more trailing spaces should be styled with line break character+ MT("trailingSpace2",+ "foo[trailing-space-a ][trailing-space-new-line ]");++ MT("trailingSpace3",+ "foo[trailing-space-a ][trailing-space-b ][trailing-space-new-line ]");++ MT("trailingSpace4",+ "foo[trailing-space-a ][trailing-space-b ][trailing-space-a ][trailing-space-new-line ]");+// Code blocks using 4 spaces (regardless of CodeMirror.tabSize value)MT("codeBlocksUsing4Spaces"," [comment foo]");@@ -73,27 +138,31 @@// http://daringfireball.net/projects/markdown/syntax#headerMT("atxH1",- "[header # foo]");+ "[header&header-1 # foo]");MT("atxH2",- "[header ## foo]");+ "[header&header-2 ## foo]");MT("atxH3",- "[header ### foo]");+ "[header&header-3 ### foo]");MT("atxH4",- "[header #### foo]");+ "[header&header-4 #### foo]");MT("atxH5",- "[header ##### foo]");+ "[header&header-5 ##### foo]");MT("atxH6",- "[header ###### foo]");+ "[header&header-6 ###### foo]");// H6 - 7x '#' should still be H6, per Dingus// http://daringfireball.net/projects/markdown/dingusMT("atxH6NotH7",- "[header ####### foo]");+ "[header&header-6 ####### foo]");++ // Inline styles should be parsed inside headers+ MT("atxH1inline",+ "[header&header-1 # foo ][header&header-1&em *bar*]");// Setext headers - H1, H2// Per documentation, "Any number of underlining =’s or -’s will work."@@ -105,69 +174,69 @@// Check if single underlining = worksMT("setextH1","foo",- "[header =]");+ "[header&header-1 =]");// Check if 3+ ='s workMT("setextH1","foo",- "[header ===]");+ "[header&header-1 ===]");// Check if single underlining - worksMT("setextH2","foo",- "[header -]");+ "[header&header-2 -]");// Check if 3+ -'s workMT("setextH2","foo",- "[header ---]");+ "[header&header-2 ---]");// Single-line blockquote with trailing spaceMT("blockquoteSpace",- "[atom > foo]");+ "[quote"e-1 > foo]");// Single-line blockquoteMT("blockquoteNoSpace",- "[atom >foo]");+ "[quote"e-1 >foo]");// No blank line before blockquoteMT("blockquoteNoBlankLine","foo",- "[atom > bar]");+ "[quote"e-1 > bar]");// Nested blockquoteMT("blockquoteSpace",- "[atom > foo]",- "[number > > foo]",- "[atom > > > foo]");+ "[quote"e-1 > foo]",+ "[quote"e-1 >][quote"e-2 > foo]",+ "[quote"e-1 >][quote"e-2 >][quote"e-3 > foo]");// Single-line blockquote followed by normal paragraphMT("blockquoteThenParagraph",- "[atom >foo]",+ "[quote"e-1 >foo]","","bar");// Multi-line blockquote (lazy mode)MT("multiBlockquoteLazy",- "[atom >foo]",- "[atom bar]");+ "[quote"e-1 >foo]",+ "[quote"e-1 bar]");// Multi-line blockquote followed by normal paragraph (lazy mode)MT("multiBlockquoteLazyThenParagraph",- "[atom >foo]",- "[atom bar]",+ "[quote"e-1 >foo]",+ "[quote"e-1 bar]","","hello");// Multi-line blockquote (non-lazy mode)MT("multiBlockquote",- "[atom >foo]",- "[atom >bar]");+ "[quote"e-1 >foo]",+ "[quote"e-1 >bar]");// Multi-line blockquote followed by normal paragraph (non-lazy mode)MT("multiBlockquoteThenParagraph",- "[atom >foo]",- "[atom >bar]",+ "[quote"e-1 >foo]",+ "[quote"e-1 >bar]","","hello");@@ -207,6 +276,11 @@"1. bar","2. hello");+ // List after header+ MT("listAfterHeader",+ "[header&header-1 # foo]",+ "[variable-2 - bar]");+// Formatting in lists (*)MT("listAsteriskFormatting","[variable-2 * ][variable-2&em *foo*][variable-2 bar]",@@ -292,7 +366,7 @@"","[variable-2 * bar]","",- " [variable-2&atom > hello]");+ " [variable-2"e"e-1 > hello]");// Code blockMT("blockquoteCode",@@ -350,7 +424,7 @@""," [variable-3 + bar]","",- " [atom&variable-3 > hello]");+ " [quote"e-1&variable-3 > hello]");MT("listCode","[variable-2 * foo]",@@ -563,6 +637,10 @@MT("emEscapedBySpaceOut","foo _ bar[em _hello_]world");+ MT("emEscapedByNewline",+ "foo",+ "_ bar[em _hello_]world");+// Unclosed emphasis characters// Instead of simply marking as EM / STRONG, it would be nice to have an// incomplete flag for EM and STRONG, that is styled slightly different.@@ -629,6 +707,10 @@MT("doubleEscapeHash","\\\\# foo");+ MT("escapeNewline",+ "\\",+ "[em *foo*]");+// Tests to make sure GFM-specific things aren't getting throughdiff --git a/data/ext/editorText/codemirror/mode/meta.js b/data/ext/editorText/codemirror/mode/meta.jsindex e8cfc8fb6..a3989c553 100644--- a/data/ext/editorText/codemirror/mode/meta.js+++ b/data/ext/editorText/codemirror/mode/meta.js@@ -13,12 +13,18 @@ CodeMirror.modeInfo = [{name: 'CSS', mime: 'text/css', mode: 'css'},{name: 'D', mime: 'text/x-d', mode: 'd'},{name: 'diff', mime: 'text/x-diff', mode: 'diff'},+ {name: 'DTD', mime: 'application/xml-dtd', mode: 'dtd'},{name: 'ECL', mime: 'text/x-ecl', mode: 'ecl'},+ {name: 'Eiffel', mime: 'text/x-eiffel', mode: 'eiffel'},{name: 'Erlang', mime: 'text/x-erlang', mode: 'erlang'},+ {name: 'Fortran', mime: 'text/x-fortran', mode: 'fortran'},+ {name: 'F#', mime: 'text/x-fsharp', mode: 'mllike'},{name: 'Gas', mime: 'text/x-gas', mode: 'gas'},- {name: 'GitHub Flavored Markdown', mode: 'gfm'},- {name: 'GO', mime: 'text/x-go', mode: 'go'},+ {name: 'Gherkin', mime: 'text/x-feature', mode: 'gherkin'},+ {name: 'GitHub Flavored Markdown', mime: 'text/x-gfm', mode: 'gfm'},+ {name: 'Go', mime: 'text/x-go', mode: 'go'},{name: 'Groovy', mime: 'text/x-groovy', mode: 'groovy'},+ {name: 'HAML', mime: 'text/x-haml', mode: 'haml'},{name: 'Haskell', mime: 'text/x-haskell', mode: 'haskell'},{name: 'Haxe', mime: 'text/x-haxe', mode: 'haxe'},{name: 'ASP.NET', mime: 'application/x-aspx', mode: 'htmlembedded'},@@ -26,26 +32,34 @@ CodeMirror.modeInfo = [{name: 'JavaServer Pages', mime: 'application/x-jsp', mode: 'htmlembedded'},{name: 'HTML', mime: 'text/html', mode: 'htmlmixed'},{name: 'HTTP', mime: 'message/http', mode: 'http'},+ {name: 'Jade', mime: 'text/x-jade', mode: 'jade'},{name: 'JavaScript', mime: 'text/javascript', mode: 'javascript'},{name: 'JSON', mime: 'application/x-json', mode: 'javascript'},{name: 'JSON', mime: 'application/json', mode: 'javascript'},+ {name: 'JSON-LD', mime: 'application/ld+json', mode: 'javascript'},{name: 'TypeScript', mime: 'application/typescript', mode: 'javascript'},- {name: 'Jinja2', mime: 'jinja2', mode: 'jinja2'},+ {name: 'Jinja2', mime: null, mode: 'jinja2'},+ {name: 'Julia', mime: 'text/x-julia', mode: 'julia'},{name: 'LESS', mime: 'text/x-less', mode: 'less'},{name: 'LiveScript', mime: 'text/x-livescript', mode: 'livescript'},{name: 'Lua', mime: 'text/x-lua', mode: 'lua'},{name: 'Markdown (GitHub-flavour)', mime: 'text/x-markdown', mode: 'markdown'},{name: 'mIRC', mime: 'text/mirc', mode: 'mirc'},+ {name: 'Nginx', mime: 'text/x-nginx-conf', mode: 'nginx'},{name: 'NTriples', mime: 'text/n-triples', mode: 'ntriples'},- {name: 'OCaml', mime: 'text/x-ocaml', mode: 'ocaml'},+ {name: 'OCaml', mime: 'text/x-ocaml', mode: 'mllike'},+ {name: 'Octave', mime: 'text/x-octave', mode: 'octave'},{name: 'Pascal', mime: 'text/x-pascal', mode: 'pascal'},+ {name: 'PEG.js', mime: null, mode: 'pegjs'},{name: 'Perl', mime: 'text/x-perl', mode: 'perl'},{name: 'PHP', mime: 'text/x-php', mode: 'php'},{name: 'PHP(HTML)', mime: 'application/x-httpd-php', mode: 'php'},{name: 'Pig', mime: 'text/x-pig', mode: 'pig'},{name: 'Plain Text', mime: 'text/plain', mode: 'null'},- {name: 'Properties files', mime: 'text/x-properties', mode: 'clike'},+ {name: 'Properties files', mime: 'text/x-properties', mode: 'properties'},{name: 'Python', mime: 'text/x-python', mode: 'python'},+ {name: 'Puppet', mime: 'text/x-puppet', mode: 'puppet'},+ {name: 'Cython', mime: 'text/x-cython', mode: 'python'},{name: 'R', mime: 'text/x-rsrc', mode: 'r'},{name: 'reStructuredText', mime: 'text/x-rst', mode: 'rst'},{name: 'Ruby', mime: 'text/x-ruby', mode: 'ruby'},@@ -57,6 +71,8 @@ CodeMirror.modeInfo = [{name: 'Sieve', mime: 'application/sieve', mode: 'sieve'},{name: 'Smalltalk', mime: 'text/x-stsrc', mode: 'smalltalk'},{name: 'Smarty', mime: 'text/x-smarty', mode: 'smarty'},+ {name: 'SmartyMixed', mime: 'text/x-smarty', mode: 'smartymixed'},+ {name: 'Solr', mime: 'text/x-solr', mode: 'solr'},{name: 'SPARQL', mime: 'application/x-sparql-query', mode: 'sparql'},{name: 'SQL', mime: 'text/x-sql', mode: 'sql'},{name: 'MariaDB', mime: 'text/x-mariadb', mode: 'sql'},@@ -65,6 +81,8 @@ CodeMirror.modeInfo = [{name: 'Tcl', mime: 'text/x-tcl', mode: 'tcl'},{name: 'TiddlyWiki ', mime: 'text/x-tiddlywiki', mode: 'tiddlywiki'},{name: 'Tiki wiki', mime: 'text/tiki', mode: 'tiki'},+ {name: 'TOML', mime: 'text/x-toml', mode: 'toml'},+ {name: 'Turtle', mime: 'text/turtle', mode: 'turtle'},{name: 'VB.NET', mime: 'text/x-vb', mode: 'vb'},{name: 'VBScript', mime: 'text/vbscript', mode: 'vbscript'},{name: 'Velocity', mime: 'text/velocity', mode: 'velocity'},diff --git a/data/ext/editorText/codemirror/mode/mirc/index.html b/data/ext/editorText/codemirror/mode/mirc/index.htmlindex 0ff5ec9a2..c346f1c7e 100644--- a/data/ext/editorText/codemirror/mode/mirc/index.html+++ b/data/ext/editorText/codemirror/mode/mirc/index.html@@ -1,18 +1,31 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: mIRC mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="mirc.js"></script>- <link rel="stylesheet" href="../../theme/twilight.css">- <style>.CodeMirror {border: 1px solid black;}</style>- <link rel="stylesheet" href="../../doc/docs.css">- </head>- <body>- <h1>CodeMirror: mIRC mode</h1>- <form><textarea id="code" name="code">++<title>CodeMirror: mIRC mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<link rel="stylesheet" href="../../theme/twilight.css">+<script src="../../lib/codemirror.js"></script>+<script src="mirc.js"></script>+<style>.CodeMirror {border: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">mIRC</a>+ </ul>+</div>++<article>+<h2>mIRC mode</h2>+<form><textarea id="code" name="code">;AKA Nick Tracker by Ford_Lawnmower irc.GeekShed.net #Script-Help;*****************************************************************************;;**Start Setup@@ -134,10 +147,9 @@ Raw 315:*: {</textarea></form><script>var editor = CodeMirror.fromTextArea(document.getElementById("code"), {- tabMode: "indent",- theme: "twilight",+ theme: "twilight",lineNumbers: true,- matchBrackets: true,+ matchBrackets: true,indentUnit: 4,mode: "text/mirc"});@@ -145,5 +157,4 @@ Raw 315:*: {<p><strong>MIME types defined:</strong> <code>text/mirc</code>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/ocaml/index.html b/data/ext/editorText/codemirror/mode/mllike/index.htmlsimilarity index 70%rename from data/ext/editorText/codemirror/mode/ocaml/index.htmlrename to data/ext/editorText/codemirror/mode/mllike/index.htmlindex c10a84fad..67bfef858 100644--- a/data/ext/editorText/codemirror/mode/ocaml/index.html+++ b/data/ext/editorText/codemirror/mode/mllike/index.html@@ -1,21 +1,35 @@<!doctype html>-<meta charset=utf-8>-<title>CodeMirror: OCaml mode</title>-<link rel=stylesheet href=../../lib/codemirror.css>-<link rel=stylesheet href=../../doc/docs.css>+<title>CodeMirror: ML-like mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">+<link rel=stylesheet href=../../lib/codemirror.css>+<script src=../../lib/codemirror.js></script>+<script src=../../addon/edit/matchbrackets.js></script>+<script src=mllike.js></script><style type=text/css>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>-<script src=../../lib/codemirror.js></script>-<script src=../../addon/edit/matchbrackets.js></script>-<script src=ocaml.js></script>+ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">ML-like</a>+ </ul>+</div>++<article>+<h2>OCaml mode</h2>-<h1>CodeMirror: OCaml mode</h1>-<textarea id=code>+<textarea id="ocamlCode">(* Summing a list of integers *)let rec sum xs =match xs with@@ -75,7 +89,7 @@ let rec sort = functionand insert elem = function| [] -> [elem]- | x :: l ->+ | x :: l ->if elem < x then elem :: x :: l else x :: insert elem l;;(* Imperative features *)@@ -120,12 +134,46 @@ let () =(* OCaml page on Wikipedia - http://en.wikipedia.org/wiki/OCaml *)</textarea>+<h2>F# mode</h2>+<textarea id="fsharpCode">+module CodeMirror.FSharp++let rec fib = function+ | 0 -> 0+ | 1 -> 1+ | n -> fib (n - 1) + fib (n - 2)++type Point =+ {+ x : int+ y : int+ }++type Color =+ | Red+ | Green+ | Blue++[0 .. 10]+|> List.map ((+) 2)+|> List.fold (fun x y -> x + y) 0+|> printf "%i"+</textarea>++<script>- var editor = CodeMirror.fromTextArea(document.getElementById('code'), {- mode: 'ocaml',+ var ocamlEditor = CodeMirror.fromTextArea(document.getElementById('ocamlCode'), {+ mode: 'text/x-ocaml',+ lineNumbers: true,+ matchBrackets: true+ });++ var fsharpEditor = CodeMirror.fromTextArea(document.getElementById('fsharpCode'), {+ mode: 'text/x-fsharp',lineNumbers: true,matchBrackets: true});</script>-<p><strong>MIME types defined:</strong> <code>text/x-ocaml</code>.</p>+<p><strong>MIME types defined:</strong> <code>text/x-ocaml</code> (OCaml) and <code>text/x-fsharp</code> (F#).</p>+</article>diff --git a/data/ext/editorText/codemirror/mode/ocaml/ocaml.js b/data/ext/editorText/codemirror/mode/mllike/mllike.jssimilarity index 56%rename from data/ext/editorText/codemirror/mode/ocaml/ocaml.jsrename to data/ext/editorText/codemirror/mode/mllike/mllike.jsindex 32cbc0b7b..1d64789a1 100644--- a/data/ext/editorText/codemirror/mode/ocaml/ocaml.js+++ b/data/ext/editorText/codemirror/mode/mllike/mllike.js@@ -1,14 +1,11 @@-CodeMirror.defineMode('ocaml', function() {+CodeMirror.defineMode('mllike', function(_config, parserConfig) {var words = {- 'true': 'atom',- 'false': 'atom','let': 'keyword','rec': 'keyword','in': 'keyword','of': 'keyword','and': 'keyword',- 'succ': 'keyword','if': 'keyword','then': 'keyword','else': 'keyword',@@ -25,17 +22,19 @@ CodeMirror.defineMode('ocaml', function() {'match': 'keyword','with': 'keyword','try': 'keyword',- 'raise': 'keyword',- 'begin': 'keyword',- 'end': 'keyword','open': 'builtin',- 'trace': 'builtin','ignore': 'builtin',- 'exit': 'builtin',- 'print_string': 'builtin',- 'print_endline': 'builtin'+ 'begin': 'keyword',+ 'end': 'keyword'};+ var extraWords = parserConfig.extraWords || {};+ for (var prop in extraWords) {+ if (extraWords.hasOwnProperty(prop)) {+ words[prop] = parserConfig.extraWords[prop];+ }+ }+function tokenBase(stream, state) {var ch = stream.next();@@ -58,6 +57,10 @@ CodeMirror.defineMode('ocaml', function() {stream.eatWhile(/\w/);return 'quote';}+ if (ch === '/' && parserConfig.slashComments && stream.eat('/')) {+ stream.skipToEnd();+ return 'comment';+ }if (/\d/.test(ch)) {stream.eatWhile(/[\d]/);if (stream.eat('.')) {@@ -109,8 +112,80 @@ CodeMirror.defineMode('ocaml', function() {},blockCommentStart: "(*",- blockCommentEnd: "*)"+ blockCommentEnd: "*)",+ lineComment: parserConfig.slashComments ? "//" : null};});-CodeMirror.defineMIME('text/x-ocaml', 'ocaml');+CodeMirror.defineMIME('text/x-ocaml', {+ name: 'mllike',+ extraWords: {+ 'succ': 'keyword',+ 'trace': 'builtin',+ 'exit': 'builtin',+ 'print_string': 'builtin',+ 'print_endline': 'builtin',+ 'true': 'atom',+ 'false': 'atom',+ 'raise': 'keyword'+ }+});++CodeMirror.defineMIME('text/x-fsharp', {+ name: 'mllike',+ extraWords: {+ 'abstract': 'keyword',+ 'as': 'keyword',+ 'assert': 'keyword',+ 'base': 'keyword',+ 'class': 'keyword',+ 'default': 'keyword',+ 'delegate': 'keyword',+ 'downcast': 'keyword',+ 'downto': 'keyword',+ 'elif': 'keyword',+ 'exception': 'keyword',+ 'extern': 'keyword',+ 'finally': 'keyword',+ 'global': 'keyword',+ 'inherit': 'keyword',+ 'inline': 'keyword',+ 'interface': 'keyword',+ 'internal': 'keyword',+ 'lazy': 'keyword',+ 'let!': 'keyword',+ 'member' : 'keyword',+ 'module': 'keyword',+ 'namespace': 'keyword',+ 'new': 'keyword',+ 'null': 'keyword',+ 'override': 'keyword',+ 'private': 'keyword',+ 'public': 'keyword',+ 'return': 'keyword',+ 'return!': 'keyword',+ 'select': 'keyword',+ 'static': 'keyword',+ 'struct': 'keyword',+ 'upcast': 'keyword',+ 'use': 'keyword',+ 'use!': 'keyword',+ 'val': 'keyword',+ 'when': 'keyword',+ 'yield': 'keyword',+ 'yield!': 'keyword',++ 'List': 'builtin',+ 'Seq': 'builtin',+ 'Map': 'builtin',+ 'Set': 'builtin',+ 'int': 'builtin',+ 'string': 'builtin',+ 'raise': 'builtin',+ 'failwith': 'builtin',+ 'not': 'builtin',+ 'true': 'builtin',+ 'false': 'builtin'+ },+ slashComments: true+});diff --git a/data/ext/editorText/codemirror/mode/nginx/index.html b/data/ext/editorText/codemirror/mode/nginx/index.htmlnew file mode 100644index 000000000..16be1eb61--- /dev/null+++ b/data/ext/editorText/codemirror/mode/nginx/index.html@@ -0,0 +1,181 @@+<!doctype html>++<title>CodeMirror: NGINX mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="nginx.js"></script>+<style>.CodeMirror {background: #f8f8f8;}</style>+ <link rel="stylesheet" href="../../doc/docs.css">+ </head>++ <style>+ body {+ margin: 0em auto;+ }++ .CodeMirror, .CodeMirror-scroll {+ height: 600px;+ }+ </style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">NGINX</a>+ </ul>+</div>++<article>+<h2>NGINX mode</h2>+<form><textarea id="code" name="code" style="height: 800px;">+server {+ listen 173.255.219.235:80;+ server_name website.com.au;+ rewrite / $scheme://www.$host$request_uri permanent; ## Forcibly prepend a www+}++server {+ listen 173.255.219.235:443;+ server_name website.com.au;+ rewrite / $scheme://www.$host$request_uri permanent; ## Forcibly prepend a www+}++server {++ listen 173.255.219.235:80;+ server_name www.website.com.au;++++ root /data/www;+ index index.html index.php;++ location / {+ index index.html index.php; ## Allow a static html file to be shown first+ try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler+ expires 30d; ## Assume all files are cachable+ }++ ## These locations would be hidden by .htaccess normally+ location /app/ { deny all; }+ location /includes/ { deny all; }+ location /lib/ { deny all; }+ location /media/downloadable/ { deny all; }+ location /pkginfo/ { deny all; }+ location /report/config.xml { deny all; }+ location /var/ { deny all; }++ location /var/export/ { ## Allow admins only to view export folder+ auth_basic "Restricted"; ## Message shown in login window+ auth_basic_user_file /rs/passwords/testfile; ## See /etc/nginx/htpassword+ autoindex on;+ }++ location /. { ## Disable .htaccess and other hidden files+ return 404;+ }++ location @handler { ## Magento uses a common front handler+ rewrite / /index.php;+ }++ location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler+ rewrite ^/(.*.php)/ /$1 last;+ }++ location ~ \.php$ {+ if (!-e $request_filename) { rewrite / /index.php last; } ## Catch 404s that try_files miss++ fastcgi_pass 127.0.0.1:9000;+ fastcgi_index index.php;+ fastcgi_param PATH_INFO $fastcgi_script_name;+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;+ include /rs/confs/nginx/fastcgi_params;+ }++}+++server {++ listen 173.255.219.235:443;+ server_name website.com.au www.website.com.au;++ root /data/www;+ index index.html index.php;++ ssl on;+ ssl_certificate /rs/ssl/ssl.crt;+ ssl_certificate_key /rs/ssl/ssl.key;++ ssl_session_timeout 5m;++ ssl_protocols SSLv2 SSLv3 TLSv1;+ ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;+ ssl_prefer_server_ciphers on;++++ location / {+ index index.html index.php; ## Allow a static html file to be shown first+ try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler+ expires 30d; ## Assume all files are cachable+ }++ ## These locations would be hidden by .htaccess normally+ location /app/ { deny all; }+ location /includes/ { deny all; }+ location /lib/ { deny all; }+ location /media/downloadable/ { deny all; }+ location /pkginfo/ { deny all; }+ location /report/config.xml { deny all; }+ location /var/ { deny all; }++ location /var/export/ { ## Allow admins only to view export folder+ auth_basic "Restricted"; ## Message shown in login window+ auth_basic_user_file htpasswd; ## See /etc/nginx/htpassword+ autoindex on;+ }++ location /. { ## Disable .htaccess and other hidden files+ return 404;+ }++ location @handler { ## Magento uses a common front handler+ rewrite / /index.php;+ }++ location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler+ rewrite ^/(.*.php)/ /$1 last;+ }++ location ~ .php$ { ## Execute PHP scripts+ if (!-e $request_filename) { rewrite /index.php last; } ## Catch 404s that try_files miss++ fastcgi_pass 127.0.0.1:9000;+ fastcgi_index index.php;+ fastcgi_param PATH_INFO $fastcgi_script_name;+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;+ include /rs/confs/nginx/fastcgi_params;++ fastcgi_param HTTPS on;+ }++}+</textarea></form>+ <script>+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});+ </script>++ <p><strong>MIME types defined:</strong> <code>text/nginx</code>.</p>++ </article>diff --git a/data/ext/editorText/codemirror/mode/nginx/nginx.js b/data/ext/editorText/codemirror/mode/nginx/nginx.jsnew file mode 100644index 000000000..c98c8a1dd--- /dev/null+++ b/data/ext/editorText/codemirror/mode/nginx/nginx.js@@ -0,0 +1,163 @@+CodeMirror.defineMode("nginx", function(config) {++ function words(str) {+ var obj = {}, words = str.split(" ");+ for (var i = 0; i < words.length; ++i) obj[words[i]] = true;+ return obj;+ }++ var keywords = words(+ /* ngxDirectiveControl */ "break return rewrite set" ++ /* ngxDirective */ " accept_mutex accept_mutex_delay access_log add_after_body add_before_body add_header addition_types aio alias allow ancient_browser ancient_browser_value auth_basic auth_basic_user_file auth_http auth_http_header auth_http_timeout autoindex autoindex_exact_size autoindex_localtime charset charset_types client_body_buffer_size client_body_in_file_only client_body_in_single_buffer client_body_temp_path client_body_timeout client_header_buffer_size client_header_timeout client_max_body_size connection_pool_size create_full_put_path daemon dav_access dav_methods debug_connection debug_points default_type degradation degrade deny devpoll_changes devpoll_events directio directio_alignment empty_gif env epoll_events error_log eventport_events expires fastcgi_bind fastcgi_buffer_size fastcgi_buffers fastcgi_busy_buffers_size fastcgi_cache fastcgi_cache_key fastcgi_cache_methods fastcgi_cache_min_uses fastcgi_cache_path fastcgi_cache_use_stale fastcgi_cache_valid fastcgi_catch_stderr fastcgi_connect_timeout fastcgi_hide_header fastcgi_ignore_client_abort fastcgi_ignore_headers fastcgi_index fastcgi_intercept_errors fastcgi_max_temp_file_size fastcgi_next_upstream fastcgi_param fastcgi_pass_header fastcgi_pass_request_body fastcgi_pass_request_headers fastcgi_read_timeout fastcgi_send_lowat fastcgi_send_timeout fastcgi_split_path_info fastcgi_store fastcgi_store_access fastcgi_temp_file_write_size fastcgi_temp_path fastcgi_upstream_fail_timeout fastcgi_upstream_max_fails flv geoip_city geoip_country google_perftools_profiles gzip gzip_buffers gzip_comp_level gzip_disable gzip_hash gzip_http_version gzip_min_length gzip_no_buffer gzip_proxied gzip_static gzip_types gzip_vary gzip_window if_modified_since ignore_invalid_headers image_filter image_filter_buffer image_filter_jpeg_quality image_filter_transparency imap_auth imap_capabilities imap_client_buffer index ip_hash keepalive_requests keepalive_timeout kqueue_changes kqueue_events large_client_header_buffers limit_conn limit_conn_log_level limit_rate limit_rate_after limit_req limit_req_log_level limit_req_zone limit_zone lingering_time lingering_timeout lock_file log_format log_not_found log_subrequest map_hash_bucket_size map_hash_max_size master_process memcached_bind memcached_buffer_size memcached_connect_timeout memcached_next_upstream memcached_read_timeout memcached_send_timeout memcached_upstream_fail_timeout memcached_upstream_max_fails merge_slashes min_delete_depth modern_browser modern_browser_value msie_padding msie_refresh multi_accept open_file_cache open_file_cache_errors open_file_cache_events open_file_cache_min_uses open_file_cache_valid open_log_file_cache output_buffers override_charset perl perl_modules perl_require perl_set pid pop3_auth pop3_capabilities port_in_redirect postpone_gzipping postpone_output protocol proxy proxy_bind proxy_buffer proxy_buffer_size proxy_buffering proxy_buffers proxy_busy_buffers_size proxy_cache proxy_cache_key proxy_cache_methods proxy_cache_min_uses proxy_cache_path proxy_cache_use_stale proxy_cache_valid proxy_connect_timeout proxy_headers_hash_bucket_size proxy_headers_hash_max_size proxy_hide_header proxy_ignore_client_abort proxy_ignore_headers proxy_intercept_errors proxy_max_temp_file_size proxy_method proxy_next_upstream proxy_pass_error_message proxy_pass_header proxy_pass_request_body proxy_pass_request_headers proxy_read_timeout proxy_redirect proxy_send_lowat proxy_send_timeout proxy_set_body proxy_set_header proxy_ssl_session_reuse proxy_store proxy_store_access proxy_temp_file_write_size proxy_temp_path proxy_timeout proxy_upstream_fail_timeout proxy_upstream_max_fails random_index read_ahead real_ip_header recursive_error_pages request_pool_size reset_timedout_connection resolver resolver_timeout rewrite_log rtsig_overflow_events rtsig_overflow_test rtsig_overflow_threshold rtsig_signo satisfy secure_link_secret send_lowat send_timeout sendfile sendfile_max_chunk server_name_in_redirect server_names_hash_bucket_size server_names_hash_max_size server_tokens set_real_ip_from smtp_auth smtp_capabilities smtp_client_buffer smtp_greeting_delay so_keepalive source_charset ssi ssi_ignore_recycled_buffers ssi_min_file_chunk ssi_silent_errors ssi_types ssi_value_length ssl ssl_certificate ssl_certificate_key ssl_ciphers ssl_client_certificate ssl_crl ssl_dhparam ssl_engine ssl_prefer_server_ciphers ssl_protocols ssl_session_cache ssl_session_timeout ssl_verify_client ssl_verify_depth starttls stub_status sub_filter sub_filter_once sub_filter_types tcp_nodelay tcp_nopush thread_stack_size timeout timer_resolution types_hash_bucket_size types_hash_max_size underscores_in_headers uninitialized_variable_warn use user userid userid_domain userid_expires userid_mark userid_name userid_p3p userid_path userid_service valid_referers variables_hash_bucket_size variables_hash_max_size worker_connections worker_cpu_affinity worker_priority worker_processes worker_rlimit_core worker_rlimit_nofile worker_rlimit_sigpending worker_threads working_directory xclient xml_entities xslt_stylesheet xslt_typesdrew@li229-23"+ );++ var keywords_block = words(+ /* ngxDirectiveBlock */ "http mail events server types location upstream charset_map limit_except if geo map"+ );++ var keywords_important = words(+ /* ngxDirectiveImportant */ "include root server server_name listen internal proxy_pass memcached_pass fastcgi_pass try_files"+ );++ var indentUnit = config.indentUnit, type;+ function ret(style, tp) {type = tp; return style;}++ function tokenBase(stream, state) {+++ stream.eatWhile(/[\w\$_]/);++ var cur = stream.current();+++ if (keywords.propertyIsEnumerable(cur)) {+ return "keyword";+ }+ else if (keywords_block.propertyIsEnumerable(cur)) {+ return "variable-2";+ }+ else if (keywords_important.propertyIsEnumerable(cur)) {+ return "string-2";+ }+ /**/++ var ch = stream.next();+ if (ch == "@") {stream.eatWhile(/[\w\\\-]/); return ret("meta", stream.current());}+ else if (ch == "/" && stream.eat("*")) {+ state.tokenize = tokenCComment;+ return tokenCComment(stream, state);+ }+ else if (ch == "<" && stream.eat("!")) {+ state.tokenize = tokenSGMLComment;+ return tokenSGMLComment(stream, state);+ }+ else if (ch == "=") ret(null, "compare");+ else if ((ch == "~" || ch == "|") && stream.eat("=")) return ret(null, "compare");+ else if (ch == "\"" || ch == "'") {+ state.tokenize = tokenString(ch);+ return state.tokenize(stream, state);+ }+ else if (ch == "#") {+ stream.skipToEnd();+ return ret("comment", "comment");+ }+ else if (ch == "!") {+ stream.match(/^\s*\w*/);+ return ret("keyword", "important");+ }+ else if (/\d/.test(ch)) {+ stream.eatWhile(/[\w.%]/);+ return ret("number", "unit");+ }+ else if (/[,.+>*\/]/.test(ch)) {+ return ret(null, "select-op");+ }+ else if (/[;{}:\[\]]/.test(ch)) {+ return ret(null, ch);+ }+ else {+ stream.eatWhile(/[\w\\\-]/);+ return ret("variable", "variable");+ }+ }++ function tokenCComment(stream, state) {+ var maybeEnd = false, ch;+ while ((ch = stream.next()) != null) {+ if (maybeEnd && ch == "/") {+ state.tokenize = tokenBase;+ break;+ }+ maybeEnd = (ch == "*");+ }+ return ret("comment", "comment");+ }++ function tokenSGMLComment(stream, state) {+ var dashes = 0, ch;+ while ((ch = stream.next()) != null) {+ if (dashes >= 2 && ch == ">") {+ state.tokenize = tokenBase;+ break;+ }+ dashes = (ch == "-") ? dashes + 1 : 0;+ }+ return ret("comment", "comment");+ }++ function tokenString(quote) {+ return function(stream, state) {+ var escaped = false, ch;+ while ((ch = stream.next()) != null) {+ if (ch == quote && !escaped)+ break;+ escaped = !escaped && ch == "\\";+ }+ if (!escaped) state.tokenize = tokenBase;+ return ret("string", "string");+ };+ }++ return {+ startState: function(base) {+ return {tokenize: tokenBase,+ baseIndent: base || 0,+ stack: []};+ },++ token: function(stream, state) {+ if (stream.eatSpace()) return null;+ type = null;+ var style = state.tokenize(stream, state);++ var context = state.stack[state.stack.length-1];+ if (type == "hash" && context == "rule") style = "atom";+ else if (style == "variable") {+ if (context == "rule") style = "number";+ else if (!context || context == "@media{") style = "tag";+ }++ if (context == "rule" && /^[\{\};]$/.test(type))+ state.stack.pop();+ if (type == "{") {+ if (context == "@media") state.stack[state.stack.length-1] = "@media{";+ else state.stack.push("{");+ }+ else if (type == "}") state.stack.pop();+ else if (type == "@media") state.stack.push("@media");+ else if (context == "{" && type != "comment") state.stack.push("rule");+ return style;+ },++ indent: function(state, textAfter) {+ var n = state.stack.length;+ if (/^\}/.test(textAfter))+ n -= state.stack[state.stack.length-1] == "rule" ? 2 : 1;+ return state.baseIndent + n * indentUnit;+ },++ electricChars: "}"+ };+});++CodeMirror.defineMIME("text/nginx", "text/x-nginx-conf");diff --git a/data/ext/editorText/codemirror/mode/ntriples/index.html b/data/ext/editorText/codemirror/mode/ntriples/index.htmlindex 052a53d86..c8a67916d 100644--- a/data/ext/editorText/codemirror/mode/ntriples/index.html+++ b/data/ext/editorText/codemirror/mode/ntriples/index.html@@ -1,20 +1,33 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: NTriples mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="ntriples.js"></script>- <link rel="stylesheet" href="../../doc/docs.css">- <style type="text/css">++<title>CodeMirror: NTriples mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="ntriples.js"></script>+<style type="text/css">.CodeMirror {border: 1px solid #eee;}- </style>- </head>- <body>- <h1>CodeMirror: NTriples mode</h1>+ </style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">NTriples</a>+ </ul>+</div>++<article>+<h2>NTriples mode</h2><form><textarea id="ntriples" name="ntriples"><http://Sub1> <http://pred1> <http://obj> .@@ -29,5 +42,4 @@ _:bnode5 <http://pred5> "literal 3"^^<http://type> .var editor = CodeMirror.fromTextArea(document.getElementById("ntriples"), {});</script><p><strong>MIME types defined:</strong> <code>text/n-triples</code>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/octave/index.html b/data/ext/editorText/codemirror/mode/octave/index.htmlnew file mode 100644index 000000000..573ce4238--- /dev/null+++ b/data/ext/editorText/codemirror/mode/octave/index.html@@ -0,0 +1,83 @@+<!doctype html>++<title>CodeMirror: Octave mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="octave.js"></script>+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Octave</a>+ </ul>+</div>++<article>+<h2>Octave mode</h2>++ <div><textarea id="code" name="code">+%numbers+[1234 1234i 1234j]+[.234 .234j 2.23i]+[23e2 12E1j 123D-4 0x234]++%strings+'asda''a'+"asda""a"++%identifiers+a + as123 - __asd__++%operators+-+++=+==+>+<+>=+<=+&+~+...+break zeros default margin round ones rand+ceil floor size clear zeros eye mean std cov+error eval function+abs acos atan asin cos cosh exp log prod sum+log10 max min sign sin sinh sqrt tan reshape+return+case switch+else elseif end if otherwise+do for while+try catch+classdef properties events methods+global persistent++%one line comment+%{ multi+line commment %}++ </textarea></div>+ <script>+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {+ mode: {name: "octave",+ version: 2,+ singleLineStringErrors: false},+ lineNumbers: true,+ indentUnit: 4,+ matchBrackets: true+ });+ </script>++ <p><strong>MIME types defined:</strong> <code>text/x-octave</code>.</p>+</article>diff --git a/data/ext/editorText/codemirror/mode/octave/octave.js b/data/ext/editorText/codemirror/mode/octave/octave.jsnew file mode 100644index 000000000..dbf4ce1d1--- /dev/null+++ b/data/ext/editorText/codemirror/mode/octave/octave.js@@ -0,0 +1,120 @@+CodeMirror.defineMode("octave", function() {+ function wordRegexp(words) {+ return new RegExp("^((" + words.join(")|(") + "))\\b");+ }++ var singleOperators = new RegExp("^[\\+\\-\\*/&|\\^~<>!@'\\\\]");+ var singleDelimiters = new RegExp('^[\\(\\[\\{\\},:=;]');+ var doubleOperators = new RegExp("^((==)|(~=)|(<=)|(>=)|(<<)|(>>)|(\\.[\\+\\-\\*/\\^\\\\]))");+ var doubleDelimiters = new RegExp("^((!=)|(\\+=)|(\\-=)|(\\*=)|(/=)|(&=)|(\\|=)|(\\^=))");+ var tripleDelimiters = new RegExp("^((>>=)|(<<=))");+ var expressionEnd = new RegExp("^[\\]\\)]");+ var identifiers = new RegExp("^[_A-Za-z][_A-Za-z0-9]*");++ var builtins = wordRegexp([+ 'error', 'eval', 'function', 'abs', 'acos', 'atan', 'asin', 'cos',+ 'cosh', 'exp', 'log', 'prod', 'sum', 'log10', 'max', 'min', 'sign', 'sin', 'sinh',+ 'sqrt', 'tan', 'reshape', 'break', 'zeros', 'default', 'margin', 'round', 'ones',+ 'rand', 'syn', 'ceil', 'floor', 'size', 'clear', 'zeros', 'eye', 'mean', 'std', 'cov',+ 'det', 'eig', 'inv', 'norm', 'rank', 'trace', 'expm', 'logm', 'sqrtm', 'linspace', 'plot',+ 'title', 'xlabel', 'ylabel', 'legend', 'text', 'grid', 'meshgrid', 'mesh', 'num2str',+ 'fft', 'ifft', 'arrayfun', 'cellfun', 'input', 'fliplr', 'flipud', 'ismember'+ ]);++ var keywords = wordRegexp([+ 'return', 'case', 'switch', 'else', 'elseif', 'end', 'endif', 'endfunction',+ 'if', 'otherwise', 'do', 'for', 'while', 'try', 'catch', 'classdef', 'properties', 'events',+ 'methods', 'global', 'persistent', 'endfor', 'endwhile', 'printf', 'sprintf', 'disp', 'until',+ 'continue', 'pkg'+ ]);+++ // tokenizers+ function tokenTranspose(stream, state) {+ if (!stream.sol() && stream.peek() === '\'') {+ stream.next();+ state.tokenize = tokenBase;+ return 'operator';+ }+ state.tokenize = tokenBase;+ return tokenBase(stream, state);+ }+++ function tokenComment(stream, state) {+ if (stream.match(/^.*%}/)) {+ state.tokenize = tokenBase;+ return 'comment';+ };+ stream.skipToEnd();+ return 'comment';+ }++ function tokenBase(stream, state) {+ // whitespaces+ if (stream.eatSpace()) return null;++ // Handle one line Comments+ if (stream.match('%{')){+ state.tokenize = tokenComment;+ stream.skipToEnd();+ return 'comment';+ }++ if (stream.match(/^[%#]/)){+ stream.skipToEnd();+ return 'comment';+ }++ // Handle Number Literals+ if (stream.match(/^[0-9\.+-]/, false)) {+ if (stream.match(/^[+-]?0x[0-9a-fA-F]+[ij]?/)) {+ stream.tokenize = tokenBase;+ return 'number'; };+ if (stream.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?[ij]?/)) { return 'number'; };+ if (stream.match(/^[+-]?\d+([EeDd][+-]?\d+)?[ij]?/)) { return 'number'; };+ }+ if (stream.match(wordRegexp(['nan','NaN','inf','Inf']))) { return 'number'; };++ // Handle Strings+ if (stream.match(/^"([^"]|(""))*"/)) { return 'string'; } ;+ if (stream.match(/^'([^']|(''))*'/)) { return 'string'; } ;++ // Handle words+ if (stream.match(keywords)) { return 'keyword'; } ;+ if (stream.match(builtins)) { return 'builtin'; } ;+ if (stream.match(identifiers)) { return 'variable'; } ;++ if (stream.match(singleOperators) || stream.match(doubleOperators)) { return 'operator'; };+ if (stream.match(singleDelimiters) || stream.match(doubleDelimiters) || stream.match(tripleDelimiters)) { return null; };++ if (stream.match(expressionEnd)) {+ state.tokenize = tokenTranspose;+ return null;+ };+++ // Handle non-detected items+ stream.next();+ return 'error';+ };+++ return {+ startState: function() {+ return {+ tokenize: tokenBase+ };+ },++ token: function(stream, state) {+ var style = state.tokenize(stream, state);+ if (style === 'number' || style === 'variable'){+ state.tokenize = tokenTranspose;+ }+ return style;+ }+ };+});++CodeMirror.defineMIME("text/x-octave", "octave");diff --git a/data/ext/editorText/codemirror/mode/pascal/LICENSE b/data/ext/editorText/codemirror/mode/pascal/LICENSEdeleted file mode 100644index 8e3747e74..000000000--- a/data/ext/editorText/codemirror/mode/pascal/LICENSE+++ /dev/null@@ -1,7 +0,0 @@-Copyright (c) 2011 souceLair <[email protected]>--Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:--The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.--THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.diff --git a/data/ext/editorText/codemirror/mode/pascal/index.html b/data/ext/editorText/codemirror/mode/pascal/index.htmlindex b3016afb1..bf8ff0d63 100644--- a/data/ext/editorText/codemirror/mode/pascal/index.html+++ b/data/ext/editorText/codemirror/mode/pascal/index.html@@ -1,16 +1,30 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Pascal mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="pascal.js"></script>- <link rel="stylesheet" href="../../doc/docs.css">- <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>- </head>- <body>- <h1>CodeMirror: Pascal mode</h1>++<title>CodeMirror: Pascal mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="pascal.js"></script>+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Pascal</a>+ </ul>+</div>++<article>+<h2>Pascal mode</h2>+<div><textarea id="code" name="code">(* Example Pascal code *)@@ -44,5 +58,4 @@ end;</script><p><strong>MIME types defined:</strong> <code>text/x-pascal</code>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/pegjs/index.html b/data/ext/editorText/codemirror/mode/pegjs/index.htmlnew file mode 100644index 000000000..678b714d8--- /dev/null+++ b/data/ext/editorText/codemirror/mode/pegjs/index.html@@ -0,0 +1,66 @@+<!doctype html>+<html>+ <head>+ <title>CodeMirror: PEG.js Mode</title>+ <meta charset="utf-8"/>+ <link rel=stylesheet href="../../doc/docs.css">++ <link rel="stylesheet" href="../../lib/codemirror.css">+ <script src="../../lib/codemirror.js"></script>+ <script src="../javascript/javascript.js"></script>+ <script src="pegjs.js"></script>+ <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+ </head>+ <body>+ <div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">PEG.js Mode</a>+ </ul>+ </div>++ <article>+ <h2>PEG.js Mode</h2>+ <form><textarea id="code" name="code">+/*+ * Classic example grammar, which recognizes simple arithmetic expressions like+ * "2*(3+4)". The parser generated from this grammar then computes their value.+ */++start+ = additive++additive+ = left:multiplicative "+" right:additive { return left + right; }+ / multiplicative++multiplicative+ = left:primary "*" right:multiplicative { return left * right; }+ / primary++primary+ = integer+ / "(" additive:additive ")" { return additive; }++integer "integer"+ = digits:[0-9]+ { return parseInt(digits.join(""), 10); }++letter = [a-z]+</textarea></form>+ <script>+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {+ mode: {name: "pegjs"},+ lineNumbers: true+ });+ </script>+ <h3>The PEG.js Mode</h3>+ <p> Created by Forbes Lindesay.</p>+ </article>+ </body>+</html>diff --git a/data/ext/editorText/codemirror/mode/pegjs/pegjs.js b/data/ext/editorText/codemirror/mode/pegjs/pegjs.jsnew file mode 100644index 000000000..6b2e27379--- /dev/null+++ b/data/ext/editorText/codemirror/mode/pegjs/pegjs.js@@ -0,0 +1,99 @@+CodeMirror.defineMode("pegjs", function (config) {+ var jsMode = CodeMirror.getMode(config, "javascript");++ function identifier(stream) {+ return stream.match(/^[a-zA-Z_][a-zA-Z0-9_]*/);+ }++ return {+ startState: function () {+ return {+ inString: false,+ stringType: null,+ inComment: false,+ inChracterClass: false,+ braced: 0,+ lhs: true,+ localState: null+ };+ },+ token: function (stream, state) {+ if (stream)++ //check for state changes+ if (!state.inString && !state.inComment && ((stream.peek() == '"') || (stream.peek() == "'"))) {+ state.stringType = stream.peek();+ stream.next(); // Skip quote+ state.inString = true; // Update state+ }+ if (!state.inString && !state.inComment && stream.match(/^\/\*/)) {+ state.inComment = true;+ }++ //return state+ if (state.inString) {+ while (state.inString && !stream.eol()) {+ if (stream.peek() === state.stringType) {+ stream.next(); // Skip quote+ state.inString = false; // Clear flag+ } else if (stream.peek() === '\\') {+ stream.next();+ stream.next();+ } else {+ stream.match(/^.[^\\\"\']*/);+ }+ }+ return state.lhs ? "property string" : "string"; // Token style+ } else if (state.inComment) {+ while (state.inComment && !stream.eol()) {+ if (stream.match(/\*\//)) {+ state.inComment = false; // Clear flag+ } else {+ stream.match(/^.[^\*]*/);+ }+ }+ return "comment";+ } else if (state.inChracterClass) {+ while (state.inChracterClass && !stream.eol()) {+ if (!(stream.match(/^[^\]\\]+/) || stream.match(/^\\./))) {+ state.inChracterClass = false;+ }+ }+ } else if (stream.peek() === '[') {+ stream.next();+ state.inChracterClass = true;+ return 'bracket';+ } else if (stream.match(/^\/\//)) {+ stream.skipToEnd();+ return "comment";+ } else if (state.braced || stream.peek() === '{') {+ if (state.localState === null) {+ state.localState = jsMode.startState();+ }+ var token = jsMode.token(stream, state.localState);+ var text = stream.current();+ if (!token) {+ for (var i = 0; i < text.length; i++) {+ if (text[i] === '{') {+ state.braced++;+ } else if (text[i] === '}') {+ state.braced--;+ }+ };+ }+ return token;+ } else if (identifier(stream)) {+ if (stream.peek() === ':') {+ return 'variable';+ }+ return 'variable-2';+ } else if (['[', ']', '(', ')'].indexOf(stream.peek()) != -1) {+ stream.next();+ return 'bracket';+ } else if (!stream.eatSpace()) {+ stream.next();+ }+ return null;+ }+ };+}, "javascript");diff --git a/data/ext/editorText/codemirror/mode/perl/LICENSE b/data/ext/editorText/codemirror/mode/perl/LICENSEdeleted file mode 100644index 96f4115af..000000000--- a/data/ext/editorText/codemirror/mode/perl/LICENSE+++ /dev/null@@ -1,19 +0,0 @@-Copyright (C) 2011 by Sabaca <[email protected]> under the MIT license.--Permission is hereby granted, free of charge, to any person obtaining a copy-of this software and associated documentation files (the "Software"), to deal-in the Software without restriction, including without limitation the rights-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell-copies of the Software, and to permit persons to whom the Software is-furnished to do so, subject to the following conditions:--The above copyright notice and this permission notice shall be included in-all copies or substantial portions of the Software.--THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN-THE SOFTWARE.diff --git a/data/ext/editorText/codemirror/mode/perl/index.html b/data/ext/editorText/codemirror/mode/perl/index.htmlindex 13c7af64d..2b7578efe 100644--- a/data/ext/editorText/codemirror/mode/perl/index.html+++ b/data/ext/editorText/codemirror/mode/perl/index.html@@ -1,16 +1,30 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Perl mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="perl.js"></script>- <link rel="stylesheet" href="../../doc/docs.css">- <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>- </head>- <body>- <h1>CodeMirror: Perl mode</h1>++<title>CodeMirror: Perl mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="perl.js"></script>+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Perl</a>+ </ul>+</div>++<article>+<h2>Perl mode</h2>+<div><textarea id="code" name="code">#!/usr/bin/perl@@ -58,5 +72,4 @@ something...</script><p><strong>MIME types defined:</strong> <code>text/x-perl</code>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/php/index.html b/data/ext/editorText/codemirror/mode/php/index.htmlindex 3d4c336ce..1fb7435bb 100644--- a/data/ext/editorText/codemirror/mode/php/index.html+++ b/data/ext/editorText/codemirror/mode/php/index.html@@ -1,23 +1,35 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: PHP mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="../../addon/edit/matchbrackets.js"></script>- <script src="../htmlmixed/htmlmixed.js"></script>- <script src="../xml/xml.js"></script>- <script src="../javascript/javascript.js"></script>- <script src="../css/css.js"></script>- <script src="../clike/clike.js"></script>- <script src="php.js"></script>- <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>- <link rel="stylesheet" href="../../doc/docs.css">- </head>- <body>- <h1>CodeMirror: PHP mode</h1>+<title>CodeMirror: PHP mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="../../addon/edit/matchbrackets.js"></script>+<script src="../htmlmixed/htmlmixed.js"></script>+<script src="../xml/xml.js"></script>+<script src="../javascript/javascript.js"></script>+<script src="../css/css.js"></script>+<script src="../clike/clike.js"></script>+<script src="php.js"></script>+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">PHP</a>+ </ul>+</div>++<article>+<h2>PHP mode</h2><form><textarea id="code" name="code"><?phpfunction hello($who) {@@ -36,9 +48,7 @@ function hello($who) {matchBrackets: true,mode: "application/x-httpd-php",indentUnit: 4,- indentWithTabs: true,- enterMode: "keep",- tabMode: "shift"+ indentWithTabs: true});</script>@@ -47,5 +57,4 @@ function hello($who) {JavaScript, CSS, HTMLMixed, and C-like modes.</p><p><strong>MIME types defined:</strong> <code>application/x-httpd-php</code> (HTML with PHP code), <code>text/x-php</code> (plain, non-wrapped PHP code).</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/php/php.js b/data/ext/editorText/codemirror/mode/php/php.jsindex fa0db5b1f..946f770c9 100644--- a/data/ext/editorText/codemirror/mode/php/php.js+++ b/data/ext/editorText/codemirror/mode/php/php.js@@ -18,10 +18,10 @@"for foreach function global goto if implements interface instanceof namespace " +"new or private protected public static switch throw trait try use var while xor " +"die echo empty exit eval include include_once isset list require require_once return " +- "print unset __halt_compiler self static parent"),- blockKeywords: keywords("catch do else elseif for foreach if switch try while"),- atoms: keywords("true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__"),- builtin: keywords("func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport echo print global static exit array empty eval isset unset die include require include_once require_once"),+ "print unset __halt_compiler self static parent yield insteadof finally"),+ blockKeywords: keywords("catch do else elseif for foreach if switch try while finally"),+ atoms: keywords("true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__"),+ builtin: keywords("func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once"),multiLineStrings: true,hooks: {"$": function(stream) {@@ -56,15 +56,15 @@function dispatch(stream, state) {var isPHP = state.curMode == phpMode;- if (stream.sol() && state.pending != '"') state.pending = null;+ if (stream.sol() && state.pending && state.pending != '"' && state.pending != "'") state.pending = null;if (!isPHP) {if (stream.match(/^<\?\w*/)) {state.curMode = phpMode;state.curState = state.php;return "meta";}- if (state.pending == '"') {- while (!stream.eol() && stream.next() != '"') {}+ if (state.pending == '"' || state.pending == "'") {+ while (!stream.eol() && stream.next() != state.pending) {}var style = "string";} else if (state.pending && stream.pos < state.pending.end) {stream.pos = state.pending.end;@@ -72,10 +72,10 @@} else {var style = htmlMode.token(stream, state.curState);}- state.pending = null;- var cur = stream.current(), openPHP = cur.search(/<\?/);+ if (state.pending) state.pending = null;+ var cur = stream.current(), openPHP = cur.search(/<\?/), m;if (openPHP != -1) {- if (style == "string" && /\"$/.test(cur) && !/\?>/.test(cur)) state.pending = '"';+ if (style == "string" && (m = cur.match(/[\'\"]$/)) && !/\?>/.test(cur)) state.pending = m[0];else state.pending = {end: stream.pos, style: style};stream.backUp(cur.length - openPHP);}@@ -117,7 +117,6 @@return state.curMode.indent(state.curState, textAfter);},- electricChars: "/{}:",blockCommentStart: "/*",blockCommentEnd: "*/",lineComment: "//",diff --git a/data/ext/editorText/codemirror/mode/pig/index.html b/data/ext/editorText/codemirror/mode/pig/index.htmlindex 1b0c60267..93744ae2d 100644--- a/data/ext/editorText/codemirror/mode/pig/index.html+++ b/data/ext/editorText/codemirror/mode/pig/index.html@@ -1,17 +1,29 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Pig Latin mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="pig.js"></script>- <link rel="stylesheet" href="../../doc/docs.css">- <style>.CodeMirror {border: 2px inset #dee;}</style>- </head>- <body>- <h1>CodeMirror: Pig Latin mode</h1>+<title>CodeMirror: Pig Latin mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="pig.js"></script>+<style>.CodeMirror {border: 2px inset #dee;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Pig Latin</a>+ </ul>+</div>++<article>+<h2>Pig Latin mode</h2><form><textarea id="code" name="code">-- Apache Pig (Pig Latin Language) Demo/*@@ -40,3 +52,4 @@ STORE c INTO "\path\to\output";<p><strong>MIME type defined:</strong> <code>text/x-pig</code>(PIG code)</html>+</article>diff --git a/data/ext/editorText/codemirror/mode/pig/pig.js b/data/ext/editorText/codemirror/mode/pig/pig.jsindex c2f611a1a..4b44e7ccc 100644--- a/data/ext/editorText/codemirror/mode/pig/pig.js+++ b/data/ext/editorText/codemirror/mode/pig/pig.js@@ -157,7 +157,7 @@ CodeMirror.defineMode("pig", function(_config, parserConfig) {+ "JOIN CROSS UNION SPLIT INTO IF OTHERWISE ALL AS BY USING INNER OUTER ONSCHEMA PARALLEL "+ "PARTITION GROUP AND OR NOT GENERATE FLATTEN ASC DESC IS STREAM THROUGH STORE MAPREDUCE "+ "SHIP CACHE INPUT OUTPUT STDERROR STDIN STDOUT LIMIT SAMPLE LEFT RIGHT FULL EQ GT LT GTE LTE "- + "NEQ MATCHES TRUE FALSE ";+ + "NEQ MATCHES TRUE FALSE DUMP";// data typesvar pTypes = "BOOLEAN INT LONG FLOAT DOUBLE CHARARRAY BYTEARRAY BAG TUPLE MAP ";diff --git a/data/ext/editorText/codemirror/mode/properties/index.html b/data/ext/editorText/codemirror/mode/properties/index.htmlindex e21e02abd..40ee1a37b 100644--- a/data/ext/editorText/codemirror/mode/properties/index.html+++ b/data/ext/editorText/codemirror/mode/properties/index.html@@ -1,17 +1,30 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Properties files mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="properties.js"></script>- <style>.CodeMirror {border-top: 1px solid #ddd; border-bottom: 1px solid #ddd;}</style>- <link rel="stylesheet" href="../../doc/docs.css">- </head>- <body>- <h1>CodeMirror: Properties files mode</h1>- <form><textarea id="code" name="code">++<title>CodeMirror: Properties files mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="properties.js"></script>+<style>.CodeMirror {border-top: 1px solid #ddd; border-bottom: 1px solid #ddd;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Properties files</a>+ </ul>+</div>++<article>+<h2>Properties files mode</h2>+<form><textarea id="code" name="code"># This is a properties filea.key = A valueanother.key = http://example.com@@ -37,5 +50,4 @@ spaces\ in\ keys=Not very common...<p><strong>MIME types defined:</strong> <code>text/x-properties</code>,<code>text/x-ini</code>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/puppet/index.html b/data/ext/editorText/codemirror/mode/puppet/index.htmlnew file mode 100644index 000000000..f307636b2--- /dev/null+++ b/data/ext/editorText/codemirror/mode/puppet/index.html@@ -0,0 +1,121 @@+<!doctype html>++<title>CodeMirror: Puppet mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="../../addon/edit/matchbrackets.js"></script>+<script src="puppet.js"></script>+<style>+ .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}+ .cm-s-default span.cm-arrow { color: red; }+ </style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Puppet</a>+ </ul>+</div>++<article>+<h2>Puppet mode</h2>+<form><textarea id="code" name="code">+# == Class: automysqlbackup+#+# Puppet module to install AutoMySQLBackup for periodic MySQL backups.+#+# class { 'automysqlbackup':+# backup_dir => '/mnt/backups',+# }+#++class automysqlbackup (+ $bin_dir = $automysqlbackup::params::bin_dir,+ $etc_dir = $automysqlbackup::params::etc_dir,+ $backup_dir = $automysqlbackup::params::backup_dir,+ $install_multicore = undef,+ $config = {},+ $config_defaults = {},+) inherits automysqlbackup::params {++# Ensure valid paths are assigned+ validate_absolute_path($bin_dir)+ validate_absolute_path($etc_dir)+ validate_absolute_path($backup_dir)++# Create a subdirectory in /etc for config files+ file { $etc_dir:+ ensure => directory,+ owner => 'root',+ group => 'root',+ mode => '0750',+ }++# Create an example backup file, useful for reference+ file { "${etc_dir}/automysqlbackup.conf.example":+ ensure => file,+ owner => 'root',+ group => 'root',+ mode => '0660',+ source => 'puppet:///modules/automysqlbackup/automysqlbackup.conf',+ }++# Add files from the developer+ file { "${etc_dir}/AMB_README":+ ensure => file,+ source => 'puppet:///modules/automysqlbackup/AMB_README',+ }+ file { "${etc_dir}/AMB_LICENSE":+ ensure => file,+ source => 'puppet:///modules/automysqlbackup/AMB_LICENSE',+ }++# Install the actual binary file+ file { "${bin_dir}/automysqlbackup":+ ensure => file,+ owner => 'root',+ group => 'root',+ mode => '0755',+ source => 'puppet:///modules/automysqlbackup/automysqlbackup',+ }++# Create the base backup directory+ file { $backup_dir:+ ensure => directory,+ owner => 'root',+ group => 'root',+ mode => '0755',+ }++# If you'd like to keep your config in hiera and pass it to this class+ if !empty($config) {+ create_resources('automysqlbackup::backup', $config, $config_defaults)+ }++# If using RedHat family, must have the RPMforge repo's enabled+ if $install_multicore {+ package { ['pigz', 'pbzip2']: ensure => installed }+ }++}+</textarea></form>+ <script>+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {+ mode: "text/x-puppet",+ matchBrackets: true,+ indentUnit: 4+ });+ </script>++ <p><strong>MIME types defined:</strong> <code>text/x-puppet</code>.</p>++ </article>diff --git a/data/ext/editorText/codemirror/mode/puppet/puppet.js b/data/ext/editorText/codemirror/mode/puppet/puppet.jsnew file mode 100644index 000000000..0153c8012--- /dev/null+++ b/data/ext/editorText/codemirror/mode/puppet/puppet.js@@ -0,0 +1,204 @@+CodeMirror.defineMode("puppet", function () {+ // Stores the words from the define method+ var words = {};+ // Taken, mostly, from the Puppet official variable standards regex+ var variable_regex = /({)?([a-z][a-z0-9_]*)?((::[a-z][a-z0-9_]*)*::)?[a-zA-Z0-9_]+(})?/;++ // Takes a string of words separated by spaces and adds them as+ // keys with the value of the first argument 'style'+ function define(style, string) {+ var split = string.split(' ');+ for (var i = 0; i < split.length; i++) {+ words[split[i]] = style;+ }+ }++ // Takes commonly known puppet types/words and classifies them to a style+ define('keyword', 'class define site node include import inherits');+ define('keyword', 'case if else in and elsif default or');+ define('atom', 'false true running present absent file directory undef');+ define('builtin', 'action augeas burst chain computer cron destination dport exec ' ++ 'file filebucket group host icmp iniface interface jump k5login limit log_level ' ++ 'log_prefix macauthorization mailalias maillist mcx mount nagios_command ' ++ 'nagios_contact nagios_contactgroup nagios_host nagios_hostdependency ' ++ 'nagios_hostescalation nagios_hostextinfo nagios_hostgroup nagios_service ' ++ 'nagios_servicedependency nagios_serviceescalation nagios_serviceextinfo ' ++ 'nagios_servicegroup nagios_timeperiod name notify outiface package proto reject ' ++ 'resources router schedule scheduled_task selboolean selmodule service source ' ++ 'sport ssh_authorized_key sshkey stage state table tidy todest toports tosource ' ++ 'user vlan yumrepo zfs zone zpool');++ // After finding a start of a string ('|") this function attempts to find the end;+ // If a variable is encountered along the way, we display it differently when it+ // is encapsulated in a double-quoted string.+ function tokenString(stream, state) {+ var current, prev, found_var = false;+ while (!stream.eol() && (current = stream.next()) != state.pending) {+ if (current === '$' && prev != '\\' && state.pending == '"') {+ found_var = true;+ break;+ }+ prev = current;+ }+ if (found_var) {+ stream.backUp(1);+ }+ if (current == state.pending) {+ state.continueString = false;+ } else {+ state.continueString = true;+ }+ return "string";+ }++ // Main function+ function tokenize(stream, state) {+ // Matches one whole word+ var word = stream.match(/[\w]+/, false);+ // Matches attributes (i.e. ensure => present ; 'ensure' would be matched)+ var attribute = stream.match(/(\s+)?\w+\s+=>.*/, false);+ // Matches non-builtin resource declarations+ // (i.e. "apache::vhost {" or "mycustomclasss {" would be matched)+ var resource = stream.match(/(\s+)?[\w:_]+(\s+)?{/, false);+ // Matches virtual and exported resources (i.e. @@user { ; and the like)+ var special_resource = stream.match(/(\s+)?[@]{1,2}[\w:_]+(\s+)?{/, false);++ // Finally advance the stream+ var ch = stream.next();++ // Have we found a variable?+ if (ch === '$') {+ if (stream.match(variable_regex)) {+ // If so, and its in a string, assign it a different color+ return state.continueString ? 'variable-2' : 'variable';+ }+ // Otherwise return an invalid variable+ return "error";+ }+ // Should we still be looking for the end of a string?+ if (state.continueString) {+ // If so, go through the loop again+ stream.backUp(1);+ return tokenString(stream, state);+ }+ // Are we in a definition (class, node, define)?+ if (state.inDefinition) {+ // If so, return def (i.e. for 'class myclass {' ; 'myclass' would be matched)+ if (stream.match(/(\s+)?[\w:_]+(\s+)?/)) {+ return 'def';+ }+ // Match the rest it the next time around+ stream.match(/\s+{/);+ state.inDefinition = false;+ }+ // Are we in an 'include' statement?+ if (state.inInclude) {+ // Match and return the included class+ stream.match(/(\s+)?\S+(\s+)?/);+ state.inInclude = false;+ return 'def';+ }+ // Do we just have a function on our hands?+ // In 'ensure_resource("myclass")', 'ensure_resource' is matched+ if (stream.match(/(\s+)?\w+\(/)) {+ stream.backUp(1);+ return 'def';+ }+ // Have we matched the prior attribute regex?+ if (attribute) {+ stream.match(/(\s+)?\w+/);+ return 'tag';+ }+ // Do we have Puppet specific words?+ if (word && words.hasOwnProperty(word)) {+ // Negates the initial next()+ stream.backUp(1);+ // Acutally move the stream+ stream.match(/[\w]+/);+ // We want to process these words differently+ // do to the importance they have in Puppet+ if (stream.match(/\s+\S+\s+{/, false)) {+ state.inDefinition = true;+ }+ if (word == 'include') {+ state.inInclude = true;+ }+ // Returns their value as state in the prior define methods+ return words[word];+ }+ // Is there a match on a reference?+ if (/(\s+)?[A-Z]/.test(word)) {+ // Negate the next()+ stream.backUp(1);+ // Match the full reference+ stream.match(/(\s+)?[A-Z][\w:_]+/);+ return 'def';+ }+ // Have we matched the prior resource regex?+ if (resource) {+ stream.match(/(\s+)?[\w:_]+/);+ return 'def';+ }+ // Have we matched the prior special_resource regex?+ if (special_resource) {+ stream.match(/(\s+)?[@]{1,2}/);+ return 'special';+ }+ // Match all the comments. All of them.+ if (ch == "#") {+ stream.skipToEnd();+ return "comment";+ }+ // Have we found a string?+ if (ch == "'" || ch == '"') {+ // Store the type (single or double)+ state.pending = ch;+ // Perform the looping function to find the end+ return tokenString(stream, state);+ }+ // Match all the brackets+ if (ch == '{' || ch == '}') {+ return 'bracket';+ }+ // Match characters that we are going to assume+ // are trying to be regex+ if (ch == '/') {+ stream.match(/.*\//);+ return 'variable-3';+ }+ // Match all the numbers+ if (ch.match(/[0-9]/)) {+ stream.eatWhile(/[0-9]+/);+ return 'number';+ }+ // Match the '=' and '=>' operators+ if (ch == '=') {+ if (stream.peek() == '>') {+ stream.next();+ }+ return "operator";+ }+ // Keep advancing through all the rest+ stream.eatWhile(/[\w-]/);+ // Return a blank line for everything else+ return null;+ }+ // Start it all+ return {+ startState: function () {+ var state = {};+ state.inDefinition = false;+ state.inInclude = false;+ state.continueString = false;+ state.pending = false;+ return state;+ },+ token: function (stream, state) {+ // Strip the spaces, but regex will account for them eitherway+ if (stream.eatSpace()) return null;+ // Go through the main process+ return tokenize(stream, state);+ }+ };+});+CodeMirror.defineMIME("text/x-puppet", "puppet");diff --git a/data/ext/editorText/codemirror/mode/python/LICENSE.txt b/data/ext/editorText/codemirror/mode/python/LICENSE.txtdeleted file mode 100644index 918866b42..000000000--- a/data/ext/editorText/codemirror/mode/python/LICENSE.txt+++ /dev/null@@ -1,21 +0,0 @@-The MIT License--Copyright (c) 2010 Timothy Farrell--Permission is hereby granted, free of charge, to any person obtaining a copy-of this software and associated documentation files (the "Software"), to deal-in the Software without restriction, including without limitation the rights-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell-copies of the Software, and to permit persons to whom the Software is-furnished to do so, subject to the following conditions:--The above copyright notice and this permission notice shall be included in-all copies or substantial portions of the Software.--THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN-THE SOFTWARE.\ No newline at end of filediff --git a/data/ext/editorText/codemirror/mode/python/index.html b/data/ext/editorText/codemirror/mode/python/index.htmlindex 4244c6fc5..a1d6d2d83 100644--- a/data/ext/editorText/codemirror/mode/python/index.html+++ b/data/ext/editorText/codemirror/mode/python/index.html@@ -1,18 +1,31 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Python mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="../../addon/edit/matchbrackets.js"></script>- <script src="python.js"></script>- <link rel="stylesheet" href="../../doc/docs.css">- <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>- </head>- <body>- <h1>CodeMirror: Python mode</h1>-++<title>CodeMirror: Python mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="../../addon/edit/matchbrackets.js"></script>+<script src="python.js"></script>+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Python</a>+ </ul>+</div>++<article>+<h2>Python mode</h2>+<div><textarea id="code" name="code"># Literals1234@@ -102,6 +115,34 @@ class ExampleClass(ParentClass):self.mixin = mixin</textarea></div>+++<h2>Cython mode</h2>++<div><textarea id="code-cython" name="code-cython">++import numpy as np+cimport cython+from libc.math cimport sqrt+[email protected](False)[email protected](False)+def pairwise_cython(double[:, ::1] X):+ cdef int M = X.shape[0]+ cdef int N = X.shape[1]+ cdef double tmp, d+ cdef double[:, ::1] D = np.empty((M, M), dtype=np.float64)+ for i in range(M):+ for j in range(M):+ d = 0.0+ for k in range(N):+ tmp = X[i, k] - X[j, k]+ d += tmp * tmp+ D[i, j] = sqrt(d)+ return np.asarray(D)++</textarea></div>+<script>var editor = CodeMirror.fromTextArea(document.getElementById("code"), {mode: {name: "python",@@ -109,14 +150,23 @@ class ExampleClass(ParentClass):singleLineStringErrors: false},lineNumbers: true,indentUnit: 4,- tabMode: "shift",+ matchBrackets: true+ });++ CodeMirror.fromTextArea(document.getElementById("code-cython"), {+ mode: {name: "text/x-cython",+ version: 2,+ singleLineStringErrors: false},+ lineNumbers: true,+ indentUnit: 4,matchBrackets: true});</script>- <h2>Configuration Options:</h2>+ <h2>Configuration Options for Python mode:</h2><ul><li>version - 2/3 - The version of Python to recognize. Default is 2.</li><li>singleLineStringErrors - true/false - If you have a single-line string that is not terminated at the end of the line, this will show subsequent lines as errors if true, otherwise it will consider the newline as the end of the string. Default is false.</li>+ <li>hangingIndent - int - If you want to write long arguments to a function starting on a new line, how much that line should be indented. Defaults to one normal indentation unit.</li></ul><h2>Advanced Configuration Options:</h2><p>Usefull for superset of python syntax like Enthought enaml, IPython magics and questionmark help</p>@@ -127,9 +177,10 @@ class ExampleClass(ParentClass):<li>doubleDelimiters - RegEx - Regular Expressoin for double delimiters matching, default : <pre>^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))</pre></li><li>tripleDelimiters - RegEx - Regular Expression for triple delimiters matching, default : <pre>^((//=)|(>>=)|(<<=)|(\\*\\*=))</pre></li><li>identifiers - RegEx - Regular Expression for identifier, default : <pre>^[_A-Za-z][_A-Za-z0-9]*</pre></li>+ <li>extra_keywords - list of string - List of extra words ton consider as keywords</li>+ <li>extra_builtins - list of string - List of extra words ton consider as builtins</li></ul>- <p><strong>MIME types defined:</strong> <code>text/x-python</code>.</p>- </body>-</html>+ <p><strong>MIME types defined:</strong> <code>text/x-python</code> and <code>text/x-cython</code>.</p>+ </article>diff --git a/data/ext/editorText/codemirror/mode/python/python.js b/data/ext/editorText/codemirror/mode/python/python.jsindex b623972b8..2a7445209 100644--- a/data/ext/editorText/codemirror/mode/python/python.js+++ b/data/ext/editorText/codemirror/mode/python/python.js@@ -11,6 +11,7 @@ CodeMirror.defineMode("python", function(conf, parserConf) {var doubleDelimiters = parserConf.doubleDelimiters || new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))");var tripleDelimiters = parserConf.tripleDelimiters || new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))");var identifiers = parserConf.identifiers|| new RegExp("^[_A-Za-z][_A-Za-z0-9]*");+ var hangingIndent = parserConf.hangingIndent || parserConf.indentUnit;var wordOperators = wordRegexp(['and', 'or', 'not', 'is', 'in']);var commonkeywords = ['as', 'assert', 'break', 'class', 'continue',@@ -36,6 +37,12 @@ CodeMirror.defineMode("python", function(conf, parserConf) {var py3 = {'builtins': ['ascii', 'bytes', 'exec', 'print'],'keywords': ['nonlocal', 'False', 'True', 'None']};+ if(parserConf.extra_keywords != undefined){+ commonkeywords = commonkeywords.concat(parserConf.extra_keywords);+ }+ if(parserConf.extra_builtins != undefined){+ commonBuiltins = commonBuiltins.concat(parserConf.extra_builtins);+ }if (!!parserConf.version && parseInt(parserConf.version, 10) === 3) {commonkeywords = commonkeywords.concat(py3.keywords);commonBuiltins = commonBuiltins.concat(py3.builtins);@@ -144,7 +151,14 @@ CodeMirror.defineMode("python", function(conf, parserConf) {return 'builtin';}+ if (stream.match(/^(self|cls)\b/)) {+ return "variable-2";+ }+if (stream.match(identifiers)) {+ if (state.lastToken == 'def' || state.lastToken == 'class') {+ return 'def';+ }return 'variable';}@@ -202,6 +216,11 @@ CodeMirror.defineMode("python", function(conf, parserConf) {break;}}+ } else if (stream.match(/\s*($|#)/, false)) {+ // An open paren/bracket/brace with only space or comments after it+ // on the line will indent the next line a fixed amount, to make it+ // easier to put arguments, list items, etc. on their own lines.+ indentUnit = stream.indentation() + hangingIndent;} else {indentUnit = stream.column() + stream.current().length;}@@ -252,7 +271,7 @@ CodeMirror.defineMode("python", function(conf, parserConf) {// Handle '.' connected identifiersif (current === '.') {style = stream.match(identifiers, false) ? null : ERRORCLASS;- if (style === null && state.lastToken === 'meta') {+ if (style === null && state.lastStyle === 'meta') {// Apply 'meta' style to '.' connected identifiers when// appropriate.style = 'meta';@@ -266,7 +285,7 @@ CodeMirror.defineMode("python", function(conf, parserConf) {}if ((style === 'variable' || style === 'builtin')- && state.lastToken === 'meta') {+ && state.lastStyle === 'meta') {style = 'meta';}@@ -307,6 +326,7 @@ CodeMirror.defineMode("python", function(conf, parserConf) {return {tokenize: tokenBase,scopes: [{offset:basecolumn || 0, type:'py'}],+ lastStyle: null,lastToken: null,lambda: false,dedent: 0@@ -316,12 +336,16 @@ CodeMirror.defineMode("python", function(conf, parserConf) {token: function(stream, state) {var style = tokenLexer(stream, state);- state.lastToken = style;+ state.lastStyle = style;- if (stream.eol() && stream.lambda) {- state.lambda = false;+ var current = stream.current();+ if (current && style) {+ state.lastToken = current;}+ if (stream.eol() && state.lambda) {+ state.lambda = false;+ }return style;},@@ -333,9 +357,22 @@ CodeMirror.defineMode("python", function(conf, parserConf) {return state.scopes[0].offset;},- lineComment: "#"+ lineComment: "#",+ fold: "indent"};return external;});CodeMirror.defineMIME("text/x-python", "python");++(function() {+ "use strict";+ var words = function(str){return str.split(' ');};++ CodeMirror.defineMIME("text/x-cython", {+ name: "python",+ extra_keywords: words("by cdef cimport cpdef ctypedef enum except"++ "extern gil include nogil property public"++ "readonly struct union DEF IF ELIF ELSE")+ });+})();diff --git a/data/ext/editorText/codemirror/mode/q/index.html b/data/ext/editorText/codemirror/mode/q/index.htmlindex 303ec1d3a..78ed3d88f 100644--- a/data/ext/editorText/codemirror/mode/q/index.html+++ b/data/ext/editorText/codemirror/mode/q/index.html@@ -1,17 +1,31 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Q mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="../../addon/edit/matchbrackets.js"></script>- <script src="q.js"></script>- <link rel="stylesheet" href="../../doc/docs.css">- <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>- </head>- <body>- <h1>CodeMirror: Q mode</h1>++<title>CodeMirror: Q mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="../../addon/edit/matchbrackets.js"></script>+<script src="q.js"></script>+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Q</a>+ </ul>+</div>++<article>+<h2>Q mode</h2>+<div><textarea id="code" name="code">/ utilities to quickly load a csv file - for more exhaustive analysis of the csv contents see csvguess.q@@ -127,5 +141,4 @@ bulkload:{[file;info]</script><p><strong>MIME type defined:</strong> <code>text/x-q</code>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/r/LICENSE b/data/ext/editorText/codemirror/mode/r/LICENSEdeleted file mode 100644index 2510ae16c..000000000--- a/data/ext/editorText/codemirror/mode/r/LICENSE+++ /dev/null@@ -1,24 +0,0 @@-Copyright (c) 2011, Ubalo, Inc.-All rights reserved.--Redistribution and use in source and binary forms, with or without-modification, are permitted provided that the following conditions are met:- * Redistributions of source code must retain the above copyright- notice, this list of conditions and the following disclaimer.- * Redistributions in binary form must reproduce the above copyright- notice, this list of conditions and the following disclaimer in the- documentation and/or other materials provided with the distribution.- * Neither the name of the Ubalo, Inc nor the names of its- contributors may be used to endorse or promote products derived- from this software without specific prior written permission.--THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE-DISCLAIMED. IN NO EVENT SHALL UBALO, INC BE LIABLE FOR ANY-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.diff --git a/data/ext/editorText/codemirror/mode/r/index.html b/data/ext/editorText/codemirror/mode/r/index.htmlindex 12819553e..f73e13d62 100644--- a/data/ext/editorText/codemirror/mode/r/index.html+++ b/data/ext/editorText/codemirror/mode/r/index.html@@ -1,23 +1,36 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: R mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="r.js"></script>- <style>++<title>CodeMirror: R mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="r.js"></script>+<style>.CodeMirror { border-top: 1px solid silver; border-bottom: 1px solid silver; }.cm-s-default span.cm-semi { color: blue; font-weight: bold; }.cm-s-default span.cm-dollar { color: orange; font-weight: bold; }.cm-s-default span.cm-arrow { color: brown; }.cm-s-default span.cm-arg-is { color: brown; }</style>- <link rel="stylesheet" href="../../doc/docs.css">- </head>- <body>- <h1>CodeMirror: R mode</h1>- <form><textarea id="code" name="code">+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">R</a>+ </ul>+</div>++<article>+<h2>R mode</h2>+<form><textarea id="code" name="code"># Code from http://www.mayin.org/ajayshah/KB/R/# FIRST LEARN ABOUT LISTS --@@ -70,5 +83,4 @@ powerful <- function(x) {list(x2=x*x, x3=x*x*x, x4=x*x*x*x)}by <a href="http://ubalo.com/">Ubalo</a>, who holdthe <a href="LICENSE">license</a>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/r/r.js b/data/ext/editorText/codemirror/mode/r/r.jsindex 6410efbb2..690cf4050 100644--- a/data/ext/editorText/codemirror/mode/r/r.js+++ b/data/ext/editorText/codemirror/mode/r/r.js@@ -36,7 +36,11 @@ CodeMirror.defineMode("r", function(config) {var word = stream.current();if (atoms.propertyIsEnumerable(word)) return "atom";if (keywords.propertyIsEnumerable(word)) {- if (blockkeywords.propertyIsEnumerable(word)) curPunc = "block";+ // Block keywords start new blocks, except 'else if', which only starts+ // one new block for the 'if', no block for the 'else'.+ if (blockkeywords.propertyIsEnumerable(word) &&+ !stream.match(/\s*if(\s+|$)/, false))+ curPunc = "block";return "keyword";}if (builtins.propertyIsEnumerable(word)) return "builtin";diff --git a/data/ext/editorText/codemirror/mode/rpm/changes/index.html b/data/ext/editorText/codemirror/mode/rpm/changes/index.htmlindex e0e2d8778..0ade01796 100644--- a/data/ext/editorText/codemirror/mode/rpm/changes/index.html+++ b/data/ext/editorText/codemirror/mode/rpm/changes/index.html@@ -1,17 +1,32 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: RPM changes mode</title>++<title>CodeMirror: RPM changes mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">+<link rel="stylesheet" href="../../../lib/codemirror.css"><script src="../../../lib/codemirror.js"></script><script src="changes.js"></script><link rel="stylesheet" href="../../../doc/docs.css"><style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>- </head>- <body>- <h1>CodeMirror: RPM changes mode</h1>-++<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../../doc/logo.png"></a>++ <ul>+ <li><a href="../../../index.html">Home</a>+ <li><a href="../../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../../index.html">Language modes</a>+ <li><a class=active href="#">RPM changes</a>+ </ul>+</div>++<article>+<h2>RPM changes mode</h2>+<div><textarea id="code" name="code">-------------------------------------------------------------------Tue Oct 18 13:58:40 UTC 2011 - [email protected]@@ -43,11 +58,9 @@ Wed Oct 5 14:34:10 UTC 2011 - [email protected]var editor = CodeMirror.fromTextArea(document.getElementById("code"), {mode: {name: "changes"},lineNumbers: true,- indentUnit: 4,- tabMode: "shift"+ indentUnit: 4});</script><p><strong>MIME types defined:</strong> <code>text/x-rpm-changes</code>.</p>- </body>-</html>+</article>diff --git a/data/ext/editorText/codemirror/mode/rpm/spec/index.html b/data/ext/editorText/codemirror/mode/rpm/spec/index.htmlindex 8be98b63e..127b72ee9 100644--- a/data/ext/editorText/codemirror/mode/rpm/spec/index.html+++ b/data/ext/editorText/codemirror/mode/rpm/spec/index.html@@ -1,17 +1,32 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: RPM spec mode</title>++<title>CodeMirror: RPM spec mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">+<link rel="stylesheet" href="../../../lib/codemirror.css"><script src="../../../lib/codemirror.js"></script><script src="spec.js"></script><link rel="stylesheet" href="spec.css"><link rel="stylesheet" href="../../../doc/docs.css"><style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>- </head>- <body>- <h1>CodeMirror: RPM spec mode</h1>++<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../../doc/logo.png"></a>++ <ul>+ <li><a href="../../../index.html">Home</a>+ <li><a href="../../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../../index.html">Language modes</a>+ <li><a class=active href="#">RPM spec</a>+ </ul>+</div>++<article>+<h2>RPM spec mode</h2><div><textarea id="code" name="code">#@@ -95,5 +110,5 @@ find %{buildroot} -type f -name '*.la' -exec rm -f {} ';'</script><p><strong>MIME types defined:</strong> <code>text/x-rpm-spec</code>.</p>- </body>-</html>++</article>diff --git a/data/ext/editorText/codemirror/mode/rpm/spec/spec.js b/data/ext/editorText/codemirror/mode/rpm/spec/spec.jsindex 9f339c21b..0fab6c489 100644--- a/data/ext/editorText/codemirror/mode/rpm/spec/spec.js+++ b/data/ext/editorText/codemirror/mode/rpm/spec/spec.js@@ -4,7 +4,7 @@ CodeMirror.defineMode("spec", function() {var arch = /^(i386|i586|i686|x86_64|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/;var preamble = /^(Name|Version|Release|License|Summary|Url|Group|Source|BuildArch|BuildRequires|BuildRoot|AutoReqProv|Provides|Requires(\(\w+\))?|Obsoletes|Conflicts|Recommends|Source\d*|Patch\d*|ExclusiveArch|NoSource|Supplements):/;- var section = /^%(debug_package|package|description|prep|build|install|files|clean|changelog|preun|postun|pre|post|triggerin|triggerun|pretrans|posttrans|verifyscript|check|triggerpostun|triggerprein|trigger)/;+ var section = /^%(debug_package|package|description|prep|build|install|files|clean|changelog|preinstall|preun|postinstall|postun|pre|post|triggerin|triggerun|pretrans|posttrans|verifyscript|check|triggerpostun|triggerprein|trigger)/;var control_flow_complex = /^%(ifnarch|ifarch|if)/; // rpm control flow macrosvar control_flow_simple = /^%(else|endif)/; // rpm control flow macrosvar operators = /^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/; // operators in control flow macrosdiff --git a/data/ext/editorText/codemirror/mode/rst/LICENSE.txt b/data/ext/editorText/codemirror/mode/rst/LICENSE.txtdeleted file mode 100644index 39484fabb..000000000--- a/data/ext/editorText/codemirror/mode/rst/LICENSE.txt+++ /dev/null@@ -1,21 +0,0 @@-The MIT License--Copyright (c) 2013 Hasan Karahan--Permission is hereby granted, free of charge, to any person obtaining a copy-of this software and associated documentation files (the "Software"), to deal-in the Software without restriction, including without limitation the rights-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell-copies of the Software, and to permit persons to whom the Software is-furnished to do so, subject to the following conditions:--The above copyright notice and this permission notice shall be included in-all copies or substantial portions of the Software.--THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN-THE SOFTWARE.\ No newline at end of filediff --git a/data/ext/editorText/codemirror/mode/rst/index.html b/data/ext/editorText/codemirror/mode/rst/index.htmlindex b3ab64b80..cb8269751 100644--- a/data/ext/editorText/codemirror/mode/rst/index.html+++ b/data/ext/editorText/codemirror/mode/rst/index.html@@ -1,17 +1,30 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: reStructuredText mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="rst.js"></script>- <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>- <link rel="stylesheet" href="../../doc/docs.css">- </head>- <body>- <h1>CodeMirror: reStructuredText mode</h1>+<title>CodeMirror: reStructuredText mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="../../addon/mode/overlay.js"></script>+<script src="rst.js"></script>+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">reStructuredText</a>+ </ul>+</div>++<article>+<h2>reStructuredText mode</h2><form><textarea id="code" name="code">.. This is an excerpt from Sphinx documentation: http://sphinx.pocoo.org/_sources/rest.txt@@ -519,6 +532,4 @@ There are some problems one commonly runs into while authoring reST documents:</p><p><strong>MIME types defined:</strong> <code>text/x-rst</code>.</p>- </body>-</html>-+ </article>diff --git a/data/ext/editorText/codemirror/mode/rst/rst.js b/data/ext/editorText/codemirror/mode/rst/rst.jsindex 8de9d7541..4bb2219fa 100644--- a/data/ext/editorText/codemirror/mode/rst/rst.js+++ b/data/ext/editorText/codemirror/mode/rst/rst.js@@ -1,544 +1,557 @@-CodeMirror.defineMode('rst-base', function (config) {-- ///////////////////////////////////////////////////////////////////////////- ///////////////////////////////////////////////////////////////////////////+CodeMirror.defineMode('rst', function (config, options) {- function format(string) {- var args = Array.prototype.slice.call(arguments, 1);- return string.replace(/{(\d+)}/g, function (match, n) {- return typeof args[n] != 'undefined' ? args[n] : match;- });+ var rx_strong = /^\*\*[^\*\s](?:[^\*]*[^\*\s])?\*\*/;+ var rx_emphasis = /^\*[^\*\s](?:[^\*]*[^\*\s])?\*/;+ var rx_literal = /^``[^`\s](?:[^`]*[^`\s])``/;++ var rx_number = /^(?:[\d]+(?:[\.,]\d+)*)/;+ var rx_positive = /^(?:\s\+[\d]+(?:[\.,]\d+)*)/;+ var rx_negative = /^(?:\s\-[\d]+(?:[\.,]\d+)*)/;++ var rx_uri_protocol = "[Hh][Tt][Tt][Pp][Ss]?://";+ var rx_uri_domain = "(?:[\\d\\w.-]+)\\.(?:\\w{2,6})";+ var rx_uri_path = "(?:/[\\d\\w\\#\\%\\&\\-\\.\\,\\/\\:\\=\\?\\~]+)*";+ var rx_uri = new RegExp("^" + rx_uri_protocol + rx_uri_domain + rx_uri_path);++ var overlay = {+ token: function (stream) {++ if (stream.match(rx_strong) && stream.match (/\W+|$/, false))+ return 'strong';+ if (stream.match(rx_emphasis) && stream.match (/\W+|$/, false))+ return 'em';+ if (stream.match(rx_literal) && stream.match (/\W+|$/, false))+ return 'string-2';+ if (stream.match(rx_number))+ return 'number';+ if (stream.match(rx_positive))+ return 'positive';+ if (stream.match(rx_negative))+ return 'negative';+ if (stream.match(rx_uri))+ return 'link';++ while (stream.next() != null) {+ if (stream.match(rx_strong, false)) break;+ if (stream.match(rx_emphasis, false)) break;+ if (stream.match(rx_literal, false)) break;+ if (stream.match(rx_number, false)) break;+ if (stream.match(rx_positive, false)) break;+ if (stream.match(rx_negative, false)) break;+ if (stream.match(rx_uri, false)) break;+ }++ return null;}+ };- function AssertException(message) {- this.message = message;- }+ var mode = CodeMirror.getMode(+ config, options.backdrop || 'rst-base'+ );- AssertException.prototype.toString = function () {- return 'AssertException: ' + this.message;- };+ return CodeMirror.overlayMode(mode, overlay, true); // combine+}, 'python', 'stex');- function assert(expression, message) {- if (!expression) throw new AssertException(message);- return expression;- }+///////////////////////////////////////////////////////////////////////////////+///////////////////////////////////////////////////////////////////////////////- ///////////////////////////////////////////////////////////////////////////- ///////////////////////////////////////////////////////////////////////////-- var mode_python = CodeMirror.getMode(config, 'python');- var mode_stex = CodeMirror.getMode(config, 'stex');-- ///////////////////////////////////////////////////////////////////////////- ///////////////////////////////////////////////////////////////////////////-- var SEPA = "\\s+";- var TAIL = "(?:\\s*|\\W|$)",- rx_TAIL = new RegExp(format('^{0}', TAIL));-- var NAME = "(?:[^\\W\\d_](?:[\\w\\+\\.\\-:]*[^\\W_])?)",- rx_NAME = new RegExp(format('^{0}', NAME));- var NAME_WWS = "(?:[^\\W\\d_](?:[\\w\\s\\+\\.\\-:]*[^\\W_])?)";- var REF_NAME = format('(?:{0}|`{1}`)', NAME, NAME_WWS);-- var TEXT1 = "(?:[^\\s\\|](?:[^\\|]*[^\\s\\|])?)";- var TEXT2 = "(?:[^\\`]+)",- rx_TEXT2 = new RegExp(format('^{0}', TEXT2));-- var rx_section = new RegExp(- "^([!'#$%&\"()*+,-./:;<=>?@\\[\\\\\\]^_`{|}~])\\1{3,}\\s*$");- var rx_explicit = new RegExp(- format('^\\.\\.{0}', SEPA));- var rx_link = new RegExp(- format('^_{0}:{1}|^__:{1}', REF_NAME, TAIL));- var rx_directive = new RegExp(- format('^{0}::{1}', REF_NAME, TAIL));- var rx_substitution = new RegExp(- format('^\\|{0}\\|{1}{2}::{3}', TEXT1, SEPA, REF_NAME, TAIL));- var rx_footnote = new RegExp(- format('^\\[(?:\\d+|#{0}?|\\*)]{1}', REF_NAME, TAIL));- var rx_citation = new RegExp(- format('^\\[{0}\\]{1}', REF_NAME, TAIL));-- var rx_substitution_ref = new RegExp(- format('^\\|{0}\\|', TEXT1));- var rx_footnote_ref = new RegExp(- format('^\\[(?:\\d+|#{0}?|\\*)]_', REF_NAME));- var rx_citation_ref = new RegExp(- format('^\\[{0}\\]_', REF_NAME));- var rx_link_ref1 = new RegExp(- format('^{0}__?', REF_NAME));- var rx_link_ref2 = new RegExp(- format('^`{0}`_', TEXT2));-- var rx_role_pre = new RegExp(- format('^:{0}:`{1}`{2}', NAME, TEXT2, TAIL));- var rx_role_suf = new RegExp(- format('^`{1}`:{0}:{2}', NAME, TEXT2, TAIL));- var rx_role = new RegExp(- format('^:{0}:{1}', NAME, TAIL));-- var rx_directive_name = new RegExp(format('^{0}', REF_NAME));- var rx_directive_tail = new RegExp(format('^::{0}', TAIL));- var rx_substitution_text = new RegExp(format('^\\|{0}\\|', TEXT1));- var rx_substitution_sepa = new RegExp(format('^{0}', SEPA));- var rx_substitution_name = new RegExp(format('^{0}', REF_NAME));- var rx_substitution_tail = new RegExp(format('^::{0}', TAIL));- var rx_link_head = new RegExp("^_");- var rx_link_name = new RegExp(format('^{0}|_', REF_NAME));- var rx_link_tail = new RegExp(format('^:{0}', TAIL));-- var rx_verbatim = new RegExp('^::\\s*$');- var rx_examples = new RegExp('^\\s+(?:>>>|In \\[\\d+\\]:)\\s');-- ///////////////////////////////////////////////////////////////////////////- ///////////////////////////////////////////////////////////////////////////-- function to_normal(stream, state) {- var token = null;-- if (stream.sol() && stream.match(rx_examples, false)) {- change(state, to_mode, {- mode: mode_python, local: mode_python.startState()- });- } else if (stream.sol() && stream.match(rx_explicit)) {- change(state, to_explicit);- token = 'meta';- } else if (stream.sol() && stream.match(rx_section)) {- change(state, to_normal);- token = 'header';- } else if (phase(state) == rx_role_pre ||- stream.match(rx_role_pre, false)) {-- switch (stage(state)) {- case 0:- change(state, to_normal, context(rx_role_pre, 1));- assert(stream.match(/^:/));- token = 'meta';- break;- case 1:- change(state, to_normal, context(rx_role_pre, 2));- assert(stream.match(rx_NAME));- token = 'keyword';-- if (stream.current().match(/^(?:math|latex)/)) {- state.tmp = {- mode: mode_stex, local: mode_stex.startState()- };- }- break;- case 2:- change(state, to_normal, context(rx_role_pre, 3));- assert(stream.match(/^:`/));- token = 'meta';- break;- case 3:- if (state.tmp) {- if (stream.peek() == '`') {- change(state, to_normal, context(rx_role_pre, 4));- state.tmp = undefined;- break;- }-- token = state.tmp.mode.token(stream, state.tmp.local);- break;- }-- change(state, to_normal, context(rx_role_pre, 4));- assert(stream.match(rx_TEXT2));- token = 'string';- break;- case 4:- change(state, to_normal, context(rx_role_pre, 5));- assert(stream.match(/^`/));- token = 'meta';- break;- case 5:- change(state, to_normal, context(rx_role_pre, 6));- assert(stream.match(rx_TAIL));- break;- default:- change(state, to_normal);- assert(stream.current() == '');- }- } else if (phase(state) == rx_role_suf ||- stream.match(rx_role_suf, false)) {-- switch (stage(state)) {- case 0:- change(state, to_normal, context(rx_role_suf, 1));- assert(stream.match(/^`/));- token = 'meta';- break;- case 1:- change(state, to_normal, context(rx_role_suf, 2));- assert(stream.match(rx_TEXT2));- token = 'string';- break;- case 2:- change(state, to_normal, context(rx_role_suf, 3));- assert(stream.match(/^`:/));- token = 'meta';- break;- case 3:- change(state, to_normal, context(rx_role_suf, 4));- assert(stream.match(rx_NAME));- token = 'keyword';- break;- case 4:- change(state, to_normal, context(rx_role_suf, 5));- assert(stream.match(/^:/));- token = 'meta';- break;- case 5:- change(state, to_normal, context(rx_role_suf, 6));- assert(stream.match(rx_TAIL));- break;- default:- change(state, to_normal);- assert(stream.current() == '');- }- } else if (phase(state) == rx_role || stream.match(rx_role, false)) {-- switch (stage(state)) {- case 0:- change(state, to_normal, context(rx_role, 1));- assert(stream.match(/^:/));- token = 'meta';- break;- case 1:- change(state, to_normal, context(rx_role, 2));- assert(stream.match(rx_NAME));- token = 'keyword';- break;- case 2:- change(state, to_normal, context(rx_role, 3));- assert(stream.match(/^:/));- token = 'meta';- break;- case 3:- change(state, to_normal, context(rx_role, 4));- assert(stream.match(rx_TAIL));- break;- default:- change(state, to_normal);- assert(stream.current() == '');- }- } else if (phase(state) == rx_substitution_ref ||- stream.match(rx_substitution_ref, false)) {-- switch (stage(state)) {- case 0:- change(state, to_normal, context(rx_substitution_ref, 1));- assert(stream.match(rx_substitution_text));- token = 'variable-2';- break;- case 1:- change(state, to_normal, context(rx_substitution_ref, 2));- if (stream.match(/^_?_?/)) token = 'link';- break;- default:- change(state, to_normal);- assert(stream.current() == '');- }- } else if (stream.match(rx_footnote_ref)) {- change(state, to_normal);- token = 'quote';- } else if (stream.match(rx_citation_ref)) {- change(state, to_normal);- token = 'quote';- } else if (stream.match(rx_link_ref1)) {- change(state, to_normal);- if (!stream.peek() || stream.peek().match(/^\W$/)) {- token = 'link';- }- } else if (phase(state) == rx_link_ref2 ||- stream.match(rx_link_ref2, false)) {-- switch (stage(state)) {- case 0:- if (!stream.peek() || stream.peek().match(/^\W$/)) {- change(state, to_normal, context(rx_link_ref2, 1));- } else {- stream.match(rx_link_ref2);- }- break;- case 1:- change(state, to_normal, context(rx_link_ref2, 2));- assert(stream.match(/^`/));- token = 'link';- break;- case 2:- change(state, to_normal, context(rx_link_ref2, 3));- assert(stream.match(rx_TEXT2));- break;- case 3:- change(state, to_normal, context(rx_link_ref2, 4));- assert(stream.match(/^`_/));- token = 'link';- break;- default:- change(state, to_normal);- assert(stream.current() == '');- }- } else if (stream.match(rx_verbatim)) {- change(state, to_verbatim);- }+CodeMirror.defineMode('rst-base', function (config) {- else {- if (stream.next()) change(state, to_normal);+ ///////////////////////////////////////////////////////////////////////////+ ///////////////////////////////////////////////////////////////////////////++ function format(string) {+ var args = Array.prototype.slice.call(arguments, 1);+ return string.replace(/{(\d+)}/g, function (match, n) {+ return typeof args[n] != 'undefined' ? args[n] : match;+ });+ }++ function AssertException(message) {+ this.message = message;+ }++ AssertException.prototype.toString = function () {+ return 'AssertException: ' + this.message;+ };++ function assert(expression, message) {+ if (!expression) throw new AssertException(message);+ return expression;+ }++ ///////////////////////////////////////////////////////////////////////////+ ///////////////////////////////////////////////////////////////////////////++ var mode_python = CodeMirror.getMode(config, 'python');+ var mode_stex = CodeMirror.getMode(config, 'stex');++ ///////////////////////////////////////////////////////////////////////////+ ///////////////////////////////////////////////////////////////////////////++ var SEPA = "\\s+";+ var TAIL = "(?:\\s*|\\W|$)",+ rx_TAIL = new RegExp(format('^{0}', TAIL));++ var NAME =+ "(?:[^\\W\\d_](?:[\\w!\"#$%&'()\\*\\+,\\-\\.\/:;<=>\\?]*[^\\W_])?)",+ rx_NAME = new RegExp(format('^{0}', NAME));+ var NAME_WWS =+ "(?:[^\\W\\d_](?:[\\w\\s!\"#$%&'()\\*\\+,\\-\\.\/:;<=>\\?]*[^\\W_])?)";+ var REF_NAME = format('(?:{0}|`{1}`)', NAME, NAME_WWS);++ var TEXT1 = "(?:[^\\s\\|](?:[^\\|]*[^\\s\\|])?)";+ var TEXT2 = "(?:[^\\`]+)",+ rx_TEXT2 = new RegExp(format('^{0}', TEXT2));++ var rx_section = new RegExp(+ "^([!'#$%&\"()*+,-./:;<=>?@\\[\\\\\\]^_`{|}~])\\1{3,}\\s*$");+ var rx_explicit = new RegExp(+ format('^\\.\\.{0}', SEPA));+ var rx_link = new RegExp(+ format('^_{0}:{1}|^__:{1}', REF_NAME, TAIL));+ var rx_directive = new RegExp(+ format('^{0}::{1}', REF_NAME, TAIL));+ var rx_substitution = new RegExp(+ format('^\\|{0}\\|{1}{2}::{3}', TEXT1, SEPA, REF_NAME, TAIL));+ var rx_footnote = new RegExp(+ format('^\\[(?:\\d+|#{0}?|\\*)]{1}', REF_NAME, TAIL));+ var rx_citation = new RegExp(+ format('^\\[{0}\\]{1}', REF_NAME, TAIL));++ var rx_substitution_ref = new RegExp(+ format('^\\|{0}\\|', TEXT1));+ var rx_footnote_ref = new RegExp(+ format('^\\[(?:\\d+|#{0}?|\\*)]_', REF_NAME));+ var rx_citation_ref = new RegExp(+ format('^\\[{0}\\]_', REF_NAME));+ var rx_link_ref1 = new RegExp(+ format('^{0}__?', REF_NAME));+ var rx_link_ref2 = new RegExp(+ format('^`{0}`_', TEXT2));++ var rx_role_pre = new RegExp(+ format('^:{0}:`{1}`{2}', NAME, TEXT2, TAIL));+ var rx_role_suf = new RegExp(+ format('^`{1}`:{0}:{2}', NAME, TEXT2, TAIL));+ var rx_role = new RegExp(+ format('^:{0}:{1}', NAME, TAIL));++ var rx_directive_name = new RegExp(format('^{0}', REF_NAME));+ var rx_directive_tail = new RegExp(format('^::{0}', TAIL));+ var rx_substitution_text = new RegExp(format('^\\|{0}\\|', TEXT1));+ var rx_substitution_sepa = new RegExp(format('^{0}', SEPA));+ var rx_substitution_name = new RegExp(format('^{0}', REF_NAME));+ var rx_substitution_tail = new RegExp(format('^::{0}', TAIL));+ var rx_link_head = new RegExp("^_");+ var rx_link_name = new RegExp(format('^{0}|_', REF_NAME));+ var rx_link_tail = new RegExp(format('^:{0}', TAIL));++ var rx_verbatim = new RegExp('^::\\s*$');+ var rx_examples = new RegExp('^\\s+(?:>>>|In \\[\\d+\\]:)\\s');++ ///////////////////////////////////////////////////////////////////////////+ ///////////////////////////////////////////////////////////////////////////++ function to_normal(stream, state) {+ var token = null;++ if (stream.sol() && stream.match(rx_examples, false)) {+ change(state, to_mode, {+ mode: mode_python, local: CodeMirror.startState(mode_python)+ });+ } else if (stream.sol() && stream.match(rx_explicit)) {+ change(state, to_explicit);+ token = 'meta';+ } else if (stream.sol() && stream.match(rx_section)) {+ change(state, to_normal);+ token = 'header';+ } else if (phase(state) == rx_role_pre ||+ stream.match(rx_role_pre, false)) {++ switch (stage(state)) {+ case 0:+ change(state, to_normal, context(rx_role_pre, 1));+ assert(stream.match(/^:/));+ token = 'meta';+ break;+ case 1:+ change(state, to_normal, context(rx_role_pre, 2));+ assert(stream.match(rx_NAME));+ token = 'keyword';++ if (stream.current().match(/^(?:math|latex)/)) {+ state.tmp_stex = true;+ }+ break;+ case 2:+ change(state, to_normal, context(rx_role_pre, 3));+ assert(stream.match(/^:`/));+ token = 'meta';+ break;+ case 3:+ if (state.tmp_stex) {+ state.tmp_stex = undefined; state.tmp = {+ mode: mode_stex, local: CodeMirror.startState(mode_stex)+ };}- return token;- }+ if (state.tmp) {+ if (stream.peek() == '`') {+ change(state, to_normal, context(rx_role_pre, 4));+ state.tmp = undefined;+ break;+ }- ///////////////////////////////////////////////////////////////////////////- ///////////////////////////////////////////////////////////////////////////-- function to_explicit(stream, state) {- var token = null;-- if (phase(state) == rx_substitution ||- stream.match(rx_substitution, false)) {-- switch (stage(state)) {- case 0:- change(state, to_explicit, context(rx_substitution, 1));- assert(stream.match(rx_substitution_text));- token = 'variable-2';- break;- case 1:- change(state, to_explicit, context(rx_substitution, 2));- assert(stream.match(rx_substitution_sepa));- break;- case 2:- change(state, to_explicit, context(rx_substitution, 3));- assert(stream.match(rx_substitution_name));- token = 'keyword';- break;- case 3:- change(state, to_explicit, context(rx_substitution, 4));- assert(stream.match(rx_substitution_tail));- token = 'meta';- break;- default:- change(state, to_normal);- assert(stream.current() == '');- }- } else if (phase(state) == rx_directive ||- stream.match(rx_directive, false)) {-- switch (stage(state)) {- case 0:- change(state, to_explicit, context(rx_directive, 1));- assert(stream.match(rx_directive_name));- token = 'keyword';-- if (stream.current().match(/^(?:math|latex)/))- state.tmp_stex = true;- else if (stream.current().match(/^python/))- state.tmp_py = true;- break;- case 1:- change(state, to_explicit, context(rx_directive, 2));- assert(stream.match(rx_directive_tail));- token = 'meta';- break;- default:- if (stream.match(/^latex\s*$/) || state.tmp_stex) {- state.tmp_stex = undefined;- change(state, to_mode, {- mode: mode_stex, local: mode_stex.startState()- });- } else if (stream.match(/^python\s*$/) || state.tmp_py) {- state.tmp_py = undefined;- change(state, to_mode, {- mode: mode_python, local: mode_python.startState()- });- }-- else {- change(state, to_normal);- assert(stream.current() == '');- }- }- } else if (phase(state) == rx_link || stream.match(rx_link, false)) {-- switch (stage(state)) {- case 0:- change(state, to_explicit, context(rx_link, 1));- assert(stream.match(rx_link_head));- assert(stream.match(rx_link_name));- token = 'link';- break;- case 1:- change(state, to_explicit, context(rx_link, 2));- assert(stream.match(rx_link_tail));- token = 'meta';- break;- default:- change(state, to_normal);- assert(stream.current() == '');- }- } else if (stream.match(rx_footnote)) {- change(state, to_normal);- token = 'quote';- } else if (stream.match(rx_citation)) {- change(state, to_normal);- token = 'quote';+ token = state.tmp.mode.token(stream, state.tmp.local);+ break;}- else {- stream.eatSpace();- if (stream.eol()) {- change(state, to_normal);- } else {- stream.skipToEnd();- change(state, to_comment);- token = 'comment';- }+ change(state, to_normal, context(rx_role_pre, 4));+ assert(stream.match(rx_TEXT2));+ token = 'string';+ break;+ case 4:+ change(state, to_normal, context(rx_role_pre, 5));+ assert(stream.match(/^`/));+ token = 'meta';+ break;+ case 5:+ change(state, to_normal, context(rx_role_pre, 6));+ assert(stream.match(rx_TAIL));+ break;+ default:+ change(state, to_normal);+ assert(stream.current() == '');+ }+ } else if (phase(state) == rx_role_suf ||+ stream.match(rx_role_suf, false)) {++ switch (stage(state)) {+ case 0:+ change(state, to_normal, context(rx_role_suf, 1));+ assert(stream.match(/^`/));+ token = 'meta';+ break;+ case 1:+ change(state, to_normal, context(rx_role_suf, 2));+ assert(stream.match(rx_TEXT2));+ token = 'string';+ break;+ case 2:+ change(state, to_normal, context(rx_role_suf, 3));+ assert(stream.match(/^`:/));+ token = 'meta';+ break;+ case 3:+ change(state, to_normal, context(rx_role_suf, 4));+ assert(stream.match(rx_NAME));+ token = 'keyword';+ break;+ case 4:+ change(state, to_normal, context(rx_role_suf, 5));+ assert(stream.match(/^:/));+ token = 'meta';+ break;+ case 5:+ change(state, to_normal, context(rx_role_suf, 6));+ assert(stream.match(rx_TAIL));+ break;+ default:+ change(state, to_normal);+ assert(stream.current() == '');+ }+ } else if (phase(state) == rx_role || stream.match(rx_role, false)) {++ switch (stage(state)) {+ case 0:+ change(state, to_normal, context(rx_role, 1));+ assert(stream.match(/^:/));+ token = 'meta';+ break;+ case 1:+ change(state, to_normal, context(rx_role, 2));+ assert(stream.match(rx_NAME));+ token = 'keyword';+ break;+ case 2:+ change(state, to_normal, context(rx_role, 3));+ assert(stream.match(/^:/));+ token = 'meta';+ break;+ case 3:+ change(state, to_normal, context(rx_role, 4));+ assert(stream.match(rx_TAIL));+ break;+ default:+ change(state, to_normal);+ assert(stream.current() == '');+ }+ } else if (phase(state) == rx_substitution_ref ||+ stream.match(rx_substitution_ref, false)) {++ switch (stage(state)) {+ case 0:+ change(state, to_normal, context(rx_substitution_ref, 1));+ assert(stream.match(rx_substitution_text));+ token = 'variable-2';+ break;+ case 1:+ change(state, to_normal, context(rx_substitution_ref, 2));+ if (stream.match(/^_?_?/)) token = 'link';+ break;+ default:+ change(state, to_normal);+ assert(stream.current() == '');+ }+ } else if (stream.match(rx_footnote_ref)) {+ change(state, to_normal);+ token = 'quote';+ } else if (stream.match(rx_citation_ref)) {+ change(state, to_normal);+ token = 'quote';+ } else if (stream.match(rx_link_ref1)) {+ change(state, to_normal);+ if (!stream.peek() || stream.peek().match(/^\W$/)) {+ token = 'link';+ }+ } else if (phase(state) == rx_link_ref2 ||+ stream.match(rx_link_ref2, false)) {++ switch (stage(state)) {+ case 0:+ if (!stream.peek() || stream.peek().match(/^\W$/)) {+ change(state, to_normal, context(rx_link_ref2, 1));+ } else {+ stream.match(rx_link_ref2);}-- return token;- }-- ///////////////////////////////////////////////////////////////////////////- ///////////////////////////////////////////////////////////////////////////-- function to_comment(stream, state) {- return as_block(stream, state, 'comment');+ break;+ case 1:+ change(state, to_normal, context(rx_link_ref2, 2));+ assert(stream.match(/^`/));+ token = 'link';+ break;+ case 2:+ change(state, to_normal, context(rx_link_ref2, 3));+ assert(stream.match(rx_TEXT2));+ break;+ case 3:+ change(state, to_normal, context(rx_link_ref2, 4));+ assert(stream.match(/^`_/));+ token = 'link';+ break;+ default:+ change(state, to_normal);+ assert(stream.current() == '');+ }+ } else if (stream.match(rx_verbatim)) {+ change(state, to_verbatim);}- function to_verbatim(stream, state) {- return as_block(stream, state, 'meta');+ else {+ if (stream.next()) change(state, to_normal);}- function as_block(stream, state, token) {- if (stream.eol() || stream.eatSpace()) {- stream.skipToEnd();- return token;- } else {- change(state, to_normal);- return null;+ return token;+ }++ ///////////////////////////////////////////////////////////////////////////+ ///////////////////////////////////////////////////////////////////////////++ function to_explicit(stream, state) {+ var token = null;++ if (phase(state) == rx_substitution ||+ stream.match(rx_substitution, false)) {++ switch (stage(state)) {+ case 0:+ change(state, to_explicit, context(rx_substitution, 1));+ assert(stream.match(rx_substitution_text));+ token = 'variable-2';+ break;+ case 1:+ change(state, to_explicit, context(rx_substitution, 2));+ assert(stream.match(rx_substitution_sepa));+ break;+ case 2:+ change(state, to_explicit, context(rx_substitution, 3));+ assert(stream.match(rx_substitution_name));+ token = 'keyword';+ break;+ case 3:+ change(state, to_explicit, context(rx_substitution, 4));+ assert(stream.match(rx_substitution_tail));+ token = 'meta';+ break;+ default:+ change(state, to_normal);+ assert(stream.current() == '');+ }+ } else if (phase(state) == rx_directive ||+ stream.match(rx_directive, false)) {++ switch (stage(state)) {+ case 0:+ change(state, to_explicit, context(rx_directive, 1));+ assert(stream.match(rx_directive_name));+ token = 'keyword';++ if (stream.current().match(/^(?:math|latex)/))+ state.tmp_stex = true;+ else if (stream.current().match(/^python/))+ state.tmp_py = true;+ break;+ case 1:+ change(state, to_explicit, context(rx_directive, 2));+ assert(stream.match(rx_directive_tail));+ token = 'meta';++ if (stream.match(/^latex\s*$/) || state.tmp_stex) {+ state.tmp_stex = undefined; change(state, to_mode, {+ mode: mode_stex, local: CodeMirror.startState(mode_stex)+ });}- }-- ///////////////////////////////////////////////////////////////////////////- ///////////////////////////////////////////////////////////////////////////-- function to_mode(stream, state) {-- if (state.ctx.mode && state.ctx.local) {-- if (stream.sol()) {- if (!stream.eatSpace()) change(state, to_normal);- return null;- }-- try {- return state.ctx.mode.token(stream, state.ctx.local);- } catch (ex) {- change(state, to_normal);- return null;- }+ break;+ case 2:+ change(state, to_explicit, context(rx_directive, 3));+ if (stream.match(/^python\s*$/) || state.tmp_py) {+ state.tmp_py = undefined; change(state, to_mode, {+ mode: mode_python, local: CodeMirror.startState(mode_python)+ });}-+ break;+ default:change(state, to_normal);- return null;- }-- ///////////////////////////////////////////////////////////////////////////- ///////////////////////////////////////////////////////////////////////////-- function context(phase, stage, mode, local) {- return {phase: phase, stage: stage, mode: mode, local: local};- }-- function change(state, tok, ctx) {- state.tok = tok;- state.ctx = ctx || {};+ assert(stream.current() == '');+ }+ } else if (phase(state) == rx_link || stream.match(rx_link, false)) {++ switch (stage(state)) {+ case 0:+ change(state, to_explicit, context(rx_link, 1));+ assert(stream.match(rx_link_head));+ assert(stream.match(rx_link_name));+ token = 'link';+ break;+ case 1:+ change(state, to_explicit, context(rx_link, 2));+ assert(stream.match(rx_link_tail));+ token = 'meta';+ break;+ default:+ change(state, to_normal);+ assert(stream.current() == '');+ }+ } else if (stream.match(rx_footnote)) {+ change(state, to_normal);+ token = 'quote';+ } else if (stream.match(rx_citation)) {+ change(state, to_normal);+ token = 'quote';}- function stage(state) {- return state.ctx.stage || 0;+ else {+ stream.eatSpace();+ if (stream.eol()) {+ change(state, to_normal);+ } else {+ stream.skipToEnd();+ change(state, to_comment);+ token = 'comment';+ }}- function phase(state) {- return state.ctx.phase;- }+ return token;+ }- ///////////////////////////////////////////////////////////////////////////- ///////////////////////////////////////////////////////////////////////////+ ///////////////////////////////////////////////////////////////////////////+ ///////////////////////////////////////////////////////////////////////////- return {- startState: function () {- return {tok: to_normal, ctx: context(undefined, 0)};- },+ function to_comment(stream, state) {+ return as_block(stream, state, 'comment');+ }- copyState: function (state) {- return {tok: state.tok, ctx: state.ctx};- },+ function to_verbatim(stream, state) {+ return as_block(stream, state, 'meta');+ }- innerMode: function (state) {- return {state: state.ctx.local, mode: state.ctx.mode};- },+ function as_block(stream, state, token) {+ if (stream.eol() || stream.eatSpace()) {+ stream.skipToEnd();+ return token;+ } else {+ change(state, to_normal);+ return null;+ }+ }- token: function (stream, state) {- return state.tok(stream, state);- }- };-}, 'python', 'stex');+ ///////////////////////////////////////////////////////////////////////////+ ///////////////////////////////////////////////////////////////////////////-///////////////////////////////////////////////////////////////////////////////-///////////////////////////////////////////////////////////////////////////////+ function to_mode(stream, state) {-CodeMirror.defineMode('rst', function (config, options) {+ if (state.ctx.mode && state.ctx.local) {- var rx_uri_protocol = "[Hh][Tt][Tt][Pp][Ss]?://";- var rx_uri_domain = "(?:[\\d\\w.-]+)\\.(?:\\w{2,6})";- var rx_uri_path = "(?:/[\\d\\w\\#\\%\\&\\-\\.\\,\\/\\:\\=\\?\\~]+)*";- var rx_uri = new RegExp("^" +- rx_uri_protocol + rx_uri_domain + rx_uri_path- );-- var rx_strong = /^\*\*[^\*\s](?:[^\*]*[^\*\s])?\*\*(\s+|$)/;- var rx_emphasis = /^[^\*]\*[^\*\s](?:[^\*]*[^\*\s])?\*(\s+|$)/;- var rx_literal = /^``[^`\s](?:[^`]*[^`\s])``(\s+|$)/;-- var rx_number = /^(?:[\d]+(?:[\.,]\d+)*)/;- var rx_positive = /^(?:\s\+[\d]+(?:[\.,]\d+)*)/;- var rx_negative = /^(?:\s\-[\d]+(?:[\.,]\d+)*)/;-- var overlay = {- token: function (stream) {-- if (stream.match(rx_uri)) return 'link';- if (stream.match(rx_strong)) return 'strong';- if (stream.match(rx_emphasis)) return 'em';- if (stream.match(rx_literal)) return 'string-2';- if (stream.match(rx_number)) return 'number';- if (stream.match(rx_positive)) return 'positive';- if (stream.match(rx_negative)) return 'negative';-- while (stream.next() != null) {- if (stream.match(rx_uri, false)) break;- if (stream.match(rx_strong, false)) break;- if (stream.match(rx_emphasis, false)) break;- if (stream.match(rx_literal, false)) break;- if (stream.match(rx_number, false)) break;- if (stream.match(rx_positive, false)) break;- if (stream.match(rx_negative, false)) break;- }-- return null;- }- };+ if (stream.sol()) {+ if (!stream.eatSpace()) change(state, to_normal);+ return null;+ }- var mode = CodeMirror.getMode(- config, options.backdrop || 'rst-base'- );+ return state.ctx.mode.token(stream, state.ctx.local);+ }- return CodeMirror.overlayMode(mode, overlay, true); // combine+ change(state, to_normal);+ return null;+ }++ ///////////////////////////////////////////////////////////////////////////+ ///////////////////////////////////////////////////////////////////////////++ function context(phase, stage, mode, local) {+ return {phase: phase, stage: stage, mode: mode, local: local};+ }++ function change(state, tok, ctx) {+ state.tok = tok;+ state.ctx = ctx || {};+ }++ function stage(state) {+ return state.ctx.stage || 0;+ }++ function phase(state) {+ return state.ctx.phase;+ }++ ///////////////////////////////////////////////////////////////////////////+ ///////////////////////////////////////////////////////////////////////////++ return {+ startState: function () {+ return {tok: to_normal, ctx: context(undefined, 0)};+ },++ copyState: function (state) {+ var ctx = state.ctx, tmp = state.tmp;+ if (ctx.local)+ ctx = {mode: ctx.mode, local: CodeMirror.copyState(ctx.mode, ctx.local)};+ if (tmp)+ tmp = {mode: tmp.mode, local: CodeMirror.copyState(tmp.mode, tmp.local)};+ return {tok: state.tok, ctx: ctx, tmp: tmp};+ },++ innerMode: function (state) {+ return state.tmp ? {state: state.tmp.local, mode: state.tmp.mode}+ : state.ctx.mode ? {state: state.ctx.local, mode: state.ctx.mode}+ : null;+ },++ token: function (stream, state) {+ return state.tok(stream, state);+ }+ };}, 'python', 'stex');///////////////////////////////////////////////////////////////////////////////diff --git a/data/ext/editorText/codemirror/mode/ruby/LICENSE b/data/ext/editorText/codemirror/mode/ruby/LICENSEdeleted file mode 100644index ac09fc403..000000000--- a/data/ext/editorText/codemirror/mode/ruby/LICENSE+++ /dev/null@@ -1,24 +0,0 @@-Copyright (c) 2011, Ubalo, Inc.-All rights reserved.--Redistribution and use in source and binary forms, with or without-modification, are permitted provided that the following conditions are met:- * Redistributions of source code must retain the above copyright- notice, this list of conditions and the following disclaimer.- * Redistributions in binary form must reproduce the above copyright- notice, this list of conditions and the following disclaimer in the- documentation and/or other materials provided with the distribution.- * Neither the name of the Ubalo, Inc. nor the names of its- contributors may be used to endorse or promote products derived- from this software without specific prior written permission.--THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE-DISCLAIMED. IN NO EVENT SHALL UBALO, INC BE LIABLE FOR ANY-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.diff --git a/data/ext/editorText/codemirror/mode/ruby/index.html b/data/ext/editorText/codemirror/mode/ruby/index.htmlindex 64cfe5ef3..8f0ebca8e 100644--- a/data/ext/editorText/codemirror/mode/ruby/index.html+++ b/data/ext/editorText/codemirror/mode/ruby/index.html@@ -1,21 +1,34 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Ruby mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="../../addon/edit/matchbrackets.js"></script>- <script src="ruby.js"></script>- <style>++<title>CodeMirror: Ruby mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="../../addon/edit/matchbrackets.js"></script>+<script src="ruby.js"></script>+<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}.cm-s-default span.cm-arrow { color: red; }</style>- <link rel="stylesheet" href="../../doc/docs.css">- </head>- <body>- <h1>CodeMirror: Ruby mode</h1>- <form><textarea id="code" name="code">+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Ruby</a>+ </ul>+</div>++<article>+<h2>Ruby mode</h2>+<form><textarea id="code" name="code"># Code from http://sandbox.mc.edu/~bennet/ruby/code/poly_rb.html## This program evaluates polynomials. It first asks for the coefficients@@ -157,7 +170,6 @@ end<script>var editor = CodeMirror.fromTextArea(document.getElementById("code"), {mode: "text/x-ruby",- tabMode: "indent",matchBrackets: true,indentUnit: 4});@@ -169,5 +181,4 @@ endby <a href="http://ubalo.com/">Ubalo</a>, who holdthe <a href="LICENSE">license</a>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/ruby/ruby.js b/data/ext/editorText/codemirror/mode/ruby/ruby.jsindex af0ffe9e5..6a77e2d2a 100644--- a/data/ext/editorText/codemirror/mode/ruby/ruby.js+++ b/data/ext/editorText/codemirror/mode/ruby/ruby.js@@ -12,7 +12,7 @@ CodeMirror.defineMode("ruby", function(config) {"caller", "lambda", "proc", "public", "protected", "private", "require", "load","require_relative", "extend", "autoload", "__END__", "__FILE__", "__LINE__", "__dir__"]);- var indentWords = wordObj(["def", "class", "case", "for", "while", "do", "module", "then",+ var indentWords = wordObj(["def", "class", "case", "for", "while", "module", "then","catch", "loop", "proc", "begin"]);var dedentWords = wordObj(["end", "until"]);var matching = {"[": "]", "{": "}", "(": ")"};@@ -34,13 +34,14 @@ CodeMirror.defineMode("ruby", function(config) {if (ch == "`" || ch == "'" || ch == '"') {return chain(readQuoted(ch, "string", ch == '"' || ch == "`"), stream, state);} else if (ch == "/" && !stream.eol() && stream.peek() != " ") {+ if (stream.eat("=")) return "operator";return chain(readQuoted(ch, "string-2", true), stream, state);} else if (ch == "%") {- var style = "string", embed = false;+ var style = "string", embed = true;if (stream.eat("s")) style = "atom";- else if (stream.eat(/[WQ]/)) { style = "string"; embed = true; }- else if (stream.eat(/[r]/)) { style = "string-2"; embed = true; }- else if (stream.eat(/[wxq]/)) style = "string";+ else if (stream.eat(/[WQ]/)) style = "string";+ else if (stream.eat(/[r]/)) style = "string-2";+ else if (stream.eat(/[wxq]/)) { style = "string"; embed = false; }var delim = stream.eat(/[^\w\s]/);if (!delim) return "operator";if (matching.propertyIsEnumerable(delim)) delim = matching[delim];@@ -214,6 +215,8 @@ CodeMirror.defineMode("ruby", function(config) {else if (dedentWords.propertyIsEnumerable(word)) kwtype = "dedent";else if ((word == "if" || word == "unless") && stream.column() == stream.indentation())kwtype = "indent";+ else if (word == "do" && state.context.indented < state.indented)+ kwtype = "indent";}if (curPunc || (style && style != "comment")) state.lastTok = word || curPunc || style;if (curPunc == "|") state.varList = !state.varList;diff --git a/data/ext/editorText/codemirror/mode/ruby/test.js b/data/ext/editorText/codemirror/mode/ruby/test.jsnew file mode 100644index 000000000..c97d10668--- /dev/null+++ b/data/ext/editorText/codemirror/mode/ruby/test.js@@ -0,0 +1,11 @@+(function() {+ var mode = CodeMirror.getMode({indentUnit: 2}, "ruby");+ function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }++ MT("divide_equal_operator",+ "[variable bar] [operator /=] [variable foo]");++ MT("divide_equal_operator_no_spacing",+ "[variable foo][operator /=][number 42]");++})();diff --git a/data/ext/editorText/codemirror/mode/rust/index.html b/data/ext/editorText/codemirror/mode/rust/index.htmlindex a6d47fe84..4fc099922 100644--- a/data/ext/editorText/codemirror/mode/rust/index.html+++ b/data/ext/editorText/codemirror/mode/rust/index.html@@ -1,16 +1,30 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Rust mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="rust.js"></script>- <link rel="stylesheet" href="../../doc/docs.css">- <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>- </head>- <body>- <h1>CodeMirror: Rust mode</h1>++<title>CodeMirror: Rust mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="rust.js"></script>+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Rust</a>+ </ul>+</div>++<article>+<h2>Rust mode</h2>+<div><textarea id="code" name="code">// Demo code.@@ -38,11 +52,9 @@ fn check_crate(x: int) {<script>var editor = CodeMirror.fromTextArea(document.getElementById("code"), {- lineNumbers: true,- tabMode: "indent"+ lineNumbers: true});</script><p><strong>MIME types defined:</strong> <code>text/x-rustsrc</code>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/rust/rust.js b/data/ext/editorText/codemirror/mode/rust/rust.jsindex 7bee489b4..c7530b6cc 100644--- a/data/ext/editorText/codemirror/mode/rust/rust.js+++ b/data/ext/editorText/codemirror/mode/rust/rust.js@@ -428,7 +428,8 @@ CodeMirror.defineMode("rust", function() {electricChars: "{}",blockCommentStart: "/*",blockCommentEnd: "*/",- lineComment: "//"+ lineComment: "//",+ fold: "brace"};});diff --git a/data/ext/editorText/codemirror/mode/sass/index.html b/data/ext/editorText/codemirror/mode/sass/index.htmlindex 3af7bff9e..66d467784 100644--- a/data/ext/editorText/codemirror/mode/sass/index.html+++ b/data/ext/editorText/codemirror/mode/sass/index.html@@ -1,18 +1,31 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Sass mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="../../addon/edit/matchbrackets.js"></script>- <script src="sass.js"></script>- <style>.CodeMirror {border: 1px solid #ddd; font-size:12px; height: 400px}</style>- <link rel="stylesheet" href="../../doc/docs.css">- </head>- <body>- <h1>CodeMirror: Sass mode</h1>- <form><textarea id="code" name="code">// Variable Definitions++<title>CodeMirror: Sass mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="../../addon/edit/matchbrackets.js"></script>+<script src="sass.js"></script>+<style>.CodeMirror {border: 1px solid #ddd; font-size:12px; height: 400px}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Sass</a>+ </ul>+</div>++<article>+<h2>Sass mode</h2>+<form><textarea id="code" name="code">// Variable Definitions$page-width: 800px$sidebar-width: 200px@@ -50,5 +63,4 @@ body</script><p><strong>MIME types defined:</strong> <code>text/x-sass</code>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/scheme/index.html b/data/ext/editorText/codemirror/mode/scheme/index.htmlindex 5936a0241..164d5da60 100644--- a/data/ext/editorText/codemirror/mode/scheme/index.html+++ b/data/ext/editorText/codemirror/mode/scheme/index.html@@ -1,17 +1,30 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Scheme mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="scheme.js"></script>- <style>.CodeMirror {background: #f8f8f8;}</style>- <link rel="stylesheet" href="../../doc/docs.css">- </head>- <body>- <h1>CodeMirror: Scheme mode</h1>- <form><textarea id="code" name="code">++<title>CodeMirror: Scheme mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="scheme.js"></script>+<style>.CodeMirror {background: #f8f8f8;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Scheme</a>+ </ul>+</div>++<article>+<h2>Scheme mode</h2>+<form><textarea id="code" name="code">; See if the input starts with a given symbol.(define (match-symbol input pattern)(cond ((null? (remain input)) #f)@@ -61,5 +74,4 @@<p><strong>MIME types defined:</strong> <code>text/x-scheme</code>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/shell/index.html b/data/ext/editorText/codemirror/mode/shell/index.htmlindex 9a2ef7c4c..cf415e832 100644--- a/data/ext/editorText/codemirror/mode/shell/index.html+++ b/data/ext/editorText/codemirror/mode/shell/index.html@@ -1,19 +1,33 @@<!doctype html>-<meta charset=utf-8>+<title>CodeMirror: Shell mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css"><link rel=stylesheet href=../../lib/codemirror.css>-<link rel=stylesheet href=../../doc/docs.css>-+<script src=../../lib/codemirror.js></script>+<script src="../../addon/edit/matchbrackets.js"></script>+<script src=shell.js></script><style type=text/css>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>-<script src=../../lib/codemirror.js></script>-<script src="../../addon/edit/matchbrackets.js"></script>-<script src=shell.js></script>+ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Shell</a>+ </ul>+</div>++<article>+<h2>Shell mode</h2>-<h1>CodeMirror: Shell mode</h1><textarea id=code>#!/bin/bash@@ -49,3 +63,4 @@ exit 0</textarea></script><p><strong>MIME types defined:</strong> <code>text/x-sh</code>.</p>+</article>diff --git a/data/ext/editorText/codemirror/mode/sieve/LICENSE b/data/ext/editorText/codemirror/mode/sieve/LICENSEdeleted file mode 100644index 8a74612cb..000000000--- a/data/ext/editorText/codemirror/mode/sieve/LICENSE+++ /dev/null@@ -1,19 +0,0 @@-Copyright (C) 2012 Thomas Schmid <[email protected]>--Permission is hereby granted, free of charge, to any person obtaining a copy-of this software and associated documentation files (the "Software"), to deal-in the Software without restriction, including without limitation the rights-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell-copies of the Software, and to permit persons to whom the Software is-furnished to do so, subject to the following conditions:--The above copyright notice and this permission notice shall be included in-all copies or substantial portions of the Software.--THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN-THE SOFTWARE.diff --git a/data/ext/editorText/codemirror/mode/sieve/index.html b/data/ext/editorText/codemirror/mode/sieve/index.htmlindex 8b549815c..9d814a9d5 100644--- a/data/ext/editorText/codemirror/mode/sieve/index.html+++ b/data/ext/editorText/codemirror/mode/sieve/index.html@@ -1,17 +1,30 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Sieve (RFC5228) mode</title>- <link rel="stylesheet" href="../../doc/docs.css">- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="sieve.js"></script>- <style>.CodeMirror {background: #f8f8f8;}</style>- </head>- <body>- <h1>CodeMirror: Sieve (RFC5228) mode</h1>- <form><textarea id="code" name="code">++<title>CodeMirror: Sieve (RFC5228) mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="sieve.js"></script>+<style>.CodeMirror {background: #f8f8f8;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Sieve (RFC5228)</a>+ </ul>+</div>++<article>+<h2>Sieve (RFC5228) mode</h2>+<form><textarea id="code" name="code">## Example Sieve Filter# Declare any optional features or extension used by the script@@ -77,5 +90,4 @@ else<p><strong>MIME types defined:</strong> <code>application/sieve</code>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/smalltalk/index.html b/data/ext/editorText/codemirror/mode/smalltalk/index.htmlindex b7aebdb7f..0d2b172e1 100644--- a/data/ext/editorText/codemirror/mode/smalltalk/index.html+++ b/data/ext/editorText/codemirror/mode/smalltalk/index.html@@ -1,22 +1,34 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Smalltalk mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="../../addon/edit/matchbrackets.js"></script>- <script src="smalltalk.js"></script>- <link rel="stylesheet" href="../../doc/docs.css">- <style>++<title>CodeMirror: Smalltalk mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="../../addon/edit/matchbrackets.js"></script>+<script src="smalltalk.js"></script>+<style>.CodeMirror {border: 2px solid #dee; border-right-width: 10px;}.CodeMirror-gutter {border: none; background: #dee;}.CodeMirror-gutter pre {color: white; font-weight: bold;}</style>- </head>- <body>- <h1>CodeMirror: Smalltalk mode</h1>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Smalltalk</a>+ </ul>+</div>+<article>+<h2>Smalltalk mode</h2><form><textarea id="code" name="code">"This is a test of the Smalltalk code@@ -53,5 +65,4 @@ MyCounter registerAsApplication: 'mycounter'<p>Simple Smalltalk mode.</p><p><strong>MIME types defined:</strong> <code>text/x-stsrc</code>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/smalltalk/smalltalk.js b/data/ext/editorText/codemirror/mode/smalltalk/smalltalk.jsindex eb3241751..86f749b31 100644--- a/data/ext/editorText/codemirror/mode/smalltalk/smalltalk.js+++ b/data/ext/editorText/codemirror/mode/smalltalk/smalltalk.js@@ -36,8 +36,15 @@ CodeMirror.defineMode('smalltalk', function(config) {token = nextString(stream, new Context(nextString, context));} else if (aChar === '#') {- stream.eatWhile(/[^ .\[\]()]/);- token.name = 'string-2';+ if (stream.peek() === '\'') {+ stream.next();+ token = nextSymbol(stream, new Context(nextSymbol, context));+ } else {+ if (stream.eatWhile(/[^ .{}\[\]()]/))+ token.name = 'string-2';+ else+ token.name = 'meta';+ }} else if (aChar === '$') {if (stream.next() === '<') {@@ -89,6 +96,11 @@ CodeMirror.defineMode('smalltalk', function(config) {return new Token('string', stream.eat('\'') ? context.parent : context, false);};+ var nextSymbol = function(stream, context) {+ stream.eatWhile(/[^']/);+ return new Token('string-2', stream.eat('\'') ? context.parent : context, false);+ };+var nextTemporaries = function(stream, context) {var token = new Token(null, context, false);var aChar = stream.next();diff --git a/data/ext/editorText/codemirror/mode/smarty/index.html b/data/ext/editorText/codemirror/mode/smarty/index.htmlindex 9e4173380..d458aef0f 100644--- a/data/ext/editorText/codemirror/mode/smarty/index.html+++ b/data/ext/editorText/codemirror/mode/smarty/index.html@@ -1,19 +1,30 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Smarty mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="smarty.js"></script>- <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>- <link rel="stylesheet" href="../../doc/docs.css">- </head>- <body>- <h1>CodeMirror: Smarty mode</h1>-- <h3>Default settings (Smarty 2, <b>{</b> and <b>}</b> delimiters)</h3>- <form><textarea id="code" name="code">++<title>CodeMirror: Smarty mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="smarty.js"></script>+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Smarty</a>+ </ul>+</div>++<article>+<h2>Smarty mode</h2>+<form><textarea id="code" name="code">{extends file="parent.tpl"}{include file="template.tpl"}@@ -122,5 +133,4 @@ Smarty "dot" syntax (note: embedded {} are used to address ambiguities):<p>A plain text/Smarty version 2 or 3 mode, which allows for custom delimiter tags.</p><p><strong>MIME types defined:</strong> <code>text/x-smarty</code></p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/smartymixed/index.html b/data/ext/editorText/codemirror/mode/smartymixed/index.htmlnew file mode 100644index 000000000..47c805fac--- /dev/null+++ b/data/ext/editorText/codemirror/mode/smartymixed/index.html@@ -0,0 +1,114 @@+<!doctype html>++<title>CodeMirror: Smarty mixed mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="../../mode/xml/xml.js"></script>+<script src="../../mode/javascript/javascript.js"></script>+<script src="../../mode/css/css.js"></script>+<script src="../../mode/htmlmixed/htmlmixed.js"></script>+<script src="../../mode/smarty/smarty.js"></script>+<script src="../../mode/smartymixed/smartymixed.js"></script>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Smarty mixed</a>+ </ul>+</div>++<article>+<h2>Smarty mixed mode</h2>+<form><textarea id="code" name="code">+{**+* @brief Smarty mixed mode+* @author Ruslan Osmanov+* @date 29.06.2013+*}+<html>+<head>+ <title>{$title|htmlspecialchars|truncate:30}</title>+</head>+<body class="{$bodyclass}">+ {* Multiline smarty+ * comment, no {$variables} here+ *}+ {literal}+ {literal} is just an HTML text.+ <script type="text/javascript">//<![CDATA[+ var a = {$just_a_normal_js_object : "value"};+ var myCodeMirror = CodeMirror.fromTextArea(document.getElementById("code"), {+ mode : "smartymixed",+ tabSize : 2,+ indentUnit : 2,+ indentWithTabs : false,+ lineNumbers : true,+ smartyVersion : 3+ });+ // ]]>+ </script>+ <style>+ /* CSS content+ {$no_smarty} */+ .some-class { font-weight: bolder; color: "orange"; }+ </style>+ {/literal}++ {extends file="parent.tpl"}+ {include file="template.tpl"}++ {* some example Smarty content *}+ {if isset($name) && $name == 'Blog'}+ This is a {$var}.+ {$integer = 4511}, {$array[] = "a"}, {$stringvar = "string"}+ {$integer = 4512} {$array[] = "a"} {$stringvar = "string"}+ {assign var='bob' value=$var.prop}+ {elseif $name == $foo}+ {function name=menu level=0}+ {foreach $data as $entry}+ {if is_array($entry)}+ - {$entry@key}+ {menu data=$entry level=$level+1}+ {else}+ {$entry}+ {* One+ * Two+ * Three+ *}+ {/if}+ {/foreach}+ {/function}+ {/if}+ </body>+ <!-- R.O. -->+</html>+</textarea></form>++ <script type="text/javascript">+ var myCodeMirror = CodeMirror.fromTextArea(document.getElementById("code"), {+ mode : "smartymixed",+ tabSize : 2,+ indentUnit : 2,+ indentWithTabs : false,+ lineNumbers : true,+ smartyVersion : 3,+ matchBrackets : true,+ });+ </script>++ <p>The Smarty mixed mode depends on the Smarty and HTML mixed modes. HTML+ mixed mode itself depends on XML, JavaScript, and CSS modes.</p>++ <p>It takes the same options, as Smarty and HTML mixed modes.</p>++ <p><strong>MIME types defined:</strong> <code>text/x-smarty</code>.</p>+ </article>diff --git a/data/ext/editorText/codemirror/mode/smartymixed/smartymixed.js b/data/ext/editorText/codemirror/mode/smartymixed/smartymixed.jsnew file mode 100644index 000000000..48dd1a675--- /dev/null+++ b/data/ext/editorText/codemirror/mode/smartymixed/smartymixed.js@@ -0,0 +1,173 @@+/**+* @file smartymixed.js+* @brief Smarty Mixed Codemirror mode (Smarty + Mixed HTML)+* @author Ruslan Osmanov <rrosmanov at gmail dot com>+* @version 3.0+* @date 05.07.2013+*/+CodeMirror.defineMode("smartymixed", function(config) {+ var settings, regs, helpers, parsers,+ htmlMixedMode = CodeMirror.getMode(config, "htmlmixed"),+ smartyMode = CodeMirror.getMode(config, "smarty"),++ settings = {+ rightDelimiter: '}',+ leftDelimiter: '{'+ };++ if (config.hasOwnProperty("leftDelimiter")) {+ settings.leftDelimiter = config.leftDelimiter;+ }+ if (config.hasOwnProperty("rightDelimiter")) {+ settings.rightDelimiter = config.rightDelimiter;+ }++ regs = {+ smartyComment: new RegExp("^" + settings.leftDelimiter + "\\*"),+ literalOpen: new RegExp(settings.leftDelimiter + "literal" + settings.rightDelimiter),+ literalClose: new RegExp(settings.leftDelimiter + "\/literal" + settings.rightDelimiter),+ hasLeftDelimeter: new RegExp(".*" + settings.leftDelimiter),+ htmlHasLeftDelimeter: new RegExp("[^<>]*" + settings.leftDelimiter)+ };++ helpers = {+ chain: function(stream, state, parser) {+ state.tokenize = parser;+ return parser(stream, state);+ },++ cleanChain: function(stream, state, parser) {+ state.tokenize = null;+ state.localState = null;+ state.localMode = null;+ return (typeof parser == "string") ? (parser ? parser : null) : parser(stream, state);+ },++ maybeBackup: function(stream, pat, style) {+ var cur = stream.current();+ var close = cur.search(pat),+ m;+ if (close > - 1) stream.backUp(cur.length - close);+ else if (m = cur.match(/<\/?$/)) {+ stream.backUp(cur.length);+ if (!stream.match(pat, false)) stream.match(cur[0]);+ }+ return style;+ }+ };++ parsers = {+ html: function(stream, state) {+ if (!state.inLiteral && stream.match(regs.htmlHasLeftDelimeter, false) && state.htmlMixedState.htmlState.tagName === null) {+ state.tokenize = parsers.smarty;+ state.localMode = smartyMode;+ state.localState = smartyMode.startState(htmlMixedMode.indent(state.htmlMixedState, ""));+ return helpers.maybeBackup(stream, settings.leftDelimiter, smartyMode.token(stream, state.localState));+ } else if (!state.inLiteral && stream.match(settings.leftDelimiter, false)) {+ state.tokenize = parsers.smarty;+ state.localMode = smartyMode;+ state.localState = smartyMode.startState(htmlMixedMode.indent(state.htmlMixedState, ""));+ return helpers.maybeBackup(stream, settings.leftDelimiter, smartyMode.token(stream, state.localState));+ }+ return htmlMixedMode.token(stream, state.htmlMixedState);+ },++ smarty: function(stream, state) {+ if (stream.match(settings.leftDelimiter, false)) {+ if (stream.match(regs.smartyComment, false)) {+ return helpers.chain(stream, state, parsers.inBlock("comment", "*" + settings.rightDelimiter));+ }+ } else if (stream.match(settings.rightDelimiter, false)) {+ stream.eat(settings.rightDelimiter);+ state.tokenize = parsers.html;+ state.localMode = htmlMixedMode;+ state.localState = state.htmlMixedState;+ return "tag";+ }++ return helpers.maybeBackup(stream, settings.rightDelimiter, smartyMode.token(stream, state.localState));+ },++ inBlock: function(style, terminator) {+ return function(stream, state) {+ while (!stream.eol()) {+ if (stream.match(terminator)) {+ helpers.cleanChain(stream, state, "");+ break;+ }+ stream.next();+ }+ return style;+ };+ }+ };++ return {+ startState: function() {+ var state = htmlMixedMode.startState();+ return {+ token: parsers.html,+ localMode: null,+ localState: null,+ htmlMixedState: state,+ tokenize: null,+ inLiteral: false+ };+ },++ copyState: function(state) {+ var local = null, tok = (state.tokenize || state.token);+ if (state.localState) {+ local = CodeMirror.copyState((tok != parsers.html ? smartyMode : htmlMixedMode), state.localState);+ }+ return {+ token: state.token,+ tokenize: state.tokenize,+ localMode: state.localMode,+ localState: local,+ htmlMixedState: CodeMirror.copyState(htmlMixedMode, state.htmlMixedState),+ inLiteral: state.inLiteral+ };+ },++ token: function(stream, state) {+ if (stream.match(settings.leftDelimiter, false)) {+ if (!state.inLiteral && stream.match(regs.literalOpen, true)) {+ state.inLiteral = true;+ return "keyword";+ } else if (state.inLiteral && stream.match(regs.literalClose, true)) {+ state.inLiteral = false;+ return "keyword";+ }+ }+ if (state.inLiteral && state.localState != state.htmlMixedState) {+ state.tokenize = parsers.html;+ state.localMode = htmlMixedMode;+ state.localState = state.htmlMixedState;+ }++ var style = (state.tokenize || state.token)(stream, state);+ return style;+ },++ indent: function(state, textAfter) {+ if (state.localMode == smartyMode+ || (state.inLiteral && !state.localMode)+ || regs.hasLeftDelimeter.test(textAfter)) {+ return CodeMirror.Pass;+ }+ return htmlMixedMode.indent(state.htmlMixedState, textAfter);+ },++ innerMode: function(state) {+ return {+ state: state.localState || state.htmlMixedState,+ mode: state.localMode || htmlMixedMode+ };+ }+ };+},+"htmlmixed");++CodeMirror.defineMIME("text/x-smarty", "smartymixed");+// vim: et ts=2 sts=2 sw=2diff --git a/data/ext/editorText/codemirror/mode/solr/index.html b/data/ext/editorText/codemirror/mode/solr/index.htmlnew file mode 100644index 000000000..cb880244b--- /dev/null+++ b/data/ext/editorText/codemirror/mode/solr/index.html@@ -0,0 +1,57 @@+<!doctype html>++<title>CodeMirror: Solr mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="solr.js"></script>+<style type="text/css">+ .CodeMirror {+ border-top: 1px solid black;+ border-bottom: 1px solid black;+ }++ .CodeMirror .cm-operator {+ color: orange;+ }+</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Solr</a>+ </ul>+</div>++<article>+ <h2>Solr mode</h2>++ <div>+ <textarea id="code" name="code">author:Camus++title:"The Rebel" and author:Camus++philosophy:Existentialism -author:Kierkegaard++hardToSpell:Dostoevsky~++published:[194* TO 1960] and author:(Sartre or "Simone de Beauvoir")</textarea>+ </div>++ <script>+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {+ mode: 'solr',+ lineNumbers: true+ });+ </script>++ <p><strong>MIME types defined:</strong> <code>text/x-solr</code>.</p>+</article>diff --git a/data/ext/editorText/codemirror/mode/solr/solr.js b/data/ext/editorText/codemirror/mode/solr/solr.jsnew file mode 100644index 000000000..c732ff479--- /dev/null+++ b/data/ext/editorText/codemirror/mode/solr/solr.js@@ -0,0 +1,89 @@+CodeMirror.defineMode("solr", function() {+ "use strict";++ var isStringChar = /[^\s\|\!\+\-\*\?\~\^\&\:\(\)\[\]\{\}\^\"\\]/;+ var isOperatorChar = /[\|\!\+\-\*\?\~\^\&]/;+ var isOperatorString = /^(OR|AND|NOT|TO)$/i;++ function isNumber(word) {+ return parseFloat(word, 10).toString() === word;+ }++ function tokenString(quote) {+ return function(stream, state) {+ var escaped = false, next;+ while ((next = stream.next()) != null) {+ if (next == quote && !escaped) break;+ escaped = !escaped && next == "\\";+ }++ if (!escaped) state.tokenize = tokenBase;+ return "string";+ };+ }++ function tokenOperator(operator) {+ return function(stream, state) {+ var style = "operator";+ if (operator == "+")+ style += " positive";+ else if (operator == "-")+ style += " negative";+ else if (operator == "|")+ stream.eat(/\|/);+ else if (operator == "&")+ stream.eat(/\&/);+ else if (operator == "^")+ style += " boost";++ state.tokenize = tokenBase;+ return style;+ };+ }++ function tokenWord(ch) {+ return function(stream, state) {+ var word = ch;+ while ((ch = stream.peek()) && ch.match(isStringChar) != null) {+ word += stream.next();+ }++ state.tokenize = tokenBase;+ if (isOperatorString.test(word))+ return "operator";+ else if (isNumber(word))+ return "number";+ else if (stream.peek() == ":")+ return "field";+ else+ return "string";+ };+ }++ function tokenBase(stream, state) {+ var ch = stream.next();+ if (ch == '"')+ state.tokenize = tokenString(ch);+ else if (isOperatorChar.test(ch))+ state.tokenize = tokenOperator(ch);+ else if (isStringChar.test(ch))+ state.tokenize = tokenWord(ch);++ return (state.tokenize != tokenBase) ? state.tokenize(stream, state) : null;+ }++ return {+ startState: function() {+ return {+ tokenize: tokenBase+ };+ },++ token: function(stream, state) {+ if (stream.eatSpace()) return null;+ return state.tokenize(stream, state);+ }+ };+});++CodeMirror.defineMIME("text/x-solr", "solr");diff --git a/data/ext/editorText/codemirror/mode/sparql/index.html b/data/ext/editorText/codemirror/mode/sparql/index.htmlindex e7433871c..5f19d647b 100644--- a/data/ext/editorText/codemirror/mode/sparql/index.html+++ b/data/ext/editorText/codemirror/mode/sparql/index.html@@ -1,18 +1,31 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: SPARQL mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="../../addon/edit/matchbrackets.js"></script>- <script src="sparql.js"></script>- <style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>- <link rel="stylesheet" href="../../doc/docs.css">- </head>- <body>- <h1>CodeMirror: SPARQL mode</h1>- <form><textarea id="code" name="code">++<title>CodeMirror: SPARQL mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="../../addon/edit/matchbrackets.js"></script>+<script src="sparql.js"></script>+<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">SPARQL</a>+ </ul>+</div>++<article>+<h2>SPARQL mode</h2>+<form><textarea id="code" name="code">PREFIX a: <http://www.w3.org/2000/10/annotation-ns#>PREFIX dc: <http://purl.org/dc/elements/1.1/>PREFIX foaf: <http://xmlns.com/foaf/0.1/>@@ -31,12 +44,10 @@ WHERE {<script>var editor = CodeMirror.fromTextArea(document.getElementById("code"), {mode: "application/x-sparql-query",- tabMode: "indent",matchBrackets: true});</script><p><strong>MIME types defined:</strong> <code>application/x-sparql-query</code>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/sparql/sparql.js b/data/ext/editorText/codemirror/mode/sparql/sparql.jsindex f7237698d..0329057f6 100644--- a/data/ext/editorText/codemirror/mode/sparql/sparql.js+++ b/data/ext/editorText/codemirror/mode/sparql/sparql.js@@ -6,10 +6,12 @@ CodeMirror.defineMode("sparql", function(config) {return new RegExp("^(?:" + words.join("|") + ")$", "i");}var ops = wordRegexp(["str", "lang", "langmatches", "datatype", "bound", "sameterm", "isiri", "isuri",- "isblank", "isliteral", "union", "a"]);+ "isblank", "isliteral", "a"]);var keywords = wordRegexp(["base", "prefix", "select", "distinct", "reduced", "construct", "describe","ask", "from", "named", "where", "order", "limit", "offset", "filter", "optional",- "graph", "by", "asc", "desc"]);+ "graph", "by", "asc", "desc", "as", "having", "undef", "values", "group",+ "minus", "in", "not", "service", "silent", "using", "insert", "delete", "union",+ "data", "copy", "to", "move", "add", "create", "drop", "clear", "load"]);var operatorChars = /[*+\-<>=&|]/;function tokenBase(stream, state) {diff --git a/data/ext/editorText/codemirror/mode/sql/index.html b/data/ext/editorText/codemirror/mode/sql/index.htmlindex acf60b88c..e6882d79c 100644--- a/data/ext/editorText/codemirror/mode/sql/index.html+++ b/data/ext/editorText/codemirror/mode/sql/index.html@@ -1,41 +1,35 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>SQL Mode for CodeMirror</title>- <link rel="stylesheet" href="../../lib/codemirror.css" />- <script src="../../lib/codemirror.js"></script>- <script src="sql.js"></script>- <style>++<title>CodeMirror: SQL Mode for CodeMirror</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css" />+<script src="../../lib/codemirror.js"></script>+<script src="sql.js"></script>+<style>.CodeMirror {border-top: 1px solid black;border-bottom: 1px solid black;}</style>- <link rel="stylesheet" href="../../doc/docs.css">- <script>-var init = function() {- var mime = 'text/x-mariadb';+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>- // get mime type- if (window.location.href.indexOf('mime=') > -1) {- mime = window.location.href.substr(window.location.href.indexOf('mime=') + 5);- }+ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">SQL Mode for CodeMirror</a>+ </ul>+</div>- window.editor = CodeMirror.fromTextArea(document.getElementById('code'), {- mode: mime,- indentWithTabs: true,- smartIndent: true,- lineNumbers: true,- matchBrackets : true,- autofocus: true- });-};- </script>- </head>- <body onload="init();">- <h1>SQL Mode for CodeMirror</h1>- <form>+<article>+<h2>SQL Mode for CodeMirror</h2>+<form><textarea id="code" name="code">-- SQL Mode for CodeMirrorSELECT SQL_NO_CACHE DISTINCT@var1 AS `val1`, @'val2', @global.'sql_mode',@@ -57,12 +51,25 @@ SELECT SQL_NO_CACHE DISTINCT<code><a href="?mime=text/x-mysql">text/x-mysql</a></code>,<code><a href="?mime=text/x-mariadb">text/x-mariadb</a></code>,<code><a href="?mime=text/x-cassandra">text/x-cassandra</a></code>,- <code><a href="?mime=text/x-plsql">text/x-plsql</a></code>.+ <code><a href="?mime=text/x-plsql">text/x-plsql</a></code>,+ <code><a href="?mime=text/x-mssql">text/x-mssql</a></code>.</p>- <p>- <strong>Tests:</strong>- <a href="../../test/index.html#sql_*">normal</a>,- <a href="../../test/index.html#verbose,sql_*">verbose</a>.- </p>- </body>-</html>+<script>+window.onload = function() {+ var mime = 'text/x-mariadb';+ // get mime type+ if (window.location.href.indexOf('mime=') > -1) {+ mime = window.location.href.substr(window.location.href.indexOf('mime=') + 5);+ }+ window.editor = CodeMirror.fromTextArea(document.getElementById('code'), {+ mode: mime,+ indentWithTabs: true,+ smartIndent: true,+ lineNumbers: true,+ matchBrackets : true,+ autofocus: true+ });+};+</script>++</article>diff --git a/data/ext/editorText/codemirror/mode/sql/sql.js b/data/ext/editorText/codemirror/mode/sql/sql.jsindex 9016cc7aa..a34b393fe 100644--- a/data/ext/editorText/codemirror/mode/sql/sql.js+++ b/data/ext/editorText/codemirror/mode/sql/sql.js@@ -177,10 +177,15 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {indent: function(state, textAfter) {var cx = state.context;- if (!cx) return CodeMirror.Pass;- if (cx.align) return cx.col + (textAfter.charAt(0) == cx.type ? 0 : 1);- else return cx.indent + config.indentUnit;- }+ if (!cx) return 0;+ var closing = textAfter.charAt(0) == cx.type;+ if (cx.align) return cx.col + (closing ? 0 : 1);+ else return cx.indent + (closing ? 0 : config.indentUnit);+ },++ blockCommentStart: "/*",+ blockCommentEnd: "*/",+ lineComment: support.commentSlashSlash ? "//" : support.commentHash ? "#" : null};});@@ -258,11 +263,24 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {support: set("ODBCdotTable doubleQuote binaryNumber hexNumber")});+ CodeMirror.defineMIME("text/x-mssql", {+ name: "sql",+ client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),+ keywords: set(sqlKeywords + "begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered"),+ builtin: set("bigint numeric bit smallint decimal smallmoney int tinyint money float real char varchar text nchar nvarchar ntext binary varbinary image cursor timestamp hierarchyid uniqueidentifier sql_variant xml table "),+ atoms: set("false true null unknown"),+ operatorChars: /^[*+\-%<>!=]/,+ dateSQL: set("date datetimeoffset datetime2 smalldatetime datetime time"),+ hooks: {+ "@": hookVar+ }+ });+CodeMirror.defineMIME("text/x-mysql", {name: "sql",client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),- keywords: set(sqlKeywords + "accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general global grant grants group groupby_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),- builtin: set("bool boolean bit blob decimal double enum float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),+ keywords: set(sqlKeywords + "accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group groupby_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),+ builtin: set("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms: set("false true null unknown"),operatorChars: /^[*+\-%<>!=&|^]/,dateSQL: set("date time timestamp"),@@ -277,8 +295,8 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {CodeMirror.defineMIME("text/x-mariadb", {name: "sql",client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),- keywords: set(sqlKeywords + "accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),- builtin: set("bool boolean bit blob decimal double enum float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),+ keywords: set(sqlKeywords + "accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),+ builtin: set("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms: set("false true null unknown"),operatorChars: /^[*+\-%<>!=&|^]/,dateSQL: set("date time timestamp"),@@ -308,9 +326,8 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {CodeMirror.defineMIME("text/x-plsql", {name: "sql",client: set("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"),- keywords: set("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"),- functions: set("abs acos add_months ascii asin atan atan2 average bfilename ceil chartorowid chr concat convert cos cosh count decode deref dual dump dup_val_on_index empty error exp false floor found glb greatest hextoraw initcap instr instrb isopen last_day least lenght lenghtb ln lower lpad ltrim lub make_ref max min mod months_between new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null nvl others power rawtohex reftohex round rowcount rowidtochar rpad rtrim sign sin sinh soundex sqlcode sqlerrm sqrt stddev substr substrb sum sysdate tan tanh to_char to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid upper user userenv variance vsize"),- builtin: set("bfile blob character clob dec float int integer mlslabel natural naturaln nchar nclob number numeric nvarchar2 real rowtype signtype smallint string varchar varchar2"),+ keywords: set("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"),+ builtin: set("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least lenght lenghtb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"),operatorChars: /^[*+\-%<>!=~]/,dateSQL: set("date time timestamp"),support: set("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")diff --git a/data/ext/editorText/codemirror/mode/stex/index.html b/data/ext/editorText/codemirror/mode/stex/index.htmlindex 2dafe6981..28b8f64be 100644--- a/data/ext/editorText/codemirror/mode/stex/index.html+++ b/data/ext/editorText/codemirror/mode/stex/index.html@@ -1,17 +1,30 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: sTeX mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="stex.js"></script>- <style>.CodeMirror {background: #f8f8f8;}</style>- <link rel="stylesheet" href="../../doc/docs.css">- </head>- <body>- <h1>CodeMirror: sTeX mode</h1>- <form><textarea id="code" name="code">++<title>CodeMirror: sTeX mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="stex.js"></script>+<style>.CodeMirror {background: #f8f8f8;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">sTeX</a>+ </ul>+</div>++<article>+<h2>sTeX mode</h2>+<form><textarea id="code" name="code">\begin{module}[id=bbt-size]\importmodule[balanced-binary-trees]{balanced-binary-trees}\importmodule[\KWARCslides{dmath/en/cardinality}]{cardinality}@@ -94,5 +107,4 @@<p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#stex_*">normal</a>, <a href="../../test/index.html#verbose,stex_*">verbose</a>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/tcl/index.html b/data/ext/editorText/codemirror/mode/tcl/index.htmlindex e2e42a04b..c48e25324 100644--- a/data/ext/editorText/codemirror/mode/tcl/index.html+++ b/data/ext/editorText/codemirror/mode/tcl/index.html@@ -1,17 +1,31 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Tcl mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="tcl.js"></script>- <link rel="stylesheet" href="../../theme/night.css">- <link rel="stylesheet" href="../../doc/docs.css">- </head>- <body>- <h1>CodeMirror: Tcl mode</h1>- <form><textarea id="code" name="code">++<title>CodeMirror: Tcl mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<link rel="stylesheet" href="../../theme/night.css">+<script src="../../lib/codemirror.js"></script>+<script src="tcl.js"></script>+<script src="../../addon/scroll/scrollpastend.js"></script>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Tcl</a>+ </ul>+</div>++<article>+<h2>Tcl mode</h2>+<form><textarea id="code" name="code">################################################################################################ ## whois.tcl for eggdrop by Ford_Lawnmower irc.geekshed.net #Script-Help ## ################################################################################################@@ -63,13 +77,13 @@ namespace eval whois {proc whois::311 {from key text} {if {[regexp -- {^[^\s]+\s(.+?)\s(.+?)\s(.+?)\s\*\s\:(.+)$} $text wholematch nick ident host realname]} {putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Host:${whois::textf} \- $nick \(${ident}@${host}\) ${whois::tagf}Realname:${whois::textf} $realname"+ $nick \(${ident}@${host}\) ${whois::tagf}Realname:${whois::textf} $realname"}}proc whois::multi {from key text} {if {[regexp {\:(.*)$} $text match $key]} {putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Note:${whois::textf} [subst $$key]"- return 1+ return 1}}proc whois::312 {from key text} {@@ -84,7 +98,7 @@ proc whois::319 {from key text} {proc whois::317 {from key text} {if {[regexp -- {.*\s(\d+)\s(\d+)\s\:} $text wholematch idle signon]} {putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Connected:${whois::textf} \- [ctime $signon] ${whois::tagf}Idle:${whois::textf} [duration $idle]"+ [ctime $signon] ${whois::tagf}Idle:${whois::textf} [duration $idle]"}}proc whois::301 {from key text} {@@ -94,7 +108,7 @@ proc whois::301 {from key text} {}proc whois::318 {from key text} {namespace eval whois {- variable channel ""+ variable channel ""}variable whois::channel ""}@@ -104,8 +118,8 @@ proc whois::307 {from key text} {proc whois::list {nick host hand chan text} {if {[lsearch -exact [channel info $chan] "+${whois::command}"] != -1} {namespace eval whois {- variable channel ""- }+ variable channel ""+ }variable whois::channel $chanputserv "WHOIS $text"}@@ -115,15 +129,14 @@ Ford_Lawnmower irc.GeekShed.net #Script-Help"</textarea></form><script>var editor = CodeMirror.fromTextArea(document.getElementById("code"), {- tabMode: "indent",- theme: "night",+ theme: "night",lineNumbers: true,indentUnit: 2,+ scrollPastEnd: true,mode: "text/x-tcl"});</script><p><strong>MIME types defined:</strong> <code>text/x-tcl</code>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/tiddlywiki/index.html b/data/ext/editorText/codemirror/mode/tiddlywiki/index.htmlindex 848f33a59..6ef64a4d0 100644--- a/data/ext/editorText/codemirror/mode/tiddlywiki/index.html+++ b/data/ext/editorText/codemirror/mode/tiddlywiki/index.html@@ -1,18 +1,32 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: TiddlyWiki mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="../../addon/edit/matchbrackets.js"></script>- <script src="tiddlywiki.js"></script>- <link rel="stylesheet" href="tiddlywiki.css">- <link rel="stylesheet" href="../../doc/docs.css">- <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>- </head>- <body>- <h1>CodeMirror: TiddlyWiki mode</h1>++<title>CodeMirror: TiddlyWiki mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<link rel="stylesheet" href="tiddlywiki.css">+<script src="../../lib/codemirror.js"></script>+<script src="../../addon/edit/matchbrackets.js"></script>+<script src="tiddlywiki.js"></script>+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">TiddlyWiki</a>+ </ul>+</div>++<article>+<h2>TiddlyWiki mode</h2>+<div><textarea id="code" name="code">!TiddlyWiki Formatting@@ -130,7 +144,6 @@ cf. [[TiddlyWiki.com|http://www.tiddlywiki.com/#EmbeddedImages]]var editor = CodeMirror.fromTextArea(document.getElementById("code"), {mode: 'tiddlywiki',lineNumbers: true,- enterMode: 'keep',matchBrackets: true});</script>@@ -138,5 +151,4 @@ cf. [[TiddlyWiki.com|http://www.tiddlywiki.com/#EmbeddedImages]]<p>TiddlyWiki mode supports a single configuration.</p><p><strong>MIME types defined:</strong> <code>text/x-tiddlywiki</code>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/tiki/index.html b/data/ext/editorText/codemirror/mode/tiki/index.htmlindex 7b85a44a7..5315dbfcd 100644--- a/data/ext/editorText/codemirror/mode/tiki/index.html+++ b/data/ext/editorText/codemirror/mode/tiki/index.html@@ -1,16 +1,31 @@-<html xmlns="http://www.w3.org/1999/xhtml">- <head>- <meta charset="utf-8">- <title>CodeMirror: Tiki wiki mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="tiki.js"></script>- <link rel="stylesheet" href="tiki.css">- <link rel="stylesheet" href="../../doc/docs.css">- <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>- </head>- <body style="padding: 20px;">- <h1>CodeMirror: Tiki wiki mode</h1>+<!doctype html>++<title>CodeMirror: Tiki wiki mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<link rel="stylesheet" href="tiki.css">+<script src="../../lib/codemirror.js"></script>+<script src="tiki.js"></script>+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Tiki wiki</a>+ </ul>+</div>++<article>+<h2>Tiki wiki mode</h2>+<div><textarea id="code" name="code">Headings@@ -77,5 +92,4 @@ Plugin (inline):});</script>-</body>-</html>+</article>diff --git a/data/ext/editorText/codemirror/mode/toml/index.html b/data/ext/editorText/codemirror/mode/toml/index.htmlnew file mode 100644index 000000000..c59b4cc08--- /dev/null+++ b/data/ext/editorText/codemirror/mode/toml/index.html@@ -0,0 +1,73 @@+<!doctype html>++<title>CodeMirror: TOML Mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="toml.js"></script>+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">TOML Mode</a>+ </ul>+</div>++<article>+<h2>TOML Mode</h2>+<form><textarea id="code" name="code">+# This is a TOML document. Boom.++title = "TOML Example"++[owner]+name = "Tom Preston-Werner"+organization = "GitHub"+bio = "GitHub Cofounder & CEO\nLikes tater tots and beer."+dob = 1979-05-27T07:32:00Z # First class dates? Why not?++[database]+server = "192.168.1.1"+ports = [ 8001, 8001, 8002 ]+connection_max = 5000+enabled = true++[servers]++ # You can indent as you please. Tabs or spaces. TOML don't care.+ [servers.alpha]+ ip = "10.0.0.1"+ dc = "eqdc10"++ [servers.beta]+ ip = "10.0.0.2"+ dc = "eqdc10"++[clients]+data = [ ["gamma", "delta"], [1, 2] ]++# Line breaks are OK when inside arrays+hosts = [+ "alpha",+ "omega"+]+</textarea></form>+ <script>+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {+ mode: {name: "toml"},+ lineNumbers: true+ });+ </script>+ <h3>The TOML Mode</h3>+ <p> Created by Forbes Lindesay.</p>+ <p><strong>MIME type defined:</strong> <code>text/x-toml</code>.</p>+ </article>diff --git a/data/ext/editorText/codemirror/mode/toml/toml.js b/data/ext/editorText/codemirror/mode/toml/toml.jsnew file mode 100644index 000000000..1d163f13b--- /dev/null+++ b/data/ext/editorText/codemirror/mode/toml/toml.js@@ -0,0 +1,71 @@+CodeMirror.defineMode("toml", function () {+ return {+ startState: function () {+ return {+ inString: false,+ stringType: "",+ lhs: true,+ inArray: 0+ };+ },+ token: function (stream, state) {+ //check for state changes+ if (!state.inString && ((stream.peek() == '"') || (stream.peek() == "'"))) {+ state.stringType = stream.peek();+ stream.next(); // Skip quote+ state.inString = true; // Update state+ }+ if (stream.sol() && state.inArray === 0) {+ state.lhs = true;+ }+ //return state+ if (state.inString) {+ while (state.inString && !stream.eol()) {+ if (stream.peek() === state.stringType) {+ stream.next(); // Skip quote+ state.inString = false; // Clear flag+ } else if (stream.peek() === '\\') {+ stream.next();+ stream.next();+ } else {+ stream.match(/^.[^\\\"\']*/);+ }+ }+ return state.lhs ? "property string" : "string"; // Token style+ } else if (state.inArray && stream.peek() === ']') {+ stream.next();+ state.inArray--;+ return 'bracket';+ } else if (state.lhs && stream.peek() === '[' && stream.skipTo(']')) {+ stream.next();//skip closing ]+ return "atom";+ } else if (stream.peek() === "#") {+ stream.skipToEnd();+ return "comment";+ } else if (stream.eatSpace()) {+ return null;+ } else if (state.lhs && stream.eatWhile(function (c) { return c != '=' && c != ' '; })) {+ return "property";+ } else if (state.lhs && stream.peek() === "=") {+ stream.next();+ state.lhs = false;+ return null;+ } else if (!state.lhs && stream.match(/^\d\d\d\d[\d\-\:\.T]*Z/)) {+ return 'atom'; //date+ } else if (!state.lhs && (stream.match('true') || stream.match('false'))) {+ return 'atom';+ } else if (!state.lhs && stream.peek() === '[') {+ state.inArray++;+ stream.next();+ return 'bracket';+ } else if (!state.lhs && stream.match(/^\-?\d+(?:\.\d+)?/)) {+ return 'number';+ } else if (!stream.eatSpace()) {+ stream.next();+ }+ return null;+ }+ };+});++CodeMirror.defineMIME('text/x-toml', 'toml');diff --git a/data/ext/editorText/codemirror/mode/turtle/index.html b/data/ext/editorText/codemirror/mode/turtle/index.htmlindex 5e56e5755..27689c34f 100644--- a/data/ext/editorText/codemirror/mode/turtle/index.html+++ b/data/ext/editorText/codemirror/mode/turtle/index.html@@ -1,17 +1,30 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Turtle mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="turtle.js"></script>- <style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>- <link rel="stylesheet" href="../../doc/docs.css">- </head>- <body>- <h1>CodeMirror: Turtle mode</h1>- <form><textarea id="code" name="code">++<title>CodeMirror: Turtle mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="turtle.js"></script>+<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Turtle</a>+ </ul>+</div>++<article>+<h2>Turtle mode</h2>+<form><textarea id="code" name="code">@prefix foaf: <http://xmlns.com/foaf/0.1/> .@prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .@@ -28,12 +41,10 @@<script>var editor = CodeMirror.fromTextArea(document.getElementById("code"), {mode: "text/turtle",- tabMode: "indent",matchBrackets: true});</script><p><strong>MIME types defined:</strong> <code>text/turtle</code>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/vb/LICENSE.txt b/data/ext/editorText/codemirror/mode/vb/LICENSE.txtdeleted file mode 100644index 60839703a..000000000--- a/data/ext/editorText/codemirror/mode/vb/LICENSE.txt+++ /dev/null@@ -1,21 +0,0 @@-The MIT License--Copyright (c) 2012 Codility Limited, 107 Cheapside, London EC2V 6DN, UK--Permission is hereby granted, free of charge, to any person obtaining a copy-of this software and associated documentation files (the "Software"), to deal-in the Software without restriction, including without limitation the rights-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell-copies of the Software, and to permit persons to whom the Software is-furnished to do so, subject to the following conditions:--The above copyright notice and this permission notice shall be included in-all copies or substantial portions of the Software.--THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN-THE SOFTWARE.diff --git a/data/ext/editorText/codemirror/mode/vb/index.html b/data/ext/editorText/codemirror/mode/vb/index.htmlindex 74dd5e816..8b81a88b9 100644--- a/data/ext/editorText/codemirror/mode/vb/index.html+++ b/data/ext/editorText/codemirror/mode/vb/index.html@@ -1,21 +1,36 @@-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: VB.NET mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="vb.js"></script>- <link rel="stylesheet" href="../../doc/docs.css">- <link href="http://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet" type="text/css">- <style>+<!doctype html>++<title>CodeMirror: VB.NET mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<link href="http://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet" type="text/css">+<script src="../../lib/codemirror.js"></script>+<script src="vb.js"></script>+<script type="text/javascript" src="../../addon/runmode/runmode.js"></script>+<style>.CodeMirror {border: 1px solid #aaa; height:210px; height: auto;}.CodeMirror-scroll { overflow-x: auto; overflow-y: hidden;}.CodeMirror pre { font-family: Inconsolata; font-size: 14px}- </style>- <script type="text/javascript" src="../../addon/runmode/runmode.js"></script>- </head>- <body onload="init()">- <h1>CodeMirror: VB.NET mode</h1>+ </style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">VB.NET</a>+ </ul>+</div>++<article>+<h2>VB.NET mode</h2>+<script type="text/javascript">function test(golden, text) {var ok = true;@@ -66,8 +81,7 @@ function init() {editor = CodeMirror.fromTextArea(document.getElementById("solution"), {lineNumbers: true,mode: "text/x-vb",- readOnly: false,- tabMode: "shift"+ readOnly: false});runTest();}@@ -76,13 +90,13 @@ function runTest() {initText(editor);}+document.body.onload = init;</script>-<div id="edit"><textarea style="width:95%;height:200px;padding:5px;" name="solution" id="solution" ></textarea></div><pre id="testresult"></pre><p>MIME type defined: <code>text/x-vb</code>.</p>-</body></html>+</article>diff --git a/data/ext/editorText/codemirror/mode/vbscript/index.html b/data/ext/editorText/codemirror/mode/vbscript/index.htmlindex 8c86f9ef9..9b506b798 100644--- a/data/ext/editorText/codemirror/mode/vbscript/index.html+++ b/data/ext/editorText/codemirror/mode/vbscript/index.html@@ -1,16 +1,30 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: VBScript mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="vbscript.js"></script>- <link rel="stylesheet" href="../../doc/docs.css">- <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>- </head>- <body>- <h1>CodeMirror: VBScript mode</h1>++<title>CodeMirror: VBScript mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="vbscript.js"></script>+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">VBScript</a>+ </ul>+</div>++<article>+<h2>VBScript mode</h2>+<div><textarea id="code" name="code">' Pete Guhl@@ -32,11 +46,10 @@ End If<script>var editor = CodeMirror.fromTextArea(document.getElementById("code"), {- lineNumbers: true+ lineNumbers: true,+ indentUnit: 4});</script><p><strong>MIME types defined:</strong> <code>text/vbscript</code>.</p>- </body>-</html>-+ </article>diff --git a/data/ext/editorText/codemirror/mode/vbscript/vbscript.js b/data/ext/editorText/codemirror/mode/vbscript/vbscript.jsindex 3e1eedc7d..0a97fb640 100644--- a/data/ext/editorText/codemirror/mode/vbscript/vbscript.js+++ b/data/ext/editorText/codemirror/mode/vbscript/vbscript.js@@ -1,26 +1,334 @@-CodeMirror.defineMode("vbscript", function() {- var regexVBScriptKeyword = /^(?:Call|Case|CDate|Clear|CInt|CLng|Const|CStr|Description|Dim|Do|Each|Else|ElseIf|End|Err|Error|Exit|False|For|Function|If|LCase|Loop|LTrim|Next|Nothing|Now|Number|On|Preserve|Quit|ReDim|Resume|RTrim|Select|Set|Sub|Then|To|Trim|True|UBound|UCase|Until|VbCr|VbCrLf|VbLf|VbTab)$/im;-- return {- token: function(stream) {- if (stream.eatSpace()) return null;- var ch = stream.next();- if (ch == "'") {- stream.skipToEnd();- return "comment";- }- if (ch == '"') {- stream.skipTo('"');- return "string";- }-- if (/\w/.test(ch)) {- stream.eatWhile(/\w/);- if (regexVBScriptKeyword.test(stream.current())) return "keyword";- }- return null;+/*+For extra ASP classic objects, initialize CodeMirror instance with this option:+ isASP: true++E.G.:+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {+ lineNumbers: true,+ isASP: true+ });+*/+CodeMirror.defineMode("vbscript", function(conf, parserConf) {+ var ERRORCLASS = 'error';++ function wordRegexp(words) {+ return new RegExp("^((" + words.join(")|(") + "))\\b", "i");+ }++ var singleOperators = new RegExp("^[\\+\\-\\*/&\\\\\\^<>=]");+ var doubleOperators = new RegExp("^((<>)|(<=)|(>=))");+ var singleDelimiters = new RegExp('^[\\.,]');+ var brakets = new RegExp('^[\\(\\)]');+ var identifiers = new RegExp("^[A-Za-z][_A-Za-z0-9]*");++ var openingKeywords = ['class','sub','select','while','if','function', 'property', 'with', 'for'];+ var middleKeywords = ['else','elseif','case'];+ var endKeywords = ['next','loop','wend'];++ var wordOperators = wordRegexp(['and', 'or', 'not', 'xor', 'is', 'mod', 'eqv', 'imp']);+ var commonkeywords = ['dim', 'redim', 'then', 'until', 'randomize',+ 'byval','byref','new','property', 'exit', 'in',+ 'const','private', 'public',+ 'get','set','let', 'stop', 'on error resume next', 'on error goto 0', 'option explicit', 'call', 'me'];++ //This list was from: http://msdn.microsoft.com/en-us/library/f8tbc79x(v=vs.84).aspx+ var atomWords = ['true', 'false', 'nothing', 'empty', 'null'];+ //This list was from: http://msdn.microsoft.com/en-us/library/3ca8tfek(v=vs.84).aspx+ var builtinFuncsWords = ['abs', 'array', 'asc', 'atn', 'cbool', 'cbyte', 'ccur', 'cdate', 'cdbl', 'chr', 'cint', 'clng', 'cos', 'csng', 'cstr', 'date', 'dateadd', 'datediff', 'datepart',+ 'dateserial', 'datevalue', 'day', 'escape', 'eval', 'execute', 'exp', 'filter', 'formatcurrency', 'formatdatetime', 'formatnumber', 'formatpercent', 'getlocale', 'getobject',+ 'getref', 'hex', 'hour', 'inputbox', 'instr', 'instrrev', 'int', 'fix', 'isarray', 'isdate', 'isempty', 'isnull', 'isnumeric', 'isobject', 'join', 'lbound', 'lcase', 'left',+ 'len', 'loadpicture', 'log', 'ltrim', 'rtrim', 'trim', 'maths', 'mid', 'minute', 'month', 'monthname', 'msgbox', 'now', 'oct', 'replace', 'rgb', 'right', 'rnd', 'round',+ 'scriptengine', 'scriptenginebuildversion', 'scriptenginemajorversion', 'scriptengineminorversion', 'second', 'setlocale', 'sgn', 'sin', 'space', 'split', 'sqr', 'strcomp',+ 'string', 'strreverse', 'tan', 'time', 'timer', 'timeserial', 'timevalue', 'typename', 'ubound', 'ucase', 'unescape', 'vartype', 'weekday', 'weekdayname', 'year'];++ //This list was from: http://msdn.microsoft.com/en-us/library/ydz4cfk3(v=vs.84).aspx+ var builtinConsts = ['vbBlack', 'vbRed', 'vbGreen', 'vbYellow', 'vbBlue', 'vbMagenta', 'vbCyan', 'vbWhite', 'vbBinaryCompare', 'vbTextCompare',+ 'vbSunday', 'vbMonday', 'vbTuesday', 'vbWednesday', 'vbThursday', 'vbFriday', 'vbSaturday', 'vbUseSystemDayOfWeek', 'vbFirstJan1', 'vbFirstFourDays', 'vbFirstFullWeek',+ 'vbGeneralDate', 'vbLongDate', 'vbShortDate', 'vbLongTime', 'vbShortTime', 'vbObjectError',+ 'vbOKOnly', 'vbOKCancel', 'vbAbortRetryIgnore', 'vbYesNoCancel', 'vbYesNo', 'vbRetryCancel', 'vbCritical', 'vbQuestion', 'vbExclamation', 'vbInformation', 'vbDefaultButton1', 'vbDefaultButton2',+ 'vbDefaultButton3', 'vbDefaultButton4', 'vbApplicationModal', 'vbSystemModal', 'vbOK', 'vbCancel', 'vbAbort', 'vbRetry', 'vbIgnore', 'vbYes', 'vbNo',+ 'vbCr', 'VbCrLf', 'vbFormFeed', 'vbLf', 'vbNewLine', 'vbNullChar', 'vbNullString', 'vbTab', 'vbVerticalTab', 'vbUseDefault', 'vbTrue', 'vbFalse',+ 'vbEmpty', 'vbNull', 'vbInteger', 'vbLong', 'vbSingle', 'vbDouble', 'vbCurrency', 'vbDate', 'vbString', 'vbObject', 'vbError', 'vbBoolean', 'vbVariant', 'vbDataObject', 'vbDecimal', 'vbByte', 'vbArray'];+ //This list was from: http://msdn.microsoft.com/en-us/library/hkc375ea(v=vs.84).aspx+ var builtinObjsWords = ['WScript', 'err', 'debug', 'RegExp'];+ var knownProperties = ['description', 'firstindex', 'global', 'helpcontext', 'helpfile', 'ignorecase', 'length', 'number', 'pattern', 'source', 'value', 'count'];+ var knownMethods = ['clear', 'execute', 'raise', 'replace', 'test', 'write', 'writeline', 'close', 'open', 'state', 'eof', 'update', 'addnew', 'end', 'createobject', 'quit'];++ var aspBuiltinObjsWords = ['server', 'response', 'request', 'session', 'application'];+ var aspKnownProperties = ['buffer', 'cachecontrol', 'charset', 'contenttype', 'expires', 'expiresabsolute', 'isclientconnected', 'pics', 'status', //response+ 'clientcertificate', 'cookies', 'form', 'querystring', 'servervariables', 'totalbytes', //request+ 'contents', 'staticobjects', //application+ 'codepage', 'lcid', 'sessionid', 'timeout', //session+ 'scripttimeout']; //server+ var aspKnownMethods = ['addheader', 'appendtolog', 'binarywrite', 'end', 'flush', 'redirect', //response+ 'binaryread', //request+ 'remove', 'removeall', 'lock', 'unlock', //application+ 'abandon', //session+ 'getlasterror', 'htmlencode', 'mappath', 'transfer', 'urlencode']; //server++ var knownWords = knownMethods.concat(knownProperties);++ builtinObjsWords = builtinObjsWords.concat(builtinConsts);++ if (conf.isASP){+ builtinObjsWords = builtinObjsWords.concat(aspBuiltinObjsWords);+ knownWords = knownWords.concat(aspKnownMethods, aspKnownProperties);+ };++ var keywords = wordRegexp(commonkeywords);+ var atoms = wordRegexp(atomWords);+ var builtinFuncs = wordRegexp(builtinFuncsWords);+ var builtinObjs = wordRegexp(builtinObjsWords);+ var known = wordRegexp(knownWords);+ var stringPrefixes = '"';++ var opening = wordRegexp(openingKeywords);+ var middle = wordRegexp(middleKeywords);+ var closing = wordRegexp(endKeywords);+ var doubleClosing = wordRegexp(['end']);+ var doOpening = wordRegexp(['do']);+ var noIndentWords = wordRegexp(['on error resume next', 'exit']);+ var comment = wordRegexp(['rem']);+++ function indent(_stream, state) {+ state.currentIndent++;+ }++ function dedent(_stream, state) {+ state.currentIndent--;+ }+ // tokenizers+ function tokenBase(stream, state) {+ if (stream.eatSpace()) {+ return 'space';+ //return null;+ }++ var ch = stream.peek();++ // Handle Comments+ if (ch === "'") {+ stream.skipToEnd();+ return 'comment';+ }+ if (stream.match(comment)){+ stream.skipToEnd();+ return 'comment';+ }+++ // Handle Number Literals+ if (stream.match(/^((&H)|(&O))?[0-9\.]/i, false) && !stream.match(/^((&H)|(&O))?[0-9\.]+[a-z_]/i, false)) {+ var floatLiteral = false;+ // Floats+ if (stream.match(/^\d*\.\d+/i)) { floatLiteral = true; }+ else if (stream.match(/^\d+\.\d*/)) { floatLiteral = true; }+ else if (stream.match(/^\.\d+/)) { floatLiteral = true; }++ if (floatLiteral) {+ // Float literals may be "imaginary"+ stream.eat(/J/i);+ return 'number';+ }+ // Integers+ var intLiteral = false;+ // Hex+ if (stream.match(/^&H[0-9a-f]+/i)) { intLiteral = true; }+ // Octal+ else if (stream.match(/^&O[0-7]+/i)) { intLiteral = true; }+ // Decimal+ else if (stream.match(/^[1-9]\d*F?/)) {+ // Decimal literals may be "imaginary"+ stream.eat(/J/i);+ // TODO - Can you have imaginary longs?+ intLiteral = true;+ }+ // Zero by itself with no other piece of number.+ else if (stream.match(/^0(?![\dx])/i)) { intLiteral = true; }+ if (intLiteral) {+ // Integer literals may be "long"+ stream.eat(/L/i);+ return 'number';+ }+ }++ // Handle Strings+ if (stream.match(stringPrefixes)) {+ state.tokenize = tokenStringFactory(stream.current());+ return state.tokenize(stream, state);+ }++ // Handle operators and Delimiters+ if (stream.match(doubleOperators)+ || stream.match(singleOperators)+ || stream.match(wordOperators)) {+ return 'operator';+ }+ if (stream.match(singleDelimiters)) {+ return null;+ }++ if (stream.match(brakets)) {+ return "bracket";+ }++ if (stream.match(noIndentWords)) {+ state.doInCurrentLine = true;++ return 'keyword';+ }++ if (stream.match(doOpening)) {+ indent(stream,state);+ state.doInCurrentLine = true;++ return 'keyword';+ }+ if (stream.match(opening)) {+ if (! state.doInCurrentLine)+ indent(stream,state);+ else+ state.doInCurrentLine = false;++ return 'keyword';+ }+ if (stream.match(middle)) {+ return 'keyword';+ }+++ if (stream.match(doubleClosing)) {+ dedent(stream,state);+ dedent(stream,state);++ return 'keyword';+ }+ if (stream.match(closing)) {+ if (! state.doInCurrentLine)+ dedent(stream,state);+ else+ state.doInCurrentLine = false;++ return 'keyword';+ }++ if (stream.match(keywords)) {+ return 'keyword';+ }++ if (stream.match(atoms)) {+ return 'atom';+ }++ if (stream.match(known)) {+ return 'variable-2';+ }++ if (stream.match(builtinFuncs)) {+ return 'builtin';+ }++ if (stream.match(builtinObjs)){+ return 'variable-2';+ }++ if (stream.match(identifiers)) {+ return 'variable';+ }++ // Handle non-detected items+ stream.next();+ return ERRORCLASS;}- };++ function tokenStringFactory(delimiter) {+ var singleline = delimiter.length == 1;+ var OUTCLASS = 'string';++ return function(stream, state) {+ while (!stream.eol()) {+ stream.eatWhile(/[^'"]/);+ if (stream.match(delimiter)) {+ state.tokenize = tokenBase;+ return OUTCLASS;+ } else {+ stream.eat(/['"]/);+ }+ }+ if (singleline) {+ if (parserConf.singleLineStringErrors) {+ return ERRORCLASS;+ } else {+ state.tokenize = tokenBase;+ }+ }+ return OUTCLASS;+ };+ }+++ function tokenLexer(stream, state) {+ var style = state.tokenize(stream, state);+ var current = stream.current();++ // Handle '.' connected identifiers+ if (current === '.') {+ style = state.tokenize(stream, state);++ current = stream.current();+ if (style.substr(0, 8) === 'variable' || style==='builtin' || style==='keyword'){//|| knownWords.indexOf(current.substring(1)) > -1) {+ if (style === 'builtin' || style === 'keyword') style='variable';+ if (knownWords.indexOf(current.substr(1)) > -1) style='variable-2';++ return style;+ } else {+ return ERRORCLASS;+ }+ }++ return style;+ }++ var external = {+ electricChars:"dDpPtTfFeE ",+ startState: function() {+ return {+ tokenize: tokenBase,+ lastToken: null,+ currentIndent: 0,+ nextLineIndent: 0,+ doInCurrentLine: false,+ ignoreKeyword: false+++ };+ },++ token: function(stream, state) {+ if (stream.sol()) {+ state.currentIndent += state.nextLineIndent;+ state.nextLineIndent = 0;+ state.doInCurrentLine = 0;+ }+ var style = tokenLexer(stream, state);++ state.lastToken = {style:style, content: stream.current()};++ if (style==='space') style=null;++ return style;+ },++ indent: function(state, textAfter) {+ var trueText = textAfter.replace(/^\s+|\s+$/g, '') ;+ if (trueText.match(closing) || trueText.match(doubleClosing) || trueText.match(middle)) return conf.indentUnit*(state.currentIndent-1);+ if(state.currentIndent < 0) return 0;+ return state.currentIndent * conf.indentUnit;+ }++ };+ return external;});CodeMirror.defineMIME("text/vbscript", "vbscript");diff --git a/data/ext/editorText/codemirror/mode/velocity/index.html b/data/ext/editorText/codemirror/mode/velocity/index.htmlindex fb59cb590..bd38b886b 100644--- a/data/ext/editorText/codemirror/mode/velocity/index.html+++ b/data/ext/editorText/codemirror/mode/velocity/index.html@@ -1,18 +1,31 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Velocity mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="velocity.js"></script>- <link rel="stylesheet" href="../../theme/night.css">- <style>.CodeMirror {border: 1px solid black;}</style>- <link rel="stylesheet" href="../../doc/docs.css">- </head>- <body>- <h1>CodeMirror: Velocity mode</h1>- <form><textarea id="code" name="code">++<title>CodeMirror: Velocity mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<link rel="stylesheet" href="../../theme/night.css">+<script src="../../lib/codemirror.js"></script>+<script src="velocity.js"></script>+<style>.CodeMirror {border: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Velocity</a>+ </ul>+</div>++<article>+<h2>Velocity mode</h2>+<form><textarea id="code" name="code">## Velocity Code Demo#*based on PL/SQL mode by Peter Raganitsch, adapted to Velocity by Steve O'Hara ( http://www.pivotal-solutions.co.uk )@@ -62,13 +75,17 @@$someObject.getValues("this is a string splitacross lines")+$someObject("This plus $something in the middle").method(7567).property+#macro( tablerows $color $somelist )#foreach( $something in $somelist )<tr><td bgcolor=$color>$something</td></tr>+ <tr><td bgcolor=$color>$bodyContent</td></tr>#end#end#tablerows("red" ["dadsdf","dsa"])+#@tablerows("red" ["dadsdf","dsa"]) some body content #endVariable reference: #set( $monkey = $bill )String literal: #set( $monkey.Friend = 'monica' )@@ -89,7 +106,6 @@ Addition: #set( $value = $foo + 1 )</textarea></form><script>var editor = CodeMirror.fromTextArea(document.getElementById("code"), {- tabMode: "indent",theme: "night",lineNumbers: true,indentUnit: 4,@@ -99,5 +115,4 @@ Addition: #set( $value = $foo + 1 )<p><strong>MIME types defined:</strong> <code>text/velocity</code>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/velocity/velocity.js b/data/ext/editorText/codemirror/mode/velocity/velocity.jsindex 43a97ba67..968d8799e 100644--- a/data/ext/editorText/codemirror/mode/velocity/velocity.js+++ b/data/ext/editorText/codemirror/mode/velocity/velocity.js@@ -9,7 +9,7 @@ CodeMirror.defineMode("velocity", function() {"#{end} #{else} #{break} #{stop}");var functions = parseWords("#if #elseif #foreach #set #include #parse #macro #define #evaluate " +"#{if} #{elseif} #{foreach} #{set} #{include} #{parse} #{macro} #{define} #{evaluate}");- var specials = parseWords("$foreach.count $foreach.hasNext $foreach.first $foreach.last $foreach.topmost $foreach.parent $velocityCount");+ var specials = parseWords("$foreach.count $foreach.hasNext $foreach.first $foreach.last $foreach.topmost $foreach.parent.count $foreach.parent.hasNext $foreach.parent.first $foreach.parent.last $foreach.parent $velocityCount $!bodyContent $bodyContent");var isOperatorChar = /[+\-*&%=<>!?:\/|]/;function chain(stream, state, f) {@@ -20,30 +20,50 @@ CodeMirror.defineMode("velocity", function() {var beforeParams = state.beforeParams;state.beforeParams = false;var ch = stream.next();- // start of string?- if ((ch == '"' || ch == "'") && state.inParams)+ // start of unparsed string?+ if ((ch == "'") && state.inParams) {+ state.lastTokenWasBuiltin = false;return chain(stream, state, tokenString(ch));+ }+ // start of parsed string?+ else if ((ch == '"')) {+ state.lastTokenWasBuiltin = false;+ if (state.inString) {+ state.inString = false;+ return "string";+ }+ else if (state.inParams)+ return chain(stream, state, tokenString(ch));+ }// is it one of the special signs []{}().,;? Seperator?else if (/[\[\]{}\(\),;\.]/.test(ch)) {- if (ch == "(" && beforeParams) state.inParams = true;- else if (ch == ")") state.inParams = false;+ if (ch == "(" && beforeParams)+ state.inParams = true;+ else if (ch == ")") {+ state.inParams = false;+ state.lastTokenWasBuiltin = true;+ }return null;}// start of a number value?else if (/\d/.test(ch)) {+ state.lastTokenWasBuiltin = false;stream.eatWhile(/[\w\.]/);return "number";}// multi line comment?else if (ch == "#" && stream.eat("*")) {+ state.lastTokenWasBuiltin = false;return chain(stream, state, tokenComment);}// unparsed content?else if (ch == "#" && stream.match(/ *\[ *\[/)) {+ state.lastTokenWasBuiltin = false;return chain(stream, state, tokenUnparsed);}// single line comment?else if (ch == "#" && stream.eat("#")) {+ state.lastTokenWasBuiltin = false;stream.skipToEnd();return "comment";}@@ -51,33 +71,44 @@ CodeMirror.defineMode("velocity", function() {else if (ch == "$") {stream.eatWhile(/[\w\d\$_\.{}]/);// is it one of the specials?- if (specials && specials.propertyIsEnumerable(stream.current().toLowerCase())) {+ if (specials && specials.propertyIsEnumerable(stream.current())) {return "keyword";}else {+ state.lastTokenWasBuiltin = true;state.beforeParams = true;return "builtin";}}// is it a operator?else if (isOperatorChar.test(ch)) {+ state.lastTokenWasBuiltin = false;stream.eatWhile(isOperatorChar);return "operator";}else {// get the whole word- stream.eatWhile(/[\w\$_{}]/);- var word = stream.current().toLowerCase();+ stream.eatWhile(/[\w\$_{}@]/);+ var word = stream.current();// is it one of the listed keywords?if (keywords && keywords.propertyIsEnumerable(word))return "keyword";// is it one of the listed functions?if (functions && functions.propertyIsEnumerable(word) ||- stream.current().match(/^#[a-z0-9_]+ *$/i) && stream.peek()=="(") {+ (stream.current().match(/^#@?[a-z0-9_]+ *$/i) && stream.peek()=="(") &&+ !(functions && functions.propertyIsEnumerable(word.toLowerCase()))) {state.beforeParams = true;+ state.lastTokenWasBuiltin = false;return "keyword";}+ if (state.inString) {+ state.lastTokenWasBuiltin = false;+ return "string";+ }+ if (stream.pos > word.length && stream.string.charAt(stream.pos-word.length-1)=="." && state.lastTokenWasBuiltin)+ return "builtin";// default: just a "word"+ state.lastTokenWasBuiltin = false;return null;}}@@ -86,7 +117,12 @@ CodeMirror.defineMode("velocity", function() {return function(stream, state) {var escaped = false, next, end = false;while ((next = stream.next()) != null) {- if (next == quote && !escaped) {+ if ((next == quote) && !escaped) {+ end = true;+ break;+ }+ if (quote=='"' && stream.peek() == '$' && !escaped) {+ state.inString = true;end = true;break;}@@ -130,14 +166,20 @@ CodeMirror.defineMode("velocity", function() {return {tokenize: tokenBase,beforeParams: false,- inParams: false+ inParams: false,+ inString: false,+ lastTokenWasBuiltin: false};},token: function(stream, state) {if (stream.eatSpace()) return null;return state.tokenize(stream, state);- }+ },+ blockCommentStart: "#*",+ blockCommentEnd: "*#",+ lineComment: "##",+ fold: "velocity"};});diff --git a/data/ext/editorText/codemirror/mode/verilog/index.html b/data/ext/editorText/codemirror/mode/verilog/index.htmlindex f7c88c623..cc7105644 100644--- a/data/ext/editorText/codemirror/mode/verilog/index.html+++ b/data/ext/editorText/codemirror/mode/verilog/index.html@@ -1,17 +1,29 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Verilog mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="verilog.js"></script>- <link rel="stylesheet" href="../../doc/docs.css">- <style>.CodeMirror {border: 2px inset #dee;}</style>- </head>- <body>- <h1>CodeMirror: Verilog mode</h1>+<title>CodeMirror: Verilog mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="verilog.js"></script>+<style>.CodeMirror {border: 2px inset #dee;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Verilog</a>+ </ul>+</div>++<article>+<h2>Verilog mode</h2><form><textarea id="code" name="code">/* Verilog demo code */@@ -117,5 +129,4 @@ endmoduleobject whose property names are the keywords in the language.</p><p><strong>MIME types defined:</strong> <code>text/x-verilog</code> (Verilog code).</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/xml/index.html b/data/ext/editorText/codemirror/mode/xml/index.htmlindex 9628d954c..873099aab 100644--- a/data/ext/editorText/codemirror/mode/xml/index.html+++ b/data/ext/editorText/codemirror/mode/xml/index.html@@ -1,17 +1,30 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: XML mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="xml.js"></script>- <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>- <link rel="stylesheet" href="../../doc/docs.css">- </head>- <body>- <h1>CodeMirror: XML mode</h1>- <form><textarea id="code" name="code">++<title>CodeMirror: XML mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="xml.js"></script>+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">XML</a>+ </ul>+</div>++<article>+<h2>XML mode</h2>+<form><textarea id="code" name="code"><html style="color: green"><!-- this is a comment --><head>@@ -41,5 +54,4 @@</dl><p><strong>MIME types defined:</strong> <code>application/xml</code>, <code>text/html</code>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/xml/xml.js b/data/ext/editorText/codemirror/mode/xml/xml.jsindex ae71c6413..fc6fd1b71 100644--- a/data/ext/editorText/codemirror/mode/xml/xml.js+++ b/data/ext/editorText/codemirror/mode/xml/xml.js@@ -1,6 +1,8 @@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,@@ -44,7 +46,7 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {var alignCDATA = parserConfig.alignCDATA;// Return variables for tokenizers- var tagName, type;+ var tagName, type, setStyle;function inText(stream, state) {function chain(parser) {@@ -75,7 +77,7 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {tagName = "";var c;while ((c = stream.eat(/[^\s\u00a0=<>\"\'\/?]/))) tagName += c;- if (!tagName) return "error";+ if (!tagName) return "tag error";type = isClose ? "closeTag" : "openTag";state.tokenize = inTag;return "tag";@@ -108,9 +110,14 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {type = "equals";return null;} else if (ch == "<") {- return "error";+ state.tokenize = inText;+ state.state = baseState;+ state.tagName = state.tagStart = null;+ var next = state.tokenize(stream, state);+ return next ? next + " error" : "error";} else if (/[\'\"]/.test(ch)) {state.tokenize = inAttribute(ch);+ state.stringStartCol = stream.column();return state.tokenize(stream, state);} else {stream.eatWhile(/[^\s\u00a0=<>\"\']/);@@ -119,7 +126,7 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {}function inAttribute(quote) {- return function(stream, state) {+ var closure = function(stream, state) {while (!stream.eol()) {if (stream.next() == quote) {state.tokenize = inTag;@@ -128,6 +135,8 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {}return "string";};+ closure.isInAttribute = true;+ return closure;}function inBlock(style, terminator) {@@ -163,146 +172,143 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {};}- var curState, curStream, setStyle;- function pass() {- for (var i = arguments.length - 1; i >= 0; i--) curState.cc.push(arguments[i]);- }- function cont() {- pass.apply(null, arguments);- return true;+ function Context(state, tagName, startOfLine) {+ this.prev = state.context;+ this.tagName = tagName;+ this.indent = state.indented;+ this.startOfLine = startOfLine;+ if (Kludges.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))+ this.noIndent = true;}-- function pushContext(tagName, startOfLine) {- var noIndent = Kludges.doNotIndent.hasOwnProperty(tagName) || (curState.context && curState.context.noIndent);- curState.context = {- prev: curState.context,- tagName: tagName,- indent: curState.indented,- startOfLine: startOfLine,- noIndent: noIndent- };+ function popContext(state) {+ if (state.context) state.context = state.context.prev;}- function popContext() {- if (curState.context) curState.context = curState.context.prev;+ function maybePopContext(state, nextTagName) {+ var parentTagName;+ while (true) {+ if (!state.context) {+ return;+ }+ parentTagName = state.context.tagName.toLowerCase();+ if (!Kludges.contextGrabbers.hasOwnProperty(parentTagName) ||+ !Kludges.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {+ return;+ }+ popContext(state);+ }}- function element(type) {+ function baseState(type, stream, state) {if (type == "openTag") {- curState.tagName = tagName;- curState.tagStart = curStream.column();- return cont(attributes, endtag(curState.startOfLine));+ state.tagName = tagName;+ state.tagStart = stream.column();+ return attrState;} else if (type == "closeTag") {var err = false;- if (curState.context) {- if (curState.context.tagName != tagName) {- if (Kludges.implicitlyClosed.hasOwnProperty(curState.context.tagName.toLowerCase())) {- popContext();- }- err = !curState.context || curState.context.tagName != tagName;+ if (state.context) {+ if (state.context.tagName != tagName) {+ if (Kludges.implicitlyClosed.hasOwnProperty(state.context.tagName.toLowerCase()))+ popContext(state);+ err = !state.context || state.context.tagName != tagName;}} else {err = true;}if (err) setStyle = "error";- return cont(endclosetag(err));+ return err ? closeStateErr : closeState;+ } else {+ return baseState;}- return cont();}- function endtag(startOfLine) {- return function(type) {- var tagName = curState.tagName;- curState.tagName = curState.tagStart = null;- if (type == "selfcloseTag" ||- (type == "endTag" && Kludges.autoSelfClosers.hasOwnProperty(tagName.toLowerCase()))) {- maybePopContext(tagName.toLowerCase());- return cont();- }- if (type == "endTag") {- maybePopContext(tagName.toLowerCase());- pushContext(tagName, startOfLine);- return cont();- }- return cont();- };- }- function endclosetag(err) {- return function(type) {- if (err) setStyle = "error";- if (type == "endTag") { popContext(); return cont(); }+ function closeState(type, _stream, state) {+ if (type != "endTag") {setStyle = "error";- return cont(arguments.callee);- };- }- function maybePopContext(nextTagName) {- var parentTagName;- while (true) {- if (!curState.context) {- return;- }- parentTagName = curState.context.tagName.toLowerCase();- if (!Kludges.contextGrabbers.hasOwnProperty(parentTagName) ||- !Kludges.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {- return;- }- popContext();+ return closeState;}+ popContext(state);+ return baseState;+ }+ function closeStateErr(type, stream, state) {+ setStyle = "error";+ return closeState(type, stream, state);}- function attributes(type) {- if (type == "word") {setStyle = "attribute"; return cont(attribute, attributes);}- if (type == "endTag" || type == "selfcloseTag") return pass();+ function attrState(type, _stream, state) {+ if (type == "word") {+ setStyle = "attribute";+ return attrEqState;+ } else if (type == "endTag" || type == "selfcloseTag") {+ var tagName = state.tagName, tagStart = state.tagStart;+ state.tagName = state.tagStart = null;+ if (type == "selfcloseTag" ||+ Kludges.autoSelfClosers.hasOwnProperty(tagName.toLowerCase())) {+ maybePopContext(state, tagName.toLowerCase());+ } else {+ maybePopContext(state, tagName.toLowerCase());+ state.context = new Context(state, tagName, tagStart == state.indented);+ }+ return baseState;+ }setStyle = "error";- return cont(attributes);+ return attrState;}- function attribute(type) {- if (type == "equals") return cont(attvalue, attributes);+ function attrEqState(type, stream, state) {+ if (type == "equals") return attrValueState;if (!Kludges.allowMissing) setStyle = "error";- else if (type == "word") setStyle = "attribute";- return (type == "endTag" || type == "selfcloseTag") ? pass() : cont();+ return attrState(type, stream, state);}- function attvalue(type) {- if (type == "string") return cont(attvaluemaybe);- if (type == "word" && Kludges.allowUnquoted) {setStyle = "string"; return cont();}+ function attrValueState(type, stream, state) {+ if (type == "string") return attrContinuedState;+ if (type == "word" && Kludges.allowUnquoted) {setStyle = "string"; return attrState;}setStyle = "error";- return (type == "endTag" || type == "selfCloseTag") ? pass() : cont();+ return attrState(type, stream, state);}- function attvaluemaybe(type) {- if (type == "string") return cont(attvaluemaybe);- else return pass();+ function attrContinuedState(type, stream, state) {+ if (type == "string") return attrContinuedState;+ return attrState(type, stream, state);}return {startState: function() {- return {tokenize: inText, cc: [], indented: 0, startOfLine: true, tagName: null, tagStart: null, context: null};+ return {tokenize: inText,+ state: baseState,+ indented: 0,+ tagName: null, tagStart: null,+ context: null};},token: function(stream, state) {- if (!state.tagName && stream.sol()) {- state.startOfLine = true;+ if (!state.tagName && stream.sol())state.indented = stream.indentation();- }- if (stream.eatSpace()) return null;- setStyle = type = tagName = null;+ if (stream.eatSpace()) return null;+ tagName = type = null;var style = state.tokenize(stream, state);- state.type = type;if ((style || type) && style != "comment") {- curState = state; curStream = stream;- while (true) {- var comb = state.cc.pop() || element;- if (comb(type || style)) break;- }+ setStyle = null;+ state.state = state.state(type || style, stream, state);+ if (setStyle)+ style = setStyle == "error" ? style + " error" : setStyle;}- state.startOfLine = false;- return setStyle || style;+ return style;},indent: function(state, textAfter, fullLine) {var context = state.context;- if ((state.tokenize != inTag && state.tokenize != inText) ||- context && context.noIndent)+ // Indent multi-line strings (e.g. css).+ if (state.tokenize.isInAttribute) {+ return state.stringStartCol + 1;+ }+ if (context && context.noIndent) return CodeMirror.Pass;+ if (state.tokenize != inTag && state.tokenize != inText)return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0;- if (state.tagName) return state.tagStart + indentUnit * multilineTagIndentFactor;+ // Indent the starts of attribute names.+ if (state.tagName) {+ if (multilineTagIndentPastTag)+ return state.tagStart + state.tagName.length + 2;+ else+ return state.tagStart + indentUnit * multilineTagIndentFactor;+ }if (alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0;if (context && /^<\//.test(textAfter))context = context.prev;@@ -316,7 +322,8 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {blockCommentStart: "<!--",blockCommentEnd: "-->",- configuration: parserConfig.htmlMode ? "html" : "xml"+ configuration: parserConfig.htmlMode ? "html" : "xml",+ helperType: parserConfig.htmlMode ? "html" : "xml"};});diff --git a/data/ext/editorText/codemirror/mode/xquery/LICENSE b/data/ext/editorText/codemirror/mode/xquery/LICENSEdeleted file mode 100644index 2a2d47be5..000000000--- a/data/ext/editorText/codemirror/mode/xquery/LICENSE+++ /dev/null@@ -1,20 +0,0 @@-Copyright (C) 2011 by MarkLogic Corporation-Author: Mike Brevoort <[email protected]>--Permission is hereby granted, free of charge, to any person obtaining a copy-of this software and associated documentation files (the "Software"), to deal-in the Software without restriction, including without limitation the rights-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell-copies of the Software, and to permit persons to whom the Software is-furnished to do so, subject to the following conditions:--The above copyright notice and this permission notice shall be included in-all copies or substantial portions of the Software.--THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN-THE SOFTWARE.\ No newline at end of filediff --git a/data/ext/editorText/codemirror/mode/xquery/index.html b/data/ext/editorText/codemirror/mode/xquery/index.htmlindex 27acb8978..3baf5e3e3 100644--- a/data/ext/editorText/codemirror/mode/xquery/index.html+++ b/data/ext/editorText/codemirror/mode/xquery/index.html@@ -1,46 +1,36 @@-<!doctype html>-<html>-<!---/*-Copyright (C) 2011 by MarkLogic Corporation-Author: Mike Brevoort <[email protected]>--Permission is hereby granted, free of charge, to any person obtaining a copy-of this software and associated documentation files (the "Software"), to deal-in the Software without restriction, including without limitation the rights-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell-copies of the Software, and to permit persons to whom the Software is-furnished to do so, subject to the following conditions:--The above copyright notice and this permission notice shall be included in-all copies or substantial portions of the Software.--THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN-THE SOFTWARE.-*/--->- <head>- <meta charset="utf-8">- <title>CodeMirror: XQuery mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="xquery.js"></script>- <link rel="stylesheet" href="../../doc/docs.css">- <link rel="stylesheet" href="../../theme/xq-dark.css">- <style type="text/css">+<!doctype html>++<title>CodeMirror: XQuery mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<link rel="stylesheet" href="../../theme/xq-dark.css">+<script src="../../lib/codemirror.js"></script>+<script src="xquery.js"></script>+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;height:400px;}- </style>- </head>- <body>- <h1>CodeMirror: XQuery mode</h1>+ </style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">XQuery</a>+ </ul>+</div>++<article>+<h2>XQuery mode</h2>+<div class="cm-s-default"><textarea id="code" name="code">@@ -217,5 +207,4 @@ declare function json:serialize($x as element()) as xs:string {<a href="https://twitter.com/mbrevoort">Mike Brevoort</a>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/xquery/xquery.js b/data/ext/editorText/codemirror/mode/xquery/xquery.jsindex 95decc11b..be1798463 100644--- a/data/ext/editorText/codemirror/mode/xquery/xquery.js+++ b/data/ext/editorText/codemirror/mode/xquery/xquery.js@@ -1,25 +1,3 @@-/*-Copyright (C) 2011 by MarkLogic Corporation-Author: Mike Brevoort <[email protected]>--Permission is hereby granted, free of charge, to any person obtaining a copy-of this software and associated documentation files (the "Software"), to deal-in the Software without restriction, including without limitation the rights-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell-copies of the Software, and to permit persons to whom the Software is-furnished to do so, subject to the following conditions:--The above copyright notice and this permission notice shall be included in-all copies or substantial portions of the Software.--THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN-THE SOFTWARE.-*/CodeMirror.defineMode("xquery", function() {// The keywords object is set to the result of this self executing@@ -348,7 +326,7 @@ CodeMirror.defineMode("xquery", function() {return chain(stream, state, tokenString(ch, tokenAttribute));if(!isInXmlAttributeBlock(state))- pushStateStack(state, { type: "attribute", name: name, tokenize: tokenAttribute});+ pushStateStack(state, { type: "attribute", tokenize: tokenAttribute});stream.eat(/[a-zA-Z_:]/);stream.eatWhile(/[-a-zA-Z0-9_:.]/);@@ -442,7 +420,11 @@ CodeMirror.defineMode("xquery", function() {if (stream.eatSpace()) return null;var style = state.tokenize(stream, state);return style;- }+ },++ blockCommentStart: "(:",+ blockCommentEnd: ":)"+};});diff --git a/data/ext/editorText/codemirror/mode/yaml/index.html b/data/ext/editorText/codemirror/mode/yaml/index.htmlindex 65e1ea73f..bbb40a3c7 100644--- a/data/ext/editorText/codemirror/mode/yaml/index.html+++ b/data/ext/editorText/codemirror/mode/yaml/index.html@@ -1,17 +1,30 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: YAML mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="yaml.js"></script>- <style>.CodeMirror { border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; }</style>- <link rel="stylesheet" href="../../doc/docs.css">- </head>- <body>- <h1>CodeMirror: YAML mode</h1>- <form><textarea id="code" name="code">++<title>CodeMirror: YAML mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="yaml.js"></script>+<style>.CodeMirror { border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; }</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">YAML</a>+ </ul>+</div>++<article>+<h2>YAML mode</h2>+<form><textarea id="code" name="code">--- # Favorite movies- Casablanca- North by Northwest@@ -64,5 +77,4 @@ specialDelivery: ><p><strong>MIME types defined:</strong> <code>text/x-yaml</code>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/mode/yaml/yaml.js b/data/ext/editorText/codemirror/mode/yaml/yaml.jsindex 7a095b31d..efacd7d56 100644--- a/data/ext/editorText/codemirror/mode/yaml/yaml.js+++ b/data/ext/editorText/codemirror/mode/yaml/yaml.js@@ -26,14 +26,6 @@ CodeMirror.defineMode("yaml", function() {/* array list item */if (stream.match(/\s*-\s+/)) { return 'meta'; }}- /* pairs (associative arrays) -> key */- if (!state.pair && stream.match(/^\s*([a-z0-9\._-])+(?=\s*:)/i)) {- state.pair = true;- state.keyCol = stream.indentation();- return "atom";- }- if (state.pair && stream.match(/^:\s*/)) { state.pairStart = true; return 'meta'; }-/* inline pairs/lists */if (stream.match(/^(\{|\}|\[|\])/)) {if (ch == '{')@@ -74,6 +66,14 @@ CodeMirror.defineMode("yaml", function() {if (stream.match(keywordRegex)) { return 'keyword'; }}+ /* pairs (associative arrays) -> key */+ if (!state.pair && stream.match(/^\s*\S+(?=\s*:($|\s))/i)) {+ state.pair = true;+ state.keyCol = stream.indentation();+ return "atom";+ }+ if (state.pair && stream.match(/^:\s*/)) { state.pairStart = true; return 'meta'; }+/* nothing found, continue */state.pairStart = false;state.escaped = (ch == '\\');diff --git a/data/ext/editorText/codemirror/mode/z80/index.html b/data/ext/editorText/codemirror/mode/z80/index.htmlindex 133c870e3..b63c9621a 100644--- a/data/ext/editorText/codemirror/mode/z80/index.html+++ b/data/ext/editorText/codemirror/mode/z80/index.html@@ -1,16 +1,30 @@<!doctype html>-<html>- <head>- <meta charset="utf-8">- <title>CodeMirror: Z80 assembly mode</title>- <link rel="stylesheet" href="../../lib/codemirror.css">- <script src="../../lib/codemirror.js"></script>- <script src="z80.js"></script>- <link rel="stylesheet" href="../../doc/docs.css">- <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>- </head>- <body>- <h1>CodeMirror: Z80 assembly mode</h1>++<title>CodeMirror: Z80 assembly mode</title>+<meta charset="utf-8"/>+<link rel=stylesheet href="../../doc/docs.css">++<link rel="stylesheet" href="../../lib/codemirror.css">+<script src="../../lib/codemirror.js"></script>+<script src="z80.js"></script>+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>+<div id=nav>+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>++ <ul>+ <li><a href="../../index.html">Home</a>+ <li><a href="../../doc/manual.html">Manual</a>+ <li><a href="https://github.com/marijnh/codemirror">Code</a>+ </ul>+ <ul>+ <li><a href="../index.html">Language modes</a>+ <li><a class=active href="#">Z80 assembly</a>+ </ul>+</div>++<article>+<h2>Z80 assembly mode</h2>+<div><textarea id="code" name="code">#include "ti83plus.inc"@@ -35,5 +49,4 @@ Message:</script><p><strong>MIME type defined:</strong> <code>text/x-z80</code>.</p>- </body>-</html>+ </article>diff --git a/data/ext/editorText/codemirror/theme/3024-day.css b/data/ext/editorText/codemirror/theme/3024-day.cssnew file mode 100644index 000000000..cbb9a4fa4--- /dev/null+++ b/data/ext/editorText/codemirror/theme/3024-day.css@@ -0,0 +1,34 @@+/*++ Name: 3024 day+ Author: Jan T. Sott (http://github.com/idleberg)++ CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror)+ Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16)++*/++.cm-s-3024-day.CodeMirror {background: #f7f7f7; color: #3a3432;}+.cm-s-3024-day div.CodeMirror-selected {background: #d6d5d4 !important;}+.cm-s-3024-day .CodeMirror-gutters {background: #f7f7f7; border-right: 0px;}+.cm-s-3024-day .CodeMirror-linenumber {color: #807d7c;}+.cm-s-3024-day .CodeMirror-cursor {border-left: 1px solid #5c5855 !important;}++.cm-s-3024-day span.cm-comment {color: #cdab53;}+.cm-s-3024-day span.cm-atom {color: #a16a94;}+.cm-s-3024-day span.cm-number {color: #a16a94;}++.cm-s-3024-day span.cm-property, .cm-s-3024-day span.cm-attribute {color: #01a252;}+.cm-s-3024-day span.cm-keyword {color: #db2d20;}+.cm-s-3024-day span.cm-string {color: #fded02;}++.cm-s-3024-day span.cm-variable {color: #01a252;}+.cm-s-3024-day span.cm-variable-2 {color: #01a0e4;}+.cm-s-3024-day span.cm-def {color: #e8bbd0;}+.cm-s-3024-day span.cm-bracket {color: #3a3432;}+.cm-s-3024-day span.cm-tag {color: #db2d20;}+.cm-s-3024-day span.cm-link {color: #a16a94;}+.cm-s-3024-day span.cm-error {background: #db2d20; color: #5c5855;}++.cm-s-3024-day .CodeMirror-activeline-background {background: #e8f2ff !important;}+.cm-s-3024-day .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}diff --git a/data/ext/editorText/codemirror/theme/3024-night.css b/data/ext/editorText/codemirror/theme/3024-night.cssnew file mode 100644index 000000000..2c62e221b--- /dev/null+++ b/data/ext/editorText/codemirror/theme/3024-night.css@@ -0,0 +1,34 @@+/*++ Name: 3024 night+ Author: Jan T. Sott (http://github.com/idleberg)++ CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror)+ Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16)++*/++.cm-s-3024-night.CodeMirror {background: #090300; color: #d6d5d4;}+.cm-s-3024-night div.CodeMirror-selected {background: #3a3432 !important;}+.cm-s-3024-night .CodeMirror-gutters {background: #090300; border-right: 0px;}+.cm-s-3024-night .CodeMirror-linenumber {color: #5c5855;}+.cm-s-3024-night .CodeMirror-cursor {border-left: 1px solid #807d7c !important;}++.cm-s-3024-night span.cm-comment {color: #cdab53;}+.cm-s-3024-night span.cm-atom {color: #a16a94;}+.cm-s-3024-night span.cm-number {color: #a16a94;}++.cm-s-3024-night span.cm-property, .cm-s-3024-night span.cm-attribute {color: #01a252;}+.cm-s-3024-night span.cm-keyword {color: #db2d20;}+.cm-s-3024-night span.cm-string {color: #fded02;}++.cm-s-3024-night span.cm-variable {color: #01a252;}+.cm-s-3024-night span.cm-variable-2 {color: #01a0e4;}+.cm-s-3024-night span.cm-def {color: #e8bbd0;}+.cm-s-3024-night span.cm-bracket {color: #d6d5d4;}+.cm-s-3024-night span.cm-tag {color: #db2d20;}+.cm-s-3024-night span.cm-link {color: #a16a94;}+.cm-s-3024-night span.cm-error {background: #db2d20; color: #807d7c;}++.cm-s-3024-night .CodeMirror-activeline-background {background: #2F2F2F !important;}+.cm-s-3024-night .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}diff --git a/data/ext/editorText/codemirror/theme/ambiance.css b/data/ext/editorText/codemirror/theme/ambiance.cssindex 0185426f0..3a54b2a02 100644--- a/data/ext/editorText/codemirror/theme/ambiance.css+++ b/data/ext/editorText/codemirror/theme/ambiance.css@@ -15,7 +15,6 @@.cm-s-ambiance .cm-string { color: #8f9d6a; }.cm-s-ambiance .cm-string-2 { color: #9d937c; }.cm-s-ambiance .cm-meta { color: #D2A8A1; }-.cm-s-ambiance .cm-error { color: #AF2018; }.cm-s-ambiance .cm-qualifier { color: yellow; }.cm-s-ambiance .cm-builtin { color: #9999cc; }.cm-s-ambiance .cm-bracket { color: #24C2C7; }@@ -26,6 +25,7 @@.cm-s-ambiance .cm-hr { color: pink; }.cm-s-ambiance .cm-link { color: #F4C20B; }.cm-s-ambiance .cm-special { color: #FF9D00; }+.cm-s-ambiance .cm-error { color: #AF2018; }.cm-s-ambiance .CodeMirror-matchingbracket { color: #0f0; }.cm-s-ambiance .CodeMirror-nonmatchingbracket { color: #f22; }@@ -33,7 +33,7 @@.cm-s-ambiance .CodeMirror-selected {background: rgba(255, 255, 255, 0.15);}-.cm-s-ambiance .CodeMirror-focused .CodeMirror-selected {+.cm-s-ambiance.CodeMirror-focused .CodeMirror-selected {background: rgba(255, 255, 255, 0.10);}@@ -65,7 +65,7 @@border-left: 1px solid #7991E8;}-.cm-s-ambiance .activeline {+.cm-s-ambiance .CodeMirror-activeline-background {background: none repeat scroll 0% 0% rgba(255, 255, 255, 0.031);}diff --git a/data/ext/editorText/codemirror/theme/base16-dark.css b/data/ext/editorText/codemirror/theme/base16-dark.cssnew file mode 100644index 000000000..3b7b21c7a--- /dev/null+++ b/data/ext/editorText/codemirror/theme/base16-dark.css@@ -0,0 +1,34 @@+/*++ Name: Base16 Default Dark+ Author: Chris Kempson (http://chriskempson.com)++ CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-chrome-devtools)+ Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16)++*/++.cm-s-base16-dark.CodeMirror {background: #151515; color: #e0e0e0;}+.cm-s-base16-dark div.CodeMirror-selected {background: #202020 !important;}+.cm-s-base16-dark .CodeMirror-gutters {background: #151515; border-right: 0px;}+.cm-s-base16-dark .CodeMirror-linenumber {color: #505050;}+.cm-s-base16-dark .CodeMirror-cursor {border-left: 1px solid #b0b0b0 !important;}++.cm-s-base16-dark span.cm-comment {color: #8f5536;}+.cm-s-base16-dark span.cm-atom {color: #aa759f;}+.cm-s-base16-dark span.cm-number {color: #aa759f;}++.cm-s-base16-dark span.cm-property, .cm-s-base16-dark span.cm-attribute {color: #90a959;}+.cm-s-base16-dark span.cm-keyword {color: #ac4142;}+.cm-s-base16-dark span.cm-string {color: #f4bf75;}++.cm-s-base16-dark span.cm-variable {color: #90a959;}+.cm-s-base16-dark span.cm-variable-2 {color: #6a9fb5;}+.cm-s-base16-dark span.cm-def {color: #d28445;}+.cm-s-base16-dark span.cm-bracket {color: #e0e0e0;}+.cm-s-base16-dark span.cm-tag {color: #ac4142;}+.cm-s-base16-dark span.cm-link {color: #aa759f;}+.cm-s-base16-dark span.cm-error {background: #ac4142; color: #b0b0b0;}++.cm-s-base16-dark .CodeMirror-activeline-background {background: #2F2F2F !important;}+.cm-s-base16-dark .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}diff --git a/data/ext/editorText/codemirror/theme/base16-light.css b/data/ext/editorText/codemirror/theme/base16-light.cssnew file mode 100644index 000000000..5aa4b5389--- /dev/null+++ b/data/ext/editorText/codemirror/theme/base16-light.css@@ -0,0 +1,34 @@+/*++ Name: Base16 Default Light+ Author: Chris Kempson (http://chriskempson.com)++ CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-chrome-devtools)+ Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16)++*/++.cm-s-base16-light.CodeMirror {background: #f5f5f5; color: #202020;}+.cm-s-base16-light div.CodeMirror-selected {background: #e0e0e0 !important;}+.cm-s-base16-light .CodeMirror-gutters {background: #f5f5f5; border-right: 0px;}+.cm-s-base16-light .CodeMirror-linenumber {color: #b0b0b0;}+.cm-s-base16-light .CodeMirror-cursor {border-left: 1px solid #505050 !important;}++.cm-s-base16-light span.cm-comment {color: #8f5536;}+.cm-s-base16-light span.cm-atom {color: #aa759f;}+.cm-s-base16-light span.cm-number {color: #aa759f;}++.cm-s-base16-light span.cm-property, .cm-s-base16-light span.cm-attribute {color: #90a959;}+.cm-s-base16-light span.cm-keyword {color: #ac4142;}+.cm-s-base16-light span.cm-string {color: #f4bf75;}++.cm-s-base16-light span.cm-variable {color: #90a959;}+.cm-s-base16-light span.cm-variable-2 {color: #6a9fb5;}+.cm-s-base16-light span.cm-def {color: #d28445;}+.cm-s-base16-light span.cm-bracket {color: #202020;}+.cm-s-base16-light span.cm-tag {color: #ac4142;}+.cm-s-base16-light span.cm-link {color: #aa759f;}+.cm-s-base16-light span.cm-error {background: #ac4142; color: #505050;}++.cm-s-base16-light .CodeMirror-activeline-background {background: #DDDCDC !important;}+.cm-s-base16-light .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}diff --git a/data/ext/editorText/codemirror/theme/blackboard.css b/data/ext/editorText/codemirror/theme/blackboard.cssindex f2bde690c..8b7608472 100644--- a/data/ext/editorText/codemirror/theme/blackboard.css+++ b/data/ext/editorText/codemirror/theme/blackboard.css@@ -16,10 +16,13 @@.cm-s-blackboard .cm-string { color: #61CE3C; }.cm-s-blackboard .cm-string-2 { color: #61CE3C; }.cm-s-blackboard .cm-meta { color: #D8FA3C; }-.cm-s-blackboard .cm-error { background: #9D1E15; color: #F8F8F8; }.cm-s-blackboard .cm-builtin { color: #8DA6CE; }.cm-s-blackboard .cm-tag { color: #8DA6CE; }.cm-s-blackboard .cm-attribute { color: #8DA6CE; }.cm-s-blackboard .cm-header { color: #FF6400; }.cm-s-blackboard .cm-hr { color: #AEAEAE; }.cm-s-blackboard .cm-link { color: #8DA6CE; }+.cm-s-blackboard .cm-error { background: #9D1E15; color: #F8F8F8; }++.cm-s-blackboard .CodeMirror-activeline-background {background: #3C3636 !important;}+.cm-s-blackboard .CodeMirror-matchingbracket {outline:1px solid grey;color:white !important}\ No newline at end of filediff --git a/data/ext/editorText/codemirror/theme/cobalt.css b/data/ext/editorText/codemirror/theme/cobalt.cssindex 6095799f3..b4a917736 100644--- a/data/ext/editorText/codemirror/theme/cobalt.css+++ b/data/ext/editorText/codemirror/theme/cobalt.css@@ -12,7 +12,10 @@.cm-s-cobalt span.cm-meta { color: #ff9d00; }.cm-s-cobalt span.cm-variable-2, .cm-s-cobalt span.cm-tag { color: #9effff; }.cm-s-cobalt span.cm-variable-3, .cm-s-cobalt span.cm-def { color: white; }-.cm-s-cobalt span.cm-error { color: #9d1e15; }.cm-s-cobalt span.cm-bracket { color: #d8d8d8; }.cm-s-cobalt span.cm-builtin, .cm-s-cobalt span.cm-special { color: #ff9e59; }.cm-s-cobalt span.cm-link { color: #845dc4; }+.cm-s-cobalt span.cm-error { color: #9d1e15; }++.cm-s-cobalt .CodeMirror-activeline-background {background: #002D57 !important;}+.cm-s-cobalt .CodeMirror-matchingbracket {outline:1px solid grey;color:white !important}diff --git a/data/ext/editorText/codemirror/theme/eclipse.css b/data/ext/editorText/codemirror/theme/eclipse.cssindex 4137bbe26..317218e3d 100644--- a/data/ext/editorText/codemirror/theme/eclipse.css+++ b/data/ext/editorText/codemirror/theme/eclipse.css@@ -11,15 +11,13 @@.cm-s-eclipse span.cm-comment {color: #3F7F5F;}.cm-s-eclipse span.cm-string {color: #2A00FF;}.cm-s-eclipse span.cm-string-2 {color: #f50;}-.cm-s-eclipse span.cm-error {color: #f00;}.cm-s-eclipse span.cm-qualifier {color: #555;}.cm-s-eclipse span.cm-builtin {color: #30a;}.cm-s-eclipse span.cm-bracket {color: #cc7;}.cm-s-eclipse span.cm-tag {color: #170;}.cm-s-eclipse span.cm-attribute {color: #00c;}.cm-s-eclipse span.cm-link {color: #219;}+.cm-s-eclipse span.cm-error {color: #f00;}-.cm-s-eclipse .CodeMirror-matchingbracket {- outline:1px solid grey;- color:black !important;-}+.cm-s-eclipse .CodeMirror-activeline-background {background: #e8f2ff !important;}+.cm-s-eclipse .CodeMirror-matchingbracket {outline:1px solid grey; color:black !important;}diff --git a/data/ext/editorText/codemirror/theme/elegant.css b/data/ext/editorText/codemirror/theme/elegant.cssindex d0ce0cb56..dd7df7b73 100644--- a/data/ext/editorText/codemirror/theme/elegant.css+++ b/data/ext/editorText/codemirror/theme/elegant.css@@ -6,5 +6,8 @@.cm-s-elegant span.cm-qualifier {color: #555;}.cm-s-elegant span.cm-keyword {color: #730;}.cm-s-elegant span.cm-builtin {color: #30a;}-.cm-s-elegant span.cm-error {background-color: #fdd;}.cm-s-elegant span.cm-link {color: #762;}+.cm-s-elegant span.cm-error {background-color: #fdd;}++.cm-s-elegant .CodeMirror-activeline-background {background: #e8f2ff !important;}+.cm-s-elegant .CodeMirror-matchingbracket {outline:1px solid grey; color:black !important;}diff --git a/data/ext/editorText/codemirror/theme/erlang-dark.css b/data/ext/editorText/codemirror/theme/erlang-dark.cssindex cf5bf2bd6..db56b1084 100644--- a/data/ext/editorText/codemirror/theme/erlang-dark.css+++ b/data/ext/editorText/codemirror/theme/erlang-dark.css@@ -4,18 +4,27 @@.cm-s-erlang-dark .CodeMirror-linenumber { color: #d0d0d0; }.cm-s-erlang-dark .CodeMirror-cursor { border-left: 1px solid white !important; }-.cm-s-erlang-dark span.cm-atom { color: #845dc4; }+.cm-s-erlang-dark span.cm-atom { color: #f133f1; }.cm-s-erlang-dark span.cm-attribute { color: #ff80e1; }.cm-s-erlang-dark span.cm-bracket { color: #ff9d00; }.cm-s-erlang-dark span.cm-builtin { color: #eaa; }.cm-s-erlang-dark span.cm-comment { color: #77f; }.cm-s-erlang-dark span.cm-def { color: #e7a; }-.cm-s-erlang-dark span.cm-error { color: #9d1e15; }.cm-s-erlang-dark span.cm-keyword { color: #ffee80; }.cm-s-erlang-dark span.cm-meta { color: #50fefe; }.cm-s-erlang-dark span.cm-number { color: #ffd0d0; }-.cm-s-erlang-dark span.cm-operator { color: #d11; }+.cm-s-erlang-dark span.cm-operator { color: #d55; }+.cm-s-erlang-dark span.cm-property { color: #ccc; }+.cm-s-erlang-dark span.cm-qualifier { color: #ccc; }+.cm-s-erlang-dark span.cm-quote { color: #ccc; }+.cm-s-erlang-dark span.cm-special { color: #ffbbbb; }.cm-s-erlang-dark span.cm-string { color: #3ad900; }+.cm-s-erlang-dark span.cm-string-2 { color: #ccc; }.cm-s-erlang-dark span.cm-tag { color: #9effff; }.cm-s-erlang-dark span.cm-variable { color: #50fe50; }.cm-s-erlang-dark span.cm-variable-2 { color: #e0e; }+.cm-s-erlang-dark span.cm-variable-3 { color: #ccc; }+.cm-s-erlang-dark span.cm-error { color: #9d1e15; }++.cm-s-erlang-dark .CodeMirror-activeline-background {background: #013461 !important;}+.cm-s-erlang-dark .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;}diff --git a/data/ext/editorText/codemirror/theme/lesser-dark.css b/data/ext/editorText/codemirror/theme/lesser-dark.cssindex 67f71ad72..c32559663 100644--- a/data/ext/editorText/codemirror/theme/lesser-dark.css+++ b/data/ext/editorText/codemirror/theme/lesser-dark.css@@ -14,7 +14,7 @@ Ported to CodeMirror by Peter Kroon.cm-s-lesser-dark .CodeMirror-cursor { border-left: 1px solid white !important; }.cm-s-lesser-dark pre { padding: 0 8px; }/*editable code holder*/-div.CodeMirror span.CodeMirror-matchingbracket { color: #7EFC7E; }/*65FC65*/+.cm-s-lesser-dark.CodeMirror span.CodeMirror-matchingbracket { color: #7EFC7E; }/*65FC65*/.cm-s-lesser-dark .CodeMirror-gutters { background: #262626; border-right:1px solid #aaa; }.cm-s-lesser-dark .CodeMirror-linenumber { color: #777; }@@ -32,7 +32,6 @@ div.CodeMirror span.CodeMirror-matchingbracket { color: #7EFC7E; }/*65FC65*/.cm-s-lesser-dark span.cm-string { color: #BCD279; }.cm-s-lesser-dark span.cm-string-2 {color: #f50;}.cm-s-lesser-dark span.cm-meta { color: #738C73; }-.cm-s-lesser-dark span.cm-error { color: #9d1e15; }.cm-s-lesser-dark span.cm-qualifier {color: #555;}.cm-s-lesser-dark span.cm-builtin { color: #ff9e59; }.cm-s-lesser-dark span.cm-bracket { color: #EBEFE7; }@@ -42,3 +41,7 @@ div.CodeMirror span.CodeMirror-matchingbracket { color: #7EFC7E; }/*65FC65*/.cm-s-lesser-dark span.cm-quote {color: #090;}.cm-s-lesser-dark span.cm-hr {color: #999;}.cm-s-lesser-dark span.cm-link {color: #00c;}+.cm-s-lesser-dark span.cm-error { color: #9d1e15; }++.cm-s-lesser-dark .CodeMirror-activeline-background {background: #3C3A3A !important;}+.cm-s-lesser-dark .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;}diff --git a/data/ext/editorText/codemirror/theme/mbo.css b/data/ext/editorText/codemirror/theme/mbo.cssnew file mode 100644index 000000000..bb52e6d17--- /dev/null+++ b/data/ext/editorText/codemirror/theme/mbo.css@@ -0,0 +1,37 @@+/* Based on mbonaci's Brackets mbo theme */++.cm-s-mbo.CodeMirror {background: #2c2c2c; color: #ffffe9;}+.cm-s-mbo div.CodeMirror-selected {background: #716C62 !important;}+.cm-s-mbo .CodeMirror-gutters {background: #4e4e4e; border-right: 0px;}+.cm-s-mbo .CodeMirror-linenumber {color: #dadada;}+.cm-s-mbo .CodeMirror-cursor {border-left: 1px solid #ffffec !important;}++.cm-s-mbo span.cm-comment {color: #95958a;}+.cm-s-mbo span.cm-atom {color: #00a8c6;}+.cm-s-mbo span.cm-number {color: #00a8c6;}++.cm-s-mbo span.cm-property, .cm-s-mbo span.cm-attribute {color: #9ddfe9;}+.cm-s-mbo span.cm-keyword {color: #ffb928;}+.cm-s-mbo span.cm-string {color: #ffcf6c;}++.cm-s-mbo span.cm-variable {color: #ffffec;}+.cm-s-mbo span.cm-variable-2 {color: #00a8c6;}+.cm-s-mbo span.cm-def {color: #ffffec;}+.cm-s-mbo span.cm-bracket {color: #fffffc; font-weight: bold;}+.cm-s-mbo span.cm-tag {color: #9ddfe9;}+.cm-s-mbo span.cm-link {color: #f54b07;}+.cm-s-mbo span.cm-error {background: #636363; color: #ffffec;}++.cm-s-mbo .CodeMirror-activeline-background {background: #494b41 !important;}+.cm-s-mbo .CodeMirror-matchingbracket {+ text-decoration: underline;+ color: #f5e107 !important;+ }++.cm-s-mbo .CodeMirror-matchingtag {background: #4e4e4e;}++.cm-s-mbo span.cm-searching {+ background-color: none;+ background: none;+ box-shadow: 0 0 0 1px #ffffec;+}diff --git a/data/ext/editorText/codemirror/theme/mdn-like.css b/data/ext/editorText/codemirror/theme/mdn-like.cssnew file mode 100644index 000000000..c12cb1f94--- /dev/null+++ b/data/ext/editorText/codemirror/theme/mdn-like.css@@ -0,0 +1,44 @@+/*+ MDN-LIKE Theme - Mozilla+ Ported to CodeMirror by Peter Kroon <[email protected]>+ Report bugs/issues here: https://github.com/marijnh/CodeMirror/issues+ GitHub: @peterkroon++ The mdn-like theme is inspired on the displayed code examples at: https://developer.mozilla.org/en-US/docs/Web/CSS/animation++*/+.cm-s-mdn-like.CodeMirror { color: #999; font-family: monospace; background-color: #fff; }+.cm-s-mdn-like .CodeMirror-selected { background: #cfc !important; }++.cm-s-mdn-like .CodeMirror-gutters { background: #f8f8f8; border-left: 6px solid rgba(0,83,159,0.65); color: #333; }+.cm-s-mdn-like .CodeMirror-linenumber { color: #aaa; margin-left: 3px; }+div.cm-s-mdn-like .CodeMirror-cursor { border-left: 2px solid #222; }++.cm-s-mdn-like .cm-keyword { color: #6262FF; }+.cm-s-mdn-like .cm-atom { color: #F90; }+.cm-s-mdn-like .cm-number { color: #ca7841; }+.cm-s-mdn-like .cm-def { color: #8DA6CE; }+.cm-s-mdn-like span.cm-variable-2, .cm-s-mdn-like span.cm-tag { color: #690; }+.cm-s-mdn-like span.cm-variable-3, .cm-s-mdn-like span.cm-def { color: #07a; }++.cm-s-mdn-like .cm-variable { color: #07a; }+.cm-s-mdn-like .cm-property { color: #905; }+.cm-s-mdn-like .cm-qualifier { color: #690; }++.cm-s-mdn-like .cm-operator { color: #cda869; }+.cm-s-mdn-like .cm-comment { color:#777; font-weight:normal; }+.cm-s-mdn-like .cm-string { color:#07a; font-style:italic; }+.cm-s-mdn-like .cm-string-2 { color:#bd6b18; } /*?*/+.cm-s-mdn-like .cm-meta { color: #000; } /*?*/+.cm-s-mdn-like .cm-builtin { color: #9B7536; } /*?*/+.cm-s-mdn-like .cm-tag { color: #997643; }+.cm-s-mdn-like .cm-attribute { color: #d6bb6d; } /*?*/+.cm-s-mdn-like .cm-header { color: #FF6400; }+.cm-s-mdn-like .cm-hr { color: #AEAEAE; }+.cm-s-mdn-like .cm-link { color:#ad9361; font-style:italic; text-decoration:none; }+.cm-s-mdn-like .cm-error { border-bottom: 1px solid red; }++div.cm-s-mdn-like .CodeMirror-activeline-background {background: #efefff;}+div.cm-s-mdn-like span.CodeMirror-matchingbracket {outline:1px solid grey; color: inherit;}++.cm-s-mdn-like.CodeMirror { background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFcAAAAyCAYAAAAp8UeFAAAHvklEQVR42s2b63bcNgyEQZCSHCdt2vd/0tWF7I+Q6XgMXiTtuvU5Pl57ZQKkKHzEAOtF5KeIJBGJ8uvL599FRFREZhFx8DeXv8trn68RuGaC8TRfo3SNp9dlDDHedyLyTUTeRWStXKPZrjtpZxaRw5hPqozRs1N8/enzIiQRWcCgy4MUA0f+XWliDhyL8Lfyvx7ei/Ae3iQFHyw7U/59pQVIMEEPEz0G7XiwdRjzSfC3UTtz9vchIntxvry5iMgfIhJoEflOz2CQr3F5h/HfeFe+GTdLaKcu9L8LTeQb/R/7GgbsfKedyNdoHsN31uRPWrfZ5wsj/NzzRQHuToIdU3ahwnsKPxXCjJITuOsi7XLc7SG/v5GdALs7wf8JjTFiB5+QvTEfRyGOfX3Lrx8wxyQi3sNq46O7QahQiCsRFgqddjBouVEHOKDgXAQHD9gJCr5sMKkEdjwsarG/ww3BMHBU7OBjXnzdyY7SfCxf5/z6ATccrwlKuwC/jhznnPF4CgVzhhVf4xp2EixcBActO75iZ8/fM9zAs2OMzKdslgXWJ9XG8PQoOAMA5fGcsvORgv0doBXyHrCwfLJAOwo71QLNkb8n2Pl6EWiR7OCibtkPaz4Kc/0NNAze2gju3zOwekALDaCFPI5vjPFmgGY5AZqyGEvH1x7QfIb8YtxMnA/b+QQ0aQDAwc6JMFg8CbQZ4qoYEEHbRwNojuK3EHwd7VALSgq+MNDKzfT58T8qdpADrgW0GmgcAS1lhzztJmkAzcPNOQbsWEALBDSlMKUG0Eq4CLAQWvEVQ9WU57gZJwZtgPO3r9oBTQ9WO8TjqXINx8R0EYpiZEUWOF3FxkbJkgU9B2f41YBrIj5ZfsQa0M5kTgiAAqM3ShXLgu8XMqcrQBvJ0CL5pnTsfMB13oB8athpAq2XOQmcGmoACCLydx7nToa23ATaSIY2ichfOdPTGxlasXMLaL0MLZAOwAKIM+y8CmicobGdCcbbK9DzN+yYGVoNNI5iUKTMyYOjPse4A8SM1MmcXgU0toOq1yO/v8FOxlASyc7TgeYaAMBJHcY1CcCwGI/TK4AmDbDyKYBBtFUkRwto8gygiQEaByFgJ00BH2M8JWwQS1nafDXQCidWyOI8AcjDCSjCLk8ngObuAm3JAHAdubAmOaK06V8MNEsKPJOhobSprwQa6gD7DclRQdqcwL4zxqgBrQcabUiBLclRDKAlWp+etPkBaNMA0AKlrHwTdEByZAA4GM+SNluSY6wAzcMNewxmgig5Ks0nkrSpBvSaQHMdKTBAnLojOdYyGpQ254602ZILPdTD1hdlggdIm74jbTp8vDwF5ZYUeLWGJpWsh6XNyXgcYwVoJQTEhhTYkxzZjiU5npU2TaB979TQehlaAVq4kaGpiPwwwLkYUuBbQwocyQTv1tA0+1UFWoJF3iv1oq+qoSk8EQdJmwHkziIF7oOZk14EGitibAdjLYYK78H5vZOhtWpoI0ATGHs0Q8OMb4Ey+2bU2UYztCtA0wFAs7TplGLRVQCcqaFdGSPCeTI1QNIC52iWNzof6Uib7xjEp07mNNoUYmVosVItHrHzRlLgBn9LFyRHaQCtVUMbtTNhoXWiTOO9k/V8BdAc1Oq0ArSQs6/5SU0hckNy9NnXqQY0PGYo5dWJ7nINaN6o958FWin27aBaWRka1r5myvLOAm0j30eBJqCxHLReVclxhxOEN2JfDWjxBtAC7MIH1fVaGdoOp4qJYDgKtKPSFNID2gSnGldrCqkFZ+5UeQXQBIRrSwocbdZYQT/2LwRahBPBXoHrB8nxaGROST62DKUbQOMMzZIC9abkuELfQzQALWTnDNAm8KHWFOJgJ5+SHIvTPcmx1xQyZRhNL5Qci689aXMEaN/uNIWkEwDAvFpOZmgsBaaGnbs1NPa1Jm32gBZAIh1pCtG7TSH4aE0y1uVY4uqoFPisGlpP2rSA5qTecWn5agK6BzSpgAyD+wFaqhnYoSZ1Vwr8CmlTQbrcO3ZaX0NAEyMbYaAlyquFoLKK3SPby9CeVUPThrSJmkCAE0CrKUQadi4DrdSlWhmah0YL9z9vClH59YGbHx1J8VZTyAjQepJjmXwAKTDQI3omc3p1U4gDUf6RfcdYfrUp5ClAi2J3Ba6UOXGo+K+bQrjjssitG2SJzshaLwMtXgRagUNpYYoVkMSBLM+9GGiJZMvduG6DRZ4qc04DMPtQQxOjEtACmhO7K1AbNbQDEggZyJwscFpAGwENhoBeUwh3bWolhe8BTYVKxQEWrSUn/uhcM5KhvUu/+eQu0Lzhi+VrK0PrZZNDQKs9cpYUuFYgMVpD4/NxenJTiMCNqdUEUf1qZWjppLT5qSkkUZbCwkbZMSuVnu80hfSkzRbQeqCZSAh6huR4VtoM2gHAlLf72smuWgE+VV7XpE25Ab2WFDgyhnSuKbs4GuGzCjR+tIoUuMFg3kgcWKLTwRqanJQ2W00hAsenfaApRC42hbCvK1SlE0HtE9BGgneJO+ELamitD1YjjOYnNYVcraGhtKkW0EqVVeDx733I2NH581k1NNxNLG0i0IJ8/NjVaOZ0tYZ2Vtr0Xv7tPV3hkWp9EFkgS/J0vosngTaSoaG06WHi+xObQkaAdlbanP8B2+2l0f90LmUAAAAASUVORK5CYII=); }diff --git a/data/ext/editorText/codemirror/theme/midnight.css b/data/ext/editorText/codemirror/theme/midnight.cssindex e567625c6..468d87daf 100644--- a/data/ext/editorText/codemirror/theme/midnight.css+++ b/data/ext/editorText/codemirror/theme/midnight.css@@ -1,22 +1,18 @@/* Based on the theme at http://bonsaiden.github.com/JavaScript-Garden */-/*<!--breakpoint-->*/-.breakpoints {width: .8em;}-.breakpoint { color: #822; }-/*<!--match-->*/-span.CodeMirror-matchhighlight { background: #494949 }-.CodeMirror-focused span.CodeMirror-matchhighlight { background: #314D67; !important }+.cm-s-midnight span.CodeMirror-matchhighlight { background: #494949; }+.cm-s-midnight.CodeMirror-focused span.CodeMirror-matchhighlight { background: #314D67 !important; }/*<!--activeline-->*/-.activeline {background: #253540 !important;}+.cm-s-midnight .CodeMirror-activeline-background {background: #253540 !important;}.cm-s-midnight.CodeMirror {background: #0F192A;color: #D1EDFF;}-.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}+.cm-s-midnight.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}.cm-s-midnight div.CodeMirror-selected {background: #314D67 !important;}.cm-s-midnight .CodeMirror-gutters {background: #0F192A; border-right: 1px solid;}@@ -29,24 +25,19 @@ span.CodeMirror-matchhighlight { background: #494949 }.cm-s-midnight span.cm-atom {color: #AE81FF;}.cm-s-midnight span.cm-number {color: #D1EDFF;}-.cm-s-midnight span.cm-property, .cm-s-tropicaleve span.cm-attribute {color: #A6E22E;}+.cm-s-midnight span.cm-property, .cm-s-midnight span.cm-attribute {color: #A6E22E;}.cm-s-midnight span.cm-keyword {color: #E83737;}.cm-s-midnight span.cm-string {color: #1DC116;}.cm-s-midnight span.cm-variable {color: #FFAA3E;}.cm-s-midnight span.cm-variable-2 {color: #FFAA3E;}.cm-s-midnight span.cm-def {color: #4DD;}-.cm-s-midnight span.cm-error {background: #F92672; color: #F8F8F0;}.cm-s-midnight span.cm-bracket {color: #D1EDFF;}-.cm-s-midnight span.cm-tag {color: #008;}+.cm-s-midnight span.cm-tag {color: #449;}.cm-s-midnight span.cm-link {color: #AE81FF;}+.cm-s-midnight span.cm-error {background: #F92672; color: #F8F8F0;}.cm-s-midnight .CodeMirror-matchingbracket {text-decoration: underline;color: white !important;}--.typ { color: #FFAA3E; }-.atn { color: #606; }-.atv { color: #080; }-.dec { color: #606; }diff --git a/data/ext/editorText/codemirror/theme/monokai.css b/data/ext/editorText/codemirror/theme/monokai.cssindex a0b3c7c0a..7ac601a13 100644--- a/data/ext/editorText/codemirror/theme/monokai.css+++ b/data/ext/editorText/codemirror/theme/monokai.css@@ -17,11 +17,12 @@.cm-s-monokai span.cm-variable {color: #a6e22e;}.cm-s-monokai span.cm-variable-2 {color: #9effff;}.cm-s-monokai span.cm-def {color: #fd971f;}-.cm-s-monokai span.cm-error {background: #f92672; color: #f8f8f0;}.cm-s-monokai span.cm-bracket {color: #f8f8f2;}.cm-s-monokai span.cm-tag {color: #f92672;}.cm-s-monokai span.cm-link {color: #ae81ff;}+.cm-s-monokai span.cm-error {background: #f92672; color: #f8f8f0;}+.cm-s-monokai .CodeMirror-activeline-background {background: #373831 !important;}.cm-s-monokai .CodeMirror-matchingbracket {text-decoration: underline;color: white !important;diff --git a/data/ext/editorText/codemirror/theme/neat.css b/data/ext/editorText/codemirror/theme/neat.cssindex 8a307f802..115083b81 100644--- a/data/ext/editorText/codemirror/theme/neat.css+++ b/data/ext/editorText/codemirror/theme/neat.css@@ -7,3 +7,6 @@.cm-s-neat span.cm-number, .cm-s-neat span.cm-atom { color: #3a3; }.cm-s-neat span.cm-meta {color: #555;}.cm-s-neat span.cm-link { color: #3a3; }++.cm-s-neat .CodeMirror-activeline-background {background: #e8f2ff !important;}+.cm-s-neat .CodeMirror-matchingbracket {outline:1px solid grey; color:black !important;}diff --git a/data/ext/editorText/codemirror/theme/night.css b/data/ext/editorText/codemirror/theme/night.cssindex 8804a399a..016e55ee7 100644--- a/data/ext/editorText/codemirror/theme/night.css+++ b/data/ext/editorText/codemirror/theme/night.css@@ -14,8 +14,11 @@.cm-s-night span.cm-meta { color: #7678e2; }.cm-s-night span.cm-variable-2, .cm-s-night span.cm-tag { color: #99b2ff; }.cm-s-night span.cm-variable-3, .cm-s-night span.cm-def { color: white; }-.cm-s-night span.cm-error { color: #9d1e15; }.cm-s-night span.cm-bracket { color: #8da6ce; }.cm-s-night span.cm-comment { color: #6900a1; }.cm-s-night span.cm-builtin, .cm-s-night span.cm-special { color: #ff9e59; }.cm-s-night span.cm-link { color: #845dc4; }+.cm-s-night span.cm-error { color: #9d1e15; }++.cm-s-night .CodeMirror-activeline-background {background: #1C005A !important;}+.cm-s-night .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;}diff --git a/data/ext/editorText/codemirror/theme/paraiso-dark.css b/data/ext/editorText/codemirror/theme/paraiso-dark.cssnew file mode 100644index 000000000..ddefc55d2--- /dev/null+++ b/data/ext/editorText/codemirror/theme/paraiso-dark.css@@ -0,0 +1,34 @@+/*++ Name: Paraíso (Dark)+ Author: Jan T. Sott++ Color scheme by Jan T. Sott (https://github.com/idleberg/Paraiso-CodeMirror)+ Inspired by the art of Rubens LP (http://www.rubenslp.com.br)++*/++.cm-s-paraiso-dark.CodeMirror {background: #2f1e2e; color: #b9b6b0;}+.cm-s-paraiso-dark div.CodeMirror-selected {background: #41323f !important;}+.cm-s-paraiso-dark .CodeMirror-gutters {background: #2f1e2e; border-right: 0px;}+.cm-s-paraiso-dark .CodeMirror-linenumber {color: #776e71;}+.cm-s-paraiso-dark .CodeMirror-cursor {border-left: 1px solid #8d8687 !important;}++.cm-s-paraiso-dark span.cm-comment {color: #e96ba8;}+.cm-s-paraiso-dark span.cm-atom {color: #815ba4;}+.cm-s-paraiso-dark span.cm-number {color: #815ba4;}++.cm-s-paraiso-dark span.cm-property, .cm-s-paraiso-dark span.cm-attribute {color: #48b685;}+.cm-s-paraiso-dark span.cm-keyword {color: #ef6155;}+.cm-s-paraiso-dark span.cm-string {color: #fec418;}++.cm-s-paraiso-dark span.cm-variable {color: #48b685;}+.cm-s-paraiso-dark span.cm-variable-2 {color: #06b6ef;}+.cm-s-paraiso-dark span.cm-def {color: #f99b15;}+.cm-s-paraiso-dark span.cm-bracket {color: #b9b6b0;}+.cm-s-paraiso-dark span.cm-tag {color: #ef6155;}+.cm-s-paraiso-dark span.cm-link {color: #815ba4;}+.cm-s-paraiso-dark span.cm-error {background: #ef6155; color: #8d8687;}++.cm-s-paraiso-dark .CodeMirror-activeline-background {background: #4D344A !important;}+.cm-s-paraiso-dark .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}diff --git a/data/ext/editorText/codemirror/theme/paraiso-light.css b/data/ext/editorText/codemirror/theme/paraiso-light.cssnew file mode 100644index 000000000..8afb14be4--- /dev/null+++ b/data/ext/editorText/codemirror/theme/paraiso-light.css@@ -0,0 +1,34 @@+/*++ Name: Paraíso (Light)+ Author: Jan T. Sott++ Color scheme by Jan T. Sott (https://github.com/idleberg/Paraiso-CodeMirror)+ Inspired by the art of Rubens LP (http://www.rubenslp.com.br)++*/++.cm-s-paraiso-light.CodeMirror {background: #e7e9db; color: #41323f;}+.cm-s-paraiso-light div.CodeMirror-selected {background: #b9b6b0 !important;}+.cm-s-paraiso-light .CodeMirror-gutters {background: #e7e9db; border-right: 0px;}+.cm-s-paraiso-light .CodeMirror-linenumber {color: #8d8687;}+.cm-s-paraiso-light .CodeMirror-cursor {border-left: 1px solid #776e71 !important;}++.cm-s-paraiso-light span.cm-comment {color: #e96ba8;}+.cm-s-paraiso-light span.cm-atom {color: #815ba4;}+.cm-s-paraiso-light span.cm-number {color: #815ba4;}++.cm-s-paraiso-light span.cm-property, .cm-s-paraiso-light span.cm-attribute {color: #48b685;}+.cm-s-paraiso-light span.cm-keyword {color: #ef6155;}+.cm-s-paraiso-light span.cm-string {color: #fec418;}++.cm-s-paraiso-light span.cm-variable {color: #48b685;}+.cm-s-paraiso-light span.cm-variable-2 {color: #06b6ef;}+.cm-s-paraiso-light span.cm-def {color: #f99b15;}+.cm-s-paraiso-light span.cm-bracket {color: #41323f;}+.cm-s-paraiso-light span.cm-tag {color: #ef6155;}+.cm-s-paraiso-light span.cm-link {color: #815ba4;}+.cm-s-paraiso-light span.cm-error {background: #ef6155; color: #776e71;}++.cm-s-paraiso-light .CodeMirror-activeline-background {background: #CFD1C4 !important;}+.cm-s-paraiso-light .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}diff --git a/data/ext/editorText/codemirror/theme/pastel-on-dark.css b/data/ext/editorText/codemirror/theme/pastel-on-dark.cssnew file mode 100644index 000000000..df95699a0--- /dev/null+++ b/data/ext/editorText/codemirror/theme/pastel-on-dark.css@@ -0,0 +1,49 @@+/**+ * Pastel On Dark theme ported from ACE editor+ * @license MIT+ * @copyright AtomicPages LLC 2014+ * @author Dennis Thompson, AtomicPages LLC+ * @version 1.1+ * @source https://github.com/atomicpages/codemirror-pastel-on-dark-theme+ */++.cm-s-pastel-on-dark.CodeMirror {+ background: #2c2827;+ color: #8F938F;+ line-height: 1.5;+ font-family: consolas, Courier, monospace;+ font-size: 14px;+}+.cm-s-pastel-on-dark div.CodeMirror-selected { background: rgba(221,240,255,0.2) !important; }+.cm-s-pastel-on-dark .CodeMirror-gutters {+ background: #34302f;+ border-right: 0px;+ padding: 0 3px;+}+.cm-s-pastel-on-dark .CodeMirror-linenumber { color: #8F938F; }+.cm-s-pastel-on-dark .CodeMirror-cursor { border-left: 1px solid #A7A7A7 !important; }+.cm-s-pastel-on-dark span.cm-comment { color: #A6C6FF; }+.cm-s-pastel-on-dark span.cm-atom { color: #DE8E30; }+.cm-s-pastel-on-dark span.cm-number { color: #CCCCCC; }+.cm-s-pastel-on-dark span.cm-property { color: #8F938F; }+.cm-s-pastel-on-dark span.cm-attribute { color: #a6e22e; }+.cm-s-pastel-on-dark span.cm-keyword { color: #AEB2F8; }+.cm-s-pastel-on-dark span.cm-string { color: #66A968; }+.cm-s-pastel-on-dark span.cm-variable { color: #AEB2F8; }+.cm-s-pastel-on-dark span.cm-variable-2 { color: #BEBF55; }+.cm-s-pastel-on-dark span.cm-variable-3 { color: #DE8E30; }+.cm-s-pastel-on-dark span.cm-def { color: #757aD8; }+.cm-s-pastel-on-dark span.cm-bracket { color: #f8f8f2; }+.cm-s-pastel-on-dark span.cm-tag { color: #C1C144; }+.cm-s-pastel-on-dark span.cm-link { color: #ae81ff; }+.cm-s-pastel-on-dark span.cm-qualifier,.cm-s-pastel-on-dark span.cm-builtin { color: #C1C144; }+.cm-s-pastel-on-dark span.cm-error {+ background: #757aD8;+ color: #f8f8f0;+}+.cm-s-pastel-on-dark .CodeMirror-activeline-background { background: rgba(255, 255, 255, 0.031) !important; }+.cm-s-pastel-on-dark .CodeMirror-matchingbracket {+ border: 1px solid rgba(255,255,255,0.25);+ color: #8F938F !important;+ margin: -1px -1px 0 -1px;+}diff --git a/data/ext/editorText/codemirror/theme/rubyblue.css b/data/ext/editorText/codemirror/theme/rubyblue.cssindex 23c0cc74e..b556139d7 100644--- a/data/ext/editorText/codemirror/theme/rubyblue.css+++ b/data/ext/editorText/codemirror/theme/rubyblue.css@@ -14,8 +14,10 @@.cm-s-rubyblue span.cm-meta { color: #F0F; }.cm-s-rubyblue span.cm-variable-2, .cm-s-rubyblue span.cm-tag { color: #7BD827; }.cm-s-rubyblue span.cm-variable-3, .cm-s-rubyblue span.cm-def { color: white; }-.cm-s-rubyblue span.cm-error { color: #AF2018; }.cm-s-rubyblue span.cm-bracket { color: #F0F; }.cm-s-rubyblue span.cm-link { color: #F4C20B; }.cm-s-rubyblue span.CodeMirror-matchingbracket { color:#F0F !important; }.cm-s-rubyblue span.cm-builtin, .cm-s-rubyblue span.cm-special { color: #FF9D00; }+.cm-s-rubyblue span.cm-error { color: #AF2018; }++.cm-s-rubyblue .CodeMirror-activeline-background {background: #173047 !important;}diff --git a/data/ext/editorText/codemirror/theme/solarized.css b/data/ext/editorText/codemirror/theme/solarized.cssindex 06a6c7fa1..9c2e91483 100644--- a/data/ext/editorText/codemirror/theme/solarized.css+++ b/data/ext/editorText/codemirror/theme/solarized.css@@ -67,11 +67,6 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png.cm-s-solarized .cm-string-2 { color: #b58900; }.cm-s-solarized .cm-meta { color: #859900; }-.cm-s-solarized .cm-error,-.cm-s-solarized .cm-invalidchar {- color: #586e75;- border-bottom: 1px dotted #dc322f;-}.cm-s-solarized .cm-qualifier { color: #b58900; }.cm-s-solarized .cm-builtin { color: #d33682; }.cm-s-solarized .cm-bracket { color: #cb4b16; }@@ -97,38 +92,22 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png.cm-s-solarized .cm-tab:before {content: "➤"; /*visualize tab character*/color: #586e75;+ position:absolute;}--.cm-s-solarized.cm-s-dark .CodeMirror-focused .CodeMirror-selected {- background: #386774;- color: inherit;-}--.cm-s-solarized.cm-s-dark ::selection {- background: #386774;- color: inherit;+.cm-s-solarized .cm-error,+.cm-s-solarized .cm-invalidchar {+ color: #586e75;+ border-bottom: 1px dotted #dc322f;}.cm-s-solarized.cm-s-dark .CodeMirror-selected {- background: #586e75;-}--.cm-s-solarized.cm-s-light .CodeMirror-focused .CodeMirror-selected {- background: #eee8d5;- color: inherit;-}--.cm-s-solarized.cm-s-light ::selection {- background: #eee8d5;- color: inherit;+ background: #073642;}.cm-s-solarized.cm-s-light .CodeMirror-selected {- background: #93a1a1;+ background: #eee8d5;}--/* Editor styling */@@ -186,16 +165,11 @@ http://ethanschoonover.com/solarized/img/solarized-palette.pngActive line. Negative margin compensates left padding of the text in theview-port*/-.cm-s-solarized .activeline {- margin-left: -20px;-}--.cm-s-solarized.cm-s-dark .activeline {- background: rgba(255, 255, 255, 0.05);-+.cm-s-solarized.cm-s-dark .CodeMirror-activeline-background {+ background: rgba(255, 255, 255, 0.10);}-.cm-s-solarized.cm-s-light .activeline {- background: rgba(0, 0, 0, 0.05);+.cm-s-solarized.cm-s-light .CodeMirror-activeline-background {+ background: rgba(0, 0, 0, 0.10);}/*diff --git a/data/ext/editorText/codemirror/theme/the-matrix.css b/data/ext/editorText/codemirror/theme/the-matrix.cssnew file mode 100644index 000000000..0c3704a62--- /dev/null+++ b/data/ext/editorText/codemirror/theme/the-matrix.css@@ -0,0 +1,26 @@+.cm-s-the-matrix.CodeMirror { background: #000000; color: #00FF00; }+.cm-s-the-matrix div.CodeMirror-selected { background: #2D2D2D !important; }+.cm-s-the-matrix .CodeMirror-gutters { background: #060; border-right: 2px solid #00FF00; }+.cm-s-the-matrix .CodeMirror-linenumber { color: #FFFFFF; }+.cm-s-the-matrix .CodeMirror-cursor { border-left: 1px solid #00FF00 !important; }++.cm-s-the-matrix span.cm-keyword {color: #008803; font-weight: bold;}+.cm-s-the-matrix span.cm-atom {color: #3FF;}+.cm-s-the-matrix span.cm-number {color: #FFB94F;}+.cm-s-the-matrix span.cm-def {color: #99C;}+.cm-s-the-matrix span.cm-variable {color: #F6C;}+.cm-s-the-matrix span.cm-variable-2 {color: #C6F;}+.cm-s-the-matrix span.cm-variable-3 {color: #96F;}+.cm-s-the-matrix span.cm-property {color: #62FFA0;}+.cm-s-the-matrix span.cm-operator {color: #999}+.cm-s-the-matrix span.cm-comment {color: #CCCCCC;}+.cm-s-the-matrix span.cm-string {color: #39C;}+.cm-s-the-matrix span.cm-meta {color: #C9F;}+.cm-s-the-matrix span.cm-qualifier {color: #FFF700;}+.cm-s-the-matrix span.cm-builtin {color: #30a;}+.cm-s-the-matrix span.cm-bracket {color: #cc7;}+.cm-s-the-matrix span.cm-tag {color: #FFBD40;}+.cm-s-the-matrix span.cm-attribute {color: #FFF700;}+.cm-s-the-matrix span.cm-error {color: #FF0000;}++.cm-s-the-matrix .CodeMirror-activeline-background {background: #040;}diff --git a/data/ext/editorText/codemirror/theme/tomorrow-night-eighties.css b/data/ext/editorText/codemirror/theme/tomorrow-night-eighties.cssnew file mode 100644index 000000000..85c2a4a78--- /dev/null+++ b/data/ext/editorText/codemirror/theme/tomorrow-night-eighties.css@@ -0,0 +1,34 @@+/*++ Name: Tomorrow Night - Eighties+ Author: Chris Kempson++ CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror)+ Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16)++*/++.cm-s-tomorrow-night-eighties.CodeMirror {background: #000000; color: #CCCCCC;}+.cm-s-tomorrow-night-eighties div.CodeMirror-selected {background: #2D2D2D !important;}+.cm-s-tomorrow-night-eighties .CodeMirror-gutters {background: #000000; border-right: 0px;}+.cm-s-tomorrow-night-eighties .CodeMirror-linenumber {color: #515151;}+.cm-s-tomorrow-night-eighties .CodeMirror-cursor {border-left: 1px solid #6A6A6A !important;}++.cm-s-tomorrow-night-eighties span.cm-comment {color: #d27b53;}+.cm-s-tomorrow-night-eighties span.cm-atom {color: #a16a94;}+.cm-s-tomorrow-night-eighties span.cm-number {color: #a16a94;}++.cm-s-tomorrow-night-eighties span.cm-property, .cm-s-tomorrow-night-eighties span.cm-attribute {color: #99cc99;}+.cm-s-tomorrow-night-eighties span.cm-keyword {color: #f2777a;}+.cm-s-tomorrow-night-eighties span.cm-string {color: #ffcc66;}++.cm-s-tomorrow-night-eighties span.cm-variable {color: #99cc99;}+.cm-s-tomorrow-night-eighties span.cm-variable-2 {color: #6699cc;}+.cm-s-tomorrow-night-eighties span.cm-def {color: #f99157;}+.cm-s-tomorrow-night-eighties span.cm-bracket {color: #CCCCCC;}+.cm-s-tomorrow-night-eighties span.cm-tag {color: #f2777a;}+.cm-s-tomorrow-night-eighties span.cm-link {color: #a16a94;}+.cm-s-tomorrow-night-eighties span.cm-error {background: #f2777a; color: #6A6A6A;}++.cm-s-tomorrow-night-eighties .CodeMirror-activeline-background {background: #343600 !important;}+.cm-s-tomorrow-night-eighties .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}diff --git a/data/ext/editorText/codemirror/theme/twilight.css b/data/ext/editorText/codemirror/theme/twilight.cssindex fd8944ba8..19d6abadd 100644--- a/data/ext/editorText/codemirror/theme/twilight.css+++ b/data/ext/editorText/codemirror/theme/twilight.css@@ -16,11 +16,13 @@.cm-s-twilight .cm-string { color:#8f9d6a; font-style:italic; } /**/.cm-s-twilight .cm-string-2 { color:#bd6b18 } /*?*/.cm-s-twilight .cm-meta { background-color:#141414; color:#f7f7f7; } /*?*/-.cm-s-twilight .cm-error { border-bottom: 1px solid red; }.cm-s-twilight .cm-builtin { color: #cda869; } /*?*/.cm-s-twilight .cm-tag { color: #997643; } /**/.cm-s-twilight .cm-attribute { color: #d6bb6d; } /*?*/.cm-s-twilight .cm-header { color: #FF6400; }.cm-s-twilight .cm-hr { color: #AEAEAE; }.cm-s-twilight .cm-link { color:#ad9361; font-style:italic; text-decoration:none; } /**/+.cm-s-twilight .cm-error { border-bottom: 1px solid red; }+.cm-s-twilight .CodeMirror-activeline-background {background: #27282E !important;}+.cm-s-twilight .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;}diff --git a/data/ext/editorText/codemirror/theme/vibrant-ink.css b/data/ext/editorText/codemirror/theme/vibrant-ink.cssindex 22024a489..0206225bf 100644--- a/data/ext/editorText/codemirror/theme/vibrant-ink.css+++ b/data/ext/editorText/codemirror/theme/vibrant-ink.css@@ -11,17 +11,20 @@.cm-s-vibrant-ink .cm-atom { color: #FC0; }.cm-s-vibrant-ink .cm-number { color: #FFEE98; }.cm-s-vibrant-ink .cm-def { color: #8DA6CE; }-.cm-s-vibrant-ink span.cm-variable-2, .cm-s-cobalt span.cm-tag { color: #FFC66D }-.cm-s-vibrant-ink span.cm-variable-3, .cm-s-cobalt span.cm-def { color: #FFC66D }+.cm-s-vibrant-ink span.cm-variable-2, .cm-s-vibrant span.cm-tag { color: #FFC66D }+.cm-s-vibrant-ink span.cm-variable-3, .cm-s-vibrant span.cm-def { color: #FFC66D }.cm-s-vibrant-ink .cm-operator { color: #888; }.cm-s-vibrant-ink .cm-comment { color: gray; font-weight: bold; }.cm-s-vibrant-ink .cm-string { color: #A5C25C }.cm-s-vibrant-ink .cm-string-2 { color: red }.cm-s-vibrant-ink .cm-meta { color: #D8FA3C; }-.cm-s-vibrant-ink .cm-error { border-bottom: 1px solid red; }.cm-s-vibrant-ink .cm-builtin { color: #8DA6CE; }.cm-s-vibrant-ink .cm-tag { color: #8DA6CE; }.cm-s-vibrant-ink .cm-attribute { color: #8DA6CE; }.cm-s-vibrant-ink .cm-header { color: #FF6400; }.cm-s-vibrant-ink .cm-hr { color: #AEAEAE; }.cm-s-vibrant-ink .cm-link { color: blue; }+.cm-s-vibrant-ink .cm-error { border-bottom: 1px solid red; }++.cm-s-vibrant-ink .CodeMirror-activeline-background {background: #27282E !important;}+.cm-s-vibrant-ink .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;}diff --git a/data/ext/editorText/codemirror/theme/xq-dark.css b/data/ext/editorText/codemirror/theme/xq-dark.cssindex fd9bb12ab..4a0b2138c 100644--- a/data/ext/editorText/codemirror/theme/xq-dark.css+++ b/data/ext/editorText/codemirror/theme/xq-dark.css@@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INTHE SOFTWARE.*/.cm-s-xq-dark.CodeMirror { background: #0a001f; color: #f8f8f8; }-.cm-s-xq-dark span.CodeMirror-selected { background: #a8f !important; }+.cm-s-xq-dark .CodeMirror-selected { background: #27007A !important; }.cm-s-xq-dark .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; }.cm-s-xq-dark .CodeMirror-linenumber { color: #f8f8f8; }.cm-s-xq-dark .CodeMirror-cursor { border-left: 1px solid white !important; }@@ -38,9 +38,12 @@ THE SOFTWARE..cm-s-xq-dark span.cm-comment {color: gray;}.cm-s-xq-dark span.cm-string {color: #9FEE00;}.cm-s-xq-dark span.cm-meta {color: yellow;}-.cm-s-xq-dark span.cm-error {color: #f00;}.cm-s-xq-dark span.cm-qualifier {color: #FFF700;}.cm-s-xq-dark span.cm-builtin {color: #30a;}.cm-s-xq-dark span.cm-bracket {color: #cc7;}.cm-s-xq-dark span.cm-tag {color: #FFBD40;}.cm-s-xq-dark span.cm-attribute {color: #FFF700;}+.cm-s-xq-dark span.cm-error {color: #f00;}++.cm-s-xq-dark .CodeMirror-activeline-background {background: #27282E !important;}+.cm-s-xq-dark .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;}\ No newline at end of filediff --git a/data/ext/editorText/codemirror/theme/xq-light.css b/data/ext/editorText/codemirror/theme/xq-light.cssindex 08784d58c..20b5c7961 100644--- a/data/ext/editorText/codemirror/theme/xq-light.css+++ b/data/ext/editorText/codemirror/theme/xq-light.css@@ -32,12 +32,12 @@ THE SOFTWARE..cm-s-xq-light span.cm-comment {color: #0080FF; font-style: italic;}.cm-s-xq-light span.cm-string {color: red;}.cm-s-xq-light span.cm-meta {color: yellow;}-.cm-s-xq-light span.cm-error {color: #f00;}.cm-s-xq-light span.cm-qualifier {color: grey}.cm-s-xq-light span.cm-builtin {color: #7EA656;}.cm-s-xq-light span.cm-bracket {color: #cc7;}.cm-s-xq-light span.cm-tag {color: #3F7F7F;}.cm-s-xq-light span.cm-attribute {color: #7F007F;}+.cm-s-xq-light span.cm-error {color: #f00;}.cm-s-xq-light .CodeMirror-activeline-background {background: #e8f2ff !important;}-.cm-s-xq-light .CodeMirror-matchingbracket {border:1px solid grey;color:black !important;background:yellow;}\ No newline at end of file+.cm-s-xq-light .CodeMirror-matchingbracket {outline:1px solid grey;color:black !important;background:yellow;}\ No newline at end of file