\ No newline at end of file
diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
index c5bbc5133f..e2b2d7b924 100644
--- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
+++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
@@ -743,158 +743,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1829,14 +1677,6 @@
-
-
-
-
-
-
-
-
@@ -2115,14 +1955,6 @@
-
-
-
-
-
-
-
- Designer
@@ -2535,7 +2367,6 @@
- Designer
diff --git a/src/Umbraco.Web.UI/config/ClientDependency.config b/src/Umbraco.Web.UI/config/ClientDependency.config
index b252002c00..7269594985 100644
--- a/src/Umbraco.Web.UI/config/ClientDependency.config
+++ b/src/Umbraco.Web.UI/config/ClientDependency.config
@@ -10,7 +10,7 @@ NOTES:
* Compression/Combination/Minification is not enabled unless debug="false" is specified on the 'compiliation' element in the web.config
* A new version will invalidate both client and server cache and create new persisted files
-->
-
+
",
- wordWrapChars: [">"],
-
- autoFormatLineBreaks: function (text) {
- var lines = text.split("\n");
- var reProcessedPortion = new RegExp("(^\\s*?<|^[^<]*?)(.+)(>\\s*?$|[^>]*?$)");
- var reOpenBrackets = new RegExp("<", "g");
- var reCloseBrackets = new RegExp("(>)([^\r\n])", "g");
- for (var i = 0; i < lines.length; i++) {
- var mToProcess = lines[i].match(reProcessedPortion);
- if (mToProcess != null && mToProcess.length > 3) { // The line starts with whitespaces and ends with whitespaces
- lines[i] = mToProcess[1]
- + mToProcess[2].replace(reOpenBrackets, "\n$&").replace(reCloseBrackets, "$1\n$2")
- + mToProcess[3];
- continue;
- }
- }
- return lines.join("\n");
- }
- });
-
- function localModeAt(cm, pos) {
- return CodeMirror.innerMode(cm.getMode(), cm.getTokenAt(pos).state).mode;
- }
-
- function enumerateModesBetween(cm, line, start, end) {
- var outer = cm.getMode(), text = cm.getLine(line);
- if (end == null) end = text.length;
- if (!outer.innerMode) return [{from: start, to: end, mode: outer}];
- var state = cm.getTokenAt({line: line, ch: start}).state;
- var mode = CodeMirror.innerMode(outer, state).mode;
- var found = [], stream = new CodeMirror.StringStream(text);
- stream.pos = stream.start = start;
- for (;;) {
- outer.token(stream, state);
- var curMode = CodeMirror.innerMode(outer, state).mode;
- if (curMode != mode) {
- var cut = stream.start;
- // Crappy heuristic to deal with the fact that a change in
- // mode can occur both at the end and the start of a token,
- // and we don't know which it was.
- if (mode.name == "xml" && text.charAt(stream.pos - 1) == ">") cut = stream.pos;
- found.push({from: start, to: cut, mode: mode});
- start = cut;
- mode = curMode;
- }
- if (stream.pos >= end) break;
- stream.start = stream.pos;
- }
- if (start < end) found.push({from: start, to: end, mode: mode});
- return found;
- }
-
- // Comment/uncomment the specified range
- CodeMirror.defineExtension("commentRange", function (isComment, from, to) {
- var curMode = localModeAt(this, from), cm = this;
- this.operation(function() {
- if (isComment) { // Comment range
- cm.replaceRange(curMode.commentEnd, to);
- cm.replaceRange(curMode.commentStart, from);
- if (from.line == to.line && from.ch == to.ch) // An empty comment inserted - put cursor inside
- cm.setCursor(from.line, from.ch + curMode.commentStart.length);
- } else { // Uncomment range
- var selText = cm.getRange(from, to);
- var startIndex = selText.indexOf(curMode.commentStart);
- var endIndex = selText.lastIndexOf(curMode.commentEnd);
- if (startIndex > -1 && endIndex > -1 && endIndex > startIndex) {
- // Take string till comment start
- selText = selText.substr(0, startIndex)
- // From comment start till comment end
- + selText.substring(startIndex + curMode.commentStart.length, endIndex)
- // From comment end till string end
- + selText.substr(endIndex + curMode.commentEnd.length);
- }
- cm.replaceRange(selText, from, to);
- }
- });
- });
-
- // Applies automatic mode-aware indentation to the specified range
- CodeMirror.defineExtension("autoIndentRange", function (from, to) {
- var cmInstance = this;
- this.operation(function () {
- for (var i = from.line; i <= to.line; i++) {
- cmInstance.indentLine(i, "smart");
- }
- });
- });
-
- // Applies automatic formatting to the specified range
- CodeMirror.defineExtension("autoFormatRange", function (from, to) {
- var cm = this;
- cm.operation(function () {
- for (var cur = from.line, end = to.line; cur <= end; ++cur) {
- var f = {line: cur, ch: cur == from.line ? from.ch : 0};
- var t = {line: cur, ch: cur == end ? to.ch : null};
- var modes = enumerateModesBetween(cm, cur, f.ch, t.ch), mangled = "";
- var text = cm.getRange(f, t);
- for (var i = 0; i < modes.length; ++i) {
- var part = modes.length > 1 ? text.slice(modes[i].from, modes[i].to) : text;
- if (mangled) mangled += "\n";
- if (modes[i].mode.autoFormatLineBreaks) {
- mangled += modes[i].mode.autoFormatLineBreaks(part);
- } else mangled += text;
- }
- if (mangled != text) {
- for (var count = 0, pos = mangled.indexOf("\n"); pos != -1; pos = mangled.indexOf("\n", pos + 1), ++count) {}
- cm.replaceRange(mangled, f, t);
- cur += count;
- end += count;
- }
- }
- for (var cur = from.line + 1; cur <= end; ++cur)
- cm.indentLine(cur, "smart");
- cm.setSelection(from, cm.getCursor(false));
- });
- });
-})();
diff --git a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/javascript-hint.js b/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/javascript-hint.js
deleted file mode 100644
index 5fce1d9153..0000000000
--- a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/javascript-hint.js
+++ /dev/null
@@ -1,134 +0,0 @@
-(function () {
- function forEach(arr, f) {
- for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]);
- }
-
- function arrayContains(arr, item) {
- if (!Array.prototype.indexOf) {
- var i = arr.length;
- while (i--) {
- if (arr[i] === item) {
- return true;
- }
- }
- return false;
- }
- return arr.indexOf(item) != -1;
- }
-
- function scriptHint(editor, keywords, getToken) {
- // Find the token at the cursor
- var cur = editor.getCursor(), token = getToken(editor, cur), tprop = token;
- // If it's not a 'word-style' token, ignore the token.
- if (!/^[\w$_]*$/.test(token.string)) {
- token = tprop = {start: cur.ch, end: cur.ch, string: "", state: token.state,
- className: token.string == "." ? "property" : null};
- }
- // If it is a property, find out what it is a property of.
- while (tprop.className == "property") {
- tprop = getToken(editor, {line: cur.line, ch: tprop.start});
- if (tprop.string != ".") return;
- tprop = getToken(editor, {line: cur.line, ch: tprop.start});
- if (tprop.string == ')') {
- var level = 1;
- do {
- tprop = getToken(editor, {line: cur.line, ch: tprop.start});
- switch (tprop.string) {
- case ')': level++; break;
- case '(': level--; break;
- default: break;
- }
- } while (level > 0);
- tprop = getToken(editor, {line: cur.line, ch: tprop.start});
- if (tprop.className == 'variable')
- tprop.className = 'function';
- else return; // no clue
- }
- if (!context) var context = [];
- context.push(tprop);
- }
- return {list: getCompletions(token, context, keywords),
- from: {line: cur.line, ch: token.start},
- to: {line: cur.line, ch: token.end}};
- }
-
- CodeMirror.javascriptHint = function(editor) {
- return scriptHint(editor, javascriptKeywords,
- function (e, cur) {return e.getTokenAt(cur);});
- };
-
- function getCoffeeScriptToken(editor, cur) {
- // This getToken, it is for coffeescript, imitates the behavior of
- // getTokenAt method in javascript.js, that is, returning "property"
- // type and treat "." as indepenent token.
- var token = editor.getTokenAt(cur);
- if (cur.ch == token.start + 1 && token.string.charAt(0) == '.') {
- token.end = token.start;
- token.string = '.';
- token.className = "property";
- }
- else if (/^\.[\w$_]*$/.test(token.string)) {
- token.className = "property";
- token.start++;
- token.string = token.string.replace(/\./, '');
- }
- return token;
- }
-
- CodeMirror.coffeescriptHint = function(editor) {
- return scriptHint(editor, coffeescriptKeywords, getCoffeeScriptToken);
- };
-
- var stringProps = ("charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight " +
- "toUpperCase toLowerCase split concat match replace search").split(" ");
- var arrayProps = ("length concat join splice push pop shift unshift slice reverse sort indexOf " +
- "lastIndexOf every some filter forEach map reduce reduceRight ").split(" ");
- var funcProps = "prototype apply call bind".split(" ");
- var javascriptKeywords = ("break case catch continue debugger default delete do else false finally for function " +
- "if in instanceof new null return switch throw true try typeof var void while with").split(" ");
- var coffeescriptKeywords = ("and break catch class continue delete do else extends false finally for " +
- "if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes").split(" ");
-
- function getCompletions(token, context, keywords) {
- var found = [], start = token.string;
- function maybeAdd(str) {
- if (str.indexOf(start) == 0 && !arrayContains(found, str)) found.push(str);
- }
- function gatherCompletions(obj) {
- if (typeof obj == "string") forEach(stringProps, maybeAdd);
- else if (obj instanceof Array) forEach(arrayProps, maybeAdd);
- else if (obj instanceof Function) forEach(funcProps, maybeAdd);
- for (var name in obj) maybeAdd(name);
- }
-
- if (context) {
- // If this is a property, see if it belongs to some object we can
- // find in the current environment.
- var obj = context.pop(), base;
- if (obj.className == "variable")
- base = window[obj.string];
- else if (obj.className == "string")
- base = "";
- else if (obj.className == "atom")
- base = 1;
- else if (obj.className == "function") {
- if (window.jQuery != null && (obj.string == '$' || obj.string == 'jQuery') &&
- (typeof window.jQuery == 'function'))
- base = window.jQuery();
- else if (window._ != null && (obj.string == '_') && (typeof window._ == 'function'))
- base = window._();
- }
- while (base != null && context.length)
- base = base[context.pop().string];
- if (base != null) gatherCompletions(base);
- }
- else {
- // If not, just look in the window object and any local scope
- // (reading into JS mode internals to get at the local variables)
- for (var v = token.state.localVars; v; v = v.next) maybeAdd(v.name);
- gatherCompletions(window);
- forEach(keywords, maybeAdd);
- }
- return found;
- }
-})();
diff --git a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/loadmode.js b/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/loadmode.js
deleted file mode 100644
index a6c56f7344..0000000000
--- a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/loadmode.js
+++ /dev/null
@@ -1,51 +0,0 @@
-(function() {
- if (!CodeMirror.modeURL) CodeMirror.modeURL = "../mode/%N/%N.js";
-
- var loading = {};
- function splitCallback(cont, n) {
- var countDown = n;
- return function() { if (--countDown == 0) cont(); };
- }
- function ensureDeps(mode, cont) {
- var deps = CodeMirror.modes[mode].dependencies;
- if (!deps) return cont();
- var missing = [];
- for (var i = 0; i < deps.length; ++i) {
- if (!CodeMirror.modes.hasOwnProperty(deps[i]))
- missing.push(deps[i]);
- }
- if (!missing.length) return cont();
- var split = splitCallback(cont, missing.length);
- for (var i = 0; i < missing.length; ++i)
- CodeMirror.requireMode(missing[i], split);
- }
-
- CodeMirror.requireMode = function(mode, cont) {
- if (typeof mode != "string") mode = mode.name;
- if (CodeMirror.modes.hasOwnProperty(mode)) return ensureDeps(mode, cont);
- if (loading.hasOwnProperty(mode)) return loading[mode].push(cont);
-
- var script = document.createElement("script");
- script.src = CodeMirror.modeURL.replace(/%N/g, mode);
- var others = document.getElementsByTagName("script")[0];
- others.parentNode.insertBefore(script, others);
- var list = loading[mode] = [cont];
- var count = 0, poll = setInterval(function() {
- if (++count > 100) return clearInterval(poll);
- if (CodeMirror.modes.hasOwnProperty(mode)) {
- clearInterval(poll);
- loading[mode] = null;
- ensureDeps(mode, function() {
- for (var i = 0; i < list.length; ++i) list[i]();
- });
- }
- }, 200);
- };
-
- CodeMirror.autoLoadMode = function(instance, mode) {
- if (!CodeMirror.modes.hasOwnProperty(mode))
- CodeMirror.requireMode(mode, function() {
- instance.setOption("mode", instance.getOption("mode"));
- });
- };
-}());
diff --git a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/match-highlighter.js b/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/match-highlighter.js
deleted file mode 100644
index bc3dd4be30..0000000000
--- a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/match-highlighter.js
+++ /dev/null
@@ -1,44 +0,0 @@
-// Define match-highlighter commands. Depends on searchcursor.js
-// Use by attaching the following function call to the onCursorActivity event:
- //myCodeMirror.matchHighlight(minChars);
-// And including a special span.CodeMirror-matchhighlight css class (also optionally a separate one for .CodeMirror-focused -- see demo matchhighlighter.html)
-
-(function() {
- var DEFAULT_MIN_CHARS = 2;
-
- function MatchHighlightState() {
- this.marked = [];
- }
- function getMatchHighlightState(cm) {
- return cm._matchHighlightState || (cm._matchHighlightState = new MatchHighlightState());
- }
-
- function clearMarks(cm) {
- var state = getMatchHighlightState(cm);
- for (var i = 0; i < state.marked.length; ++i)
- state.marked[i].clear();
- state.marked = [];
- }
-
- function markDocument(cm, className, minChars) {
- clearMarks(cm);
- minChars = (typeof minChars !== 'undefined' ? minChars : DEFAULT_MIN_CHARS);
- if (cm.somethingSelected() && cm.getSelection().replace(/^\s+|\s+$/g, "").length >= minChars) {
- var state = getMatchHighlightState(cm);
- var query = cm.getSelection();
- cm.operation(function() {
- if (cm.lineCount() < 2000) { // This is too expensive on big documents.
- for (var cursor = cm.getSearchCursor(query); cursor.findNext();) {
- //Only apply matchhighlight to the matches other than the one actually selected
- if (!(cursor.from().line === cm.getCursor(true).line && cursor.from().ch === cm.getCursor(true).ch))
- state.marked.push(cm.markText(cursor.from(), cursor.to(), className));
- }
- }
- });
- }
- }
-
- CodeMirror.defineExtension("matchHighlight", function(className, minChars) {
- markDocument(this, className, minChars);
- });
-})();
diff --git a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/multiplex.js b/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/multiplex.js
deleted file mode 100644
index 874a16a289..0000000000
--- a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/multiplex.js
+++ /dev/null
@@ -1,77 +0,0 @@
-CodeMirror.multiplexingMode = function(outer /*, others */) {
- // Others should be {open, close, mode [, delimStyle]} objects
- var others = Array.prototype.slice.call(arguments, 1);
- var n_others = others.length;
-
- function indexOf(string, pattern, from) {
- if (typeof pattern == "string") return string.indexOf(pattern, from);
- var m = pattern.exec(from ? string.slice(from) : string);
- return m ? m.index + from : -1;
- }
-
- return {
- startState: function() {
- return {
- outer: CodeMirror.startState(outer),
- innerActive: null,
- inner: null
- };
- },
-
- copyState: function(state) {
- return {
- outer: CodeMirror.copyState(outer, state.outer),
- innerActive: state.innerActive,
- inner: state.innerActive && CodeMirror.copyState(state.innerActive.mode, state.inner)
- };
- },
-
- token: function(stream, state) {
- if (!state.innerActive) {
- var cutOff = Infinity, oldContent = stream.string;
- for (var i = 0; i < n_others; ++i) {
- var other = others[i];
- var found = indexOf(oldContent, other.open, stream.pos);
- if (found == stream.pos) {
- stream.match(other.open);
- state.innerActive = other;
- state.inner = CodeMirror.startState(other.mode, outer.indent ? outer.indent(state.outer, "") : 0);
- return other.delimStyle;
- } else if (found != -1 && found < cutOff) {
- cutOff = found;
- }
- }
- if (cutOff != Infinity) stream.string = oldContent.slice(0, cutOff);
- var outerToken = outer.token(stream, state.outer);
- if (cutOff != Infinity) stream.string = oldContent;
- return outerToken;
- } else {
- var curInner = state.innerActive, oldContent = stream.string;
- var found = indexOf(oldContent, curInner.close, stream.pos);
- if (found == stream.pos) {
- stream.match(curInner.close);
- state.innerActive = state.inner = null;
- return curInner.delimStyle;
- }
- if (found > -1) stream.string = oldContent.slice(0, found);
- var innerToken = curInner.mode.token(stream, state.inner);
- if (found > -1) stream.string = oldContent;
- var cur = stream.current(), found = cur.indexOf(curInner.close);
- if (found > -1) stream.backUp(cur.length - found);
- return innerToken;
- }
- },
-
- indent: function(state, textAfter) {
- var mode = state.innerActive ? state.innerActive.mode : outer;
- if (!mode.indent) return CodeMirror.Pass;
- return mode.indent(state.innerActive ? state.inner : state.outer, textAfter);
- },
-
- electricChars: outer.electricChars,
-
- innerMode: function(state) {
- return state.inner ? {state: state.inner, mode: state.innerActive.mode} : {state: state.outer, mode: outer};
- }
- };
-};
diff --git a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/overlay.js b/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/overlay.js
deleted file mode 100644
index ad54deeec1..0000000000
--- a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/overlay.js
+++ /dev/null
@@ -1,54 +0,0 @@
-// Utility function that allows modes to be combined. The mode given
-// as the base argument takes care of most of the normal mode
-// functionality, but a second (typically simple) mode is used, which
-// can override the style of text. Both modes get to parse all of the
-// text, but when both assign a non-null style to a piece of code, the
-// overlay wins, unless the combine argument was true, in which case
-// the styles are combined.
-
-// overlayParser is the old, deprecated name
-CodeMirror.overlayMode = CodeMirror.overlayParser = function(base, overlay, combine) {
- return {
- startState: function() {
- return {
- base: CodeMirror.startState(base),
- overlay: CodeMirror.startState(overlay),
- basePos: 0, baseCur: null,
- overlayPos: 0, overlayCur: null
- };
- },
- copyState: function(state) {
- return {
- base: CodeMirror.copyState(base, state.base),
- overlay: CodeMirror.copyState(overlay, state.overlay),
- basePos: state.basePos, baseCur: null,
- overlayPos: state.overlayPos, overlayCur: null
- };
- },
-
- token: function(stream, state) {
- if (stream.start == state.basePos) {
- state.baseCur = base.token(stream, state.base);
- state.basePos = stream.pos;
- }
- if (stream.start == state.overlayPos) {
- stream.pos = stream.start;
- state.overlayCur = overlay.token(stream, state.overlay);
- state.overlayPos = stream.pos;
- }
- stream.pos = Math.min(state.basePos, state.overlayPos);
- if (stream.eol()) state.basePos = state.overlayPos = 0;
-
- if (state.overlayCur == null) return state.baseCur;
- if (state.baseCur != null && combine) return state.baseCur + " " + state.overlayCur;
- else return state.overlayCur;
- },
-
- indent: base.indent && function(state, textAfter) {
- return base.indent(state.base, textAfter);
- },
- electricChars: base.electricChars,
-
- innerMode: function(state) { return {state: state.base, mode: base}; }
- };
-};
diff --git a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/pig-hint.js b/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/pig-hint.js
deleted file mode 100644
index 416c0a1676..0000000000
--- a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/pig-hint.js
+++ /dev/null
@@ -1,123 +0,0 @@
-(function () {
- function forEach(arr, f) {
- for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]);
- }
-
- function arrayContains(arr, item) {
- if (!Array.prototype.indexOf) {
- var i = arr.length;
- while (i--) {
- if (arr[i] === item) {
- return true;
- }
- }
- return false;
- }
- return arr.indexOf(item) != -1;
- }
-
- function scriptHint(editor, keywords, getToken) {
- // Find the token at the cursor
- var cur = editor.getCursor(), token = getToken(editor, cur), tprop = token;
- // If it's not a 'word-style' token, ignore the token.
-
- if (!/^[\w$_]*$/.test(token.string)) {
- token = tprop = {start: cur.ch, end: cur.ch, string: "", state: token.state,
- className: token.string == ":" ? "pig-type" : null};
- }
-
- if (!context) var context = [];
- context.push(tprop);
-
- var completionList = getCompletions(token, context);
- completionList = completionList.sort();
- //prevent autocomplete for last word, instead show dropdown with one word
- if(completionList.length == 1) {
- completionList.push(" ");
- }
-
- return {list: completionList,
- from: {line: cur.line, ch: token.start},
- to: {line: cur.line, ch: token.end}};
- }
-
- CodeMirror.pigHint = function(editor) {
- return scriptHint(editor, pigKeywordsU, function (e, cur) {return e.getTokenAt(cur);});
- };
-
- function toTitleCase(str) {
- return str.replace(/(?:^|\s)\w/g, function(match) {
- return match.toUpperCase();
- });
- }
-
- var pigKeywords = "VOID IMPORT RETURNS DEFINE LOAD FILTER FOREACH ORDER CUBE DISTINCT COGROUP "
- + "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";
- var pigKeywordsU = pigKeywords.split(" ");
- var pigKeywordsL = pigKeywords.toLowerCase().split(" ");
-
- var pigTypes = "BOOLEAN INT LONG FLOAT DOUBLE CHARARRAY BYTEARRAY BAG TUPLE MAP";
- var pigTypesU = pigTypes.split(" ");
- var pigTypesL = pigTypes.toLowerCase().split(" ");
-
- var pigBuiltins = "ABS ACOS ARITY ASIN ATAN AVG BAGSIZE BINSTORAGE BLOOM BUILDBLOOM CBRT CEIL "
- + "CONCAT COR COS COSH COUNT COUNT_STAR COV CONSTANTSIZE CUBEDIMENSIONS DIFF DISTINCT DOUBLEABS "
- + "DOUBLEAVG DOUBLEBASE DOUBLEMAX DOUBLEMIN DOUBLEROUND DOUBLESUM EXP FLOOR FLOATABS FLOATAVG "
- + "FLOATMAX FLOATMIN FLOATROUND FLOATSUM GENERICINVOKER INDEXOF INTABS INTAVG INTMAX INTMIN "
- + "INTSUM INVOKEFORDOUBLE INVOKEFORFLOAT INVOKEFORINT INVOKEFORLONG INVOKEFORSTRING INVOKER "
- + "ISEMPTY JSONLOADER JSONMETADATA JSONSTORAGE LAST_INDEX_OF LCFIRST LOG LOG10 LOWER LONGABS "
- + "LONGAVG LONGMAX LONGMIN LONGSUM MAX MIN MAPSIZE MONITOREDUDF NONDETERMINISTIC OUTPUTSCHEMA "
- + "PIGSTORAGE PIGSTREAMING RANDOM REGEX_EXTRACT REGEX_EXTRACT_ALL REPLACE ROUND SIN SINH SIZE "
- + "SQRT STRSPLIT SUBSTRING SUM STRINGCONCAT STRINGMAX STRINGMIN STRINGSIZE TAN TANH TOBAG "
- + "TOKENIZE TOMAP TOP TOTUPLE TRIM TEXTLOADER TUPLESIZE UCFIRST UPPER UTF8STORAGECONVERTER";
- var pigBuiltinsU = pigBuiltins.split(" ").join("() ").split(" ");
- var pigBuiltinsL = pigBuiltins.toLowerCase().split(" ").join("() ").split(" ");
- var pigBuiltinsC = ("BagSize BinStorage Bloom BuildBloom ConstantSize CubeDimensions DoubleAbs "
- + "DoubleAvg DoubleBase DoubleMax DoubleMin DoubleRound DoubleSum FloatAbs FloatAvg FloatMax "
- + "FloatMin FloatRound FloatSum GenericInvoker IntAbs IntAvg IntMax IntMin IntSum "
- + "InvokeForDouble InvokeForFloat InvokeForInt InvokeForLong InvokeForString Invoker "
- + "IsEmpty JsonLoader JsonMetadata JsonStorage LongAbs LongAvg LongMax LongMin LongSum MapSize "
- + "MonitoredUDF Nondeterministic OutputSchema PigStorage PigStreaming StringConcat StringMax "
- + "StringMin StringSize TextLoader TupleSize Utf8StorageConverter").split(" ").join("() ").split(" ");
-
- function getCompletions(token, context) {
- var found = [], start = token.string;
- function maybeAdd(str) {
- if (str.indexOf(start) == 0 && !arrayContains(found, str)) found.push(str);
- }
-
- function gatherCompletions(obj) {
- if(obj == ":") {
- forEach(pigTypesL, maybeAdd);
- }
- else {
- forEach(pigBuiltinsU, maybeAdd);
- forEach(pigBuiltinsL, maybeAdd);
- forEach(pigBuiltinsC, maybeAdd);
- forEach(pigTypesU, maybeAdd);
- forEach(pigTypesL, maybeAdd);
- forEach(pigKeywordsU, maybeAdd);
- forEach(pigKeywordsL, maybeAdd);
- }
- }
-
- if (context) {
- // If this is a property, see if it belongs to some object we can
- // find in the current environment.
- var obj = context.pop(), base;
-
- if (obj.className == "pig-word")
- base = obj.string;
- else if(obj.className == "pig-type")
- base = ":" + obj.string;
-
- while (base != null && context.length)
- base = base[context.pop().string];
- if (base != null) gatherCompletions(base);
- }
- return found;
- }
-})();
diff --git a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/razor-hint.js b/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/razor-hint.js
deleted file mode 100644
index 47840ffcf7..0000000000
--- a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/razor-hint.js
+++ /dev/null
@@ -1,119 +0,0 @@
-(function () {
-
- CodeMirror.razorHints = [];
-
-
- function arrayContains(arr, item) {
- if (!Array.prototype.indexOf) {
- var i = arr.length;
- while (i--) {
- if (arr[i] === item) {
- return true;
- }
- }
- return false;
- }
- return arr.indexOf(item) != -1;
- }
-
-
- CodeMirror.razorHint = function (editor, char) {
-
- if (char.length > 0) {
- var cursor = editor.getCursor();
- editor.replaceSelection(char);
- cursor = { line: cursor.line, ch: cursor.ch + 1 };
- editor.setCursor(cursor);
- }
-
- // dirty hack for simple-hint to receive getHint event on space
- var getTokenAt = editor.getTokenAt;
- editor.getTokenAt = function () { return 'disabled'; };
- CodeMirror.simpleHint(editor, getHint);
- editor.getTokenAt = getTokenAt;
-
- //return scriptHint(editor, pigKeywordsU, char, function (e, cur) { return e.getTokenAt(cur); });
- }
-
- var getHint = function (cm) {
-
- var cursor = cm.getCursor();
- if (cursor.ch > 0) {
-
- var text = cm.getRange({ line: 0, ch: 0 }, cursor);
- var typed = '';
- var simbol = '';
-
- for (var i = text.length - 1; i >= 0; i--) {
- if (text[i] == '@' || text[i] == '.') {
- simbol = text[i];
- break;
- }
- else {
- typed = text[i] + typed;
- }
- }
- }
-
- text = text.slice(0, text.length - typed.length);
-
- var hints = getCompletions(text, simbol, typed);
- return {
- list: hints,
- from: { line: cursor.line, ch: cursor.ch - typed.length },
- to: cursor
- };
- };
-
- function searchHints(text, trigger, search) {
- if (search == "") {
- var hints = CodeMirror.razorHints[text];
- if (typeof hints === 'undefined')
- hints = CodeMirror.razorHints[simbol];
-
- return hints;
- } else {
-
- }
- }
-
- function getCompletions(text, trigger, search) {
- var found = [];
-
- function maybeAdd(str) {
- var match = str;
- if (typeof match === 'string') {
- match = [str, str];
- }
-
- if (search == "" && !arrayContains(found, match)) found.push(match);
- else if (match[0].toLowerCase().indexOf(search) == 0 && !arrayContains(found, match)) found.push(match);
- }
-
- forEach(CodeMirror.razorHints[text], maybeAdd);
- forEach(CodeMirror.razorHints[trigger], maybeAdd);
-
- return found.sort(function (a, b) {
- var nameA = a[0].toLowerCase(), nameB = b[0].toLowerCase()
- if (nameA < nameB)
- return -1
- if (nameA > nameB)
- return 1
-
- return 0 //default return value (no sorting)
- })
- }
-
- function forEach(arr, f) {
- if (typeof arr != 'undefined')
- for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]);
- }
-
-
- function toTitleCase(str) {
- return str.replace(/(?:^|\s)\w/g, function (match) {
- return match.toUpperCase();
- });
- }
-
-})();
diff --git a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/razor-hints.js b/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/razor-hints.js
deleted file mode 100644
index 19bee60c85..0000000000
--- a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/razor-hints.js
+++ /dev/null
@@ -1,81 +0,0 @@
-(function() {
-
- CodeMirror.razorHints['@'] = [
- 'inherits',
- 'Library',
- 'Model',
- 'Parameter',
- 'using',
- 'Dictionary',
- ['if/else', 'if(SomeCondition){\n\n}else{\n\n}\n'],
- ['if', 'if(SomeCondition){\n\n}\n'],
- ['foreach', 'foreach(var item in collection){\n\n}\n'],
- ['context', 'inherits umbraco.MacroEngines.DynamicNodeContext\n\n'],
- ['helper', 'helperMethod(Model)\n\n@helperMethod(dynamic val){\n\t
Hello @val.Name\n}\n\n'],
- ];
-
- CodeMirror.razorHints['.'] = [
- 'Ancestors',
- 'AncestorsOrSelf',
- 'Children',
- 'Descendants',
- 'DescendantsOrSelf',
- 'Parent',
- 'First()',
- 'Last()',
- 'Up()',
- 'Next()',
- 'Previous()',
- 'AncestorOrSelf()',
- 'Where()',
- 'OrderBy()',
- 'GroupBy()',
- 'InGroupsOf()',
- 'Pluck()',
- 'Take()',
- 'Skip()',
- 'Count()',
- 'XPath()',
- 'Search()',
-
- 'Id',
- 'Template',
- 'SortOrder',
- 'Name',
- 'Visible',
- 'Url',
- 'UrlName',
- 'NodeTypeAlias',
- 'WriterName',
- 'CreatorName',
- 'WriterId',
- 'CreatorId',
- 'Path',
- 'CreateDate',
- 'UpdateDate',
- 'NiceUrl',
- 'Level',
- ];
-
- CodeMirror.razorHints['@Library.'] = [
- 'Search()',
- 'NodeById()',
- ];
-
- CodeMirror.razorHints['@Model.'] =
- CodeMirror.razorHints['<'] =
- CodeMirror.razorHints['<'] = [
- 'second',
- 'two'
- ];
-
- CodeMirror.razorHints['<'] = [
- 'three',
- 'x-three'
- ];
-
-})();
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/runmode-standalone.js b/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/runmode-standalone.js
deleted file mode 100644
index 481a46bc94..0000000000
--- a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/runmode-standalone.js
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Just enough of CodeMirror to run runMode under node.js */
-
-function splitLines(string){ return string.split(/\r?\n|\r/); };
-
-function StringStream(string) {
- this.pos = this.start = 0;
- this.string = string;
-}
-StringStream.prototype = {
- eol: function() {return this.pos >= this.string.length;},
- sol: function() {return this.pos == 0;},
- peek: function() {return this.string.charAt(this.pos) || null;},
- next: function() {
- if (this.pos < this.string.length)
- return this.string.charAt(this.pos++);
- },
- eat: function(match) {
- var ch = this.string.charAt(this.pos);
- if (typeof match == "string") var ok = ch == match;
- else var ok = ch && (match.test ? match.test(ch) : match(ch));
- if (ok) {++this.pos; return ch;}
- },
- eatWhile: function(match) {
- var start = this.pos;
- while (this.eat(match)){}
- return this.pos > start;
- },
- eatSpace: function() {
- var start = this.pos;
- while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos;
- return this.pos > start;
- },
- skipToEnd: function() {this.pos = this.string.length;},
- skipTo: function(ch) {
- var found = this.string.indexOf(ch, this.pos);
- if (found > -1) {this.pos = found; return true;}
- },
- backUp: function(n) {this.pos -= n;},
- column: function() {return this.start;},
- indentation: function() {return 0;},
- match: function(pattern, consume, caseInsensitive) {
- if (typeof pattern == "string") {
- function cased(str) {return caseInsensitive ? str.toLowerCase() : str;}
- if (cased(this.string).indexOf(cased(pattern), this.pos) == this.pos) {
- if (consume !== false) this.pos += pattern.length;
- return true;
- }
- }
- else {
- var match = this.string.slice(this.pos).match(pattern);
- if (match && consume !== false) this.pos += match[0].length;
- return match;
- }
- },
- current: function(){return this.string.slice(this.start, this.pos);}
-};
-exports.StringStream = StringStream;
-
-exports.startState = function(mode, a1, a2) {
- return mode.startState ? mode.startState(a1, a2) : true;
-};
-
-var modes = exports.modes = {}, mimeModes = exports.mimeModes = {};
-exports.defineMode = function(name, mode) { modes[name] = mode; };
-exports.defineMIME = function(mime, spec) { mimeModes[mime] = spec; };
-exports.getMode = function(options, spec) {
- if (typeof spec == "string" && mimeModes.hasOwnProperty(spec))
- spec = mimeModes[spec];
- if (typeof spec == "string")
- var mname = spec, config = {};
- else if (spec != null)
- var mname = spec.name, config = spec;
- var mfactory = modes[mname];
- if (!mfactory) throw new Error("Unknown mode: " + spec);
- return mfactory(options, config || {});
-};
-
-exports.runMode = function(string, modespec, callback) {
- var mode = exports.getMode({indentUnit: 2}, modespec);
- var lines = splitLines(string), state = exports.startState(mode);
- for (var i = 0, e = lines.length; i < e; ++i) {
- if (i) callback("\n");
- var stream = new exports.StringStream(lines[i]);
- while (!stream.eol()) {
- var style = mode.token(stream, state);
- callback(stream.current(), style, i, stream.start);
- stream.start = stream.pos;
- }
- }
-};
diff --git a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/runmode.js b/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/runmode.js
deleted file mode 100644
index a988bde43f..0000000000
--- a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/runmode.js
+++ /dev/null
@@ -1,53 +0,0 @@
-CodeMirror.runMode = function(string, modespec, callback, options) {
- function esc(str) {
- return str.replace(/[<&]/, function(ch) { return ch == "<" ? "<" : "&"; });
- }
-
- var mode = CodeMirror.getMode(CodeMirror.defaults, modespec);
- var isNode = callback.nodeType == 1;
- var tabSize = (options && options.tabSize) || CodeMirror.defaults.tabSize;
- if (isNode) {
- var node = callback, accum = [], col = 0;
- callback = function(text, style) {
- if (text == "\n") {
- accum.push(" ");
- col = 0;
- return;
- }
- var escaped = "";
- // HTML-escape and replace tabs
- for (var pos = 0;;) {
- var idx = text.indexOf("\t", pos);
- if (idx == -1) {
- escaped += esc(text.slice(pos));
- col += text.length - pos;
- break;
- } else {
- col += idx - pos;
- escaped += esc(text.slice(pos, idx));
- var size = tabSize - col % tabSize;
- col += size;
- for (var i = 0; i < size; ++i) escaped += " ";
- pos = idx + 1;
- }
- }
-
- if (style)
- accum.push("" + escaped + "");
- else
- accum.push(escaped);
- };
- }
- var lines = CodeMirror.splitLines(string), state = CodeMirror.startState(mode);
- for (var i = 0, e = lines.length; i < e; ++i) {
- if (i) callback("\n");
- var stream = new CodeMirror.StringStream(lines[i]);
- while (!stream.eol()) {
- var style = mode.token(stream, state);
- callback(stream.current(), style, i, stream.start);
- stream.start = stream.pos;
- }
- }
- if (isNode)
- node.innerHTML = accum.join("");
-};
diff --git a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/search.js b/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/search.js
deleted file mode 100644
index 6338c1ffbf..0000000000
--- a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/search.js
+++ /dev/null
@@ -1,118 +0,0 @@
-// Define search commands. Depends on dialog.js or another
-// implementation of the openDialog method.
-
-// Replace works a little oddly -- it will do the replace on the next
-// Ctrl-G (or whatever is bound to findNext) press. You prevent a
-// replace by making sure the match is no longer selected when hitting
-// Ctrl-G.
-
-(function() {
- function SearchState() {
- this.posFrom = this.posTo = this.query = null;
- this.marked = [];
- }
- function getSearchState(cm) {
- return cm._searchState || (cm._searchState = new SearchState());
- }
- function getSearchCursor(cm, query, pos) {
- // Heuristic: if the query string is all lowercase, do a case insensitive search.
- return cm.getSearchCursor(query, pos, typeof query == "string" && query == query.toLowerCase());
- }
- function dialog(cm, text, shortText, f) {
- if (cm.openDialog) cm.openDialog(text, f);
- else f(prompt(shortText, ""));
- }
- function confirmDialog(cm, text, shortText, fs) {
- if (cm.openConfirm) cm.openConfirm(text, fs);
- else if (confirm(shortText)) fs[0]();
- }
- function parseQuery(query) {
- var isRE = query.match(/^\/(.*)\/([a-z]*)$/);
- return isRE ? new RegExp(isRE[1], isRE[2].indexOf("i") == -1 ? "" : "i") : query;
- }
- var queryDialog =
- 'Search: (Use /re/ syntax for regexp search)';
- function doSearch(cm, rev) {
- var state = getSearchState(cm);
- if (state.query) return findNext(cm, rev);
- dialog(cm, queryDialog, "Search for:", function(query) {
- cm.operation(function() {
- if (!query || state.query) return;
- state.query = parseQuery(query);
- if (cm.lineCount() < 2000) { // This is too expensive on big documents.
- for (var cursor = getSearchCursor(cm, state.query); cursor.findNext();)
- state.marked.push(cm.markText(cursor.from(), cursor.to(), "CodeMirror-searching"));
- }
- state.posFrom = state.posTo = cm.getCursor();
- findNext(cm, rev);
- });
- });
- }
- function findNext(cm, rev) {cm.operation(function() {
- var state = getSearchState(cm);
- var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo);
- if (!cursor.find(rev)) {
- cursor = getSearchCursor(cm, state.query, rev ? {line: cm.lineCount() - 1} : {line: 0, ch: 0});
- if (!cursor.find(rev)) return;
- }
- cm.setSelection(cursor.from(), cursor.to());
- state.posFrom = cursor.from(); state.posTo = cursor.to();
- });}
- function clearSearch(cm) {cm.operation(function() {
- var state = getSearchState(cm);
- if (!state.query) return;
- state.query = null;
- for (var i = 0; i < state.marked.length; ++i) state.marked[i].clear();
- state.marked.length = 0;
- });}
-
- var replaceQueryDialog =
- 'Replace: (Use /re/ syntax for regexp search)';
- var replacementQueryDialog = 'With: ';
- var doReplaceConfirm = "Replace? ";
- function replace(cm, all) {
- dialog(cm, replaceQueryDialog, "Replace:", function(query) {
- if (!query) return;
- query = parseQuery(query);
- dialog(cm, replacementQueryDialog, "Replace with:", function(text) {
- if (all) {
- cm.compoundChange(function() { cm.operation(function() {
- for (var cursor = getSearchCursor(cm, query); cursor.findNext();) {
- if (typeof query != "string") {
- var match = cm.getRange(cursor.from(), cursor.to()).match(query);
- cursor.replace(text.replace(/\$(\d)/, function(w, i) {return match[i];}));
- } else cursor.replace(text);
- }
- });});
- } else {
- clearSearch(cm);
- var cursor = getSearchCursor(cm, query, cm.getCursor());
- function advance() {
- var start = cursor.from(), match;
- if (!(match = cursor.findNext())) {
- cursor = getSearchCursor(cm, query);
- if (!(match = cursor.findNext()) ||
- (start && cursor.from().line == start.line && cursor.from().ch == start.ch)) return;
- }
- cm.setSelection(cursor.from(), cursor.to());
- confirmDialog(cm, doReplaceConfirm, "Replace?",
- [function() {doReplace(match);}, advance]);
- }
- function doReplace(match) {
- cursor.replace(typeof query == "string" ? text :
- text.replace(/\$(\d)/, function(w, i) {return match[i];}));
- advance();
- }
- advance();
- }
- });
- });
- }
-
- CodeMirror.commands.find = function(cm) {clearSearch(cm); doSearch(cm);};
- CodeMirror.commands.findNext = doSearch;
- CodeMirror.commands.findPrev = function(cm) {doSearch(cm, true);};
- CodeMirror.commands.clearSearch = clearSearch;
- CodeMirror.commands.replace = replace;
- CodeMirror.commands.replaceAll = function(cm) {replace(cm, true);};
-})();
diff --git a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/searchcursor.js b/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/searchcursor.js
deleted file mode 100644
index c05f4886b8..0000000000
--- a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/searchcursor.js
+++ /dev/null
@@ -1,119 +0,0 @@
-(function(){
- function SearchCursor(cm, query, pos, caseFold) {
- this.atOccurrence = false; this.cm = cm;
- if (caseFold == null && typeof query == "string") caseFold = false;
-
- pos = pos ? cm.clipPos(pos) : {line: 0, ch: 0};
- this.pos = {from: pos, to: pos};
-
- // The matches method is filled in based on the type of query.
- // It takes a position and a direction, and returns an object
- // describing the next occurrence of the query, or null if no
- // more matches were found.
- if (typeof query != "string") { // Regexp match
- if (!query.global) query = new RegExp(query.source, query.ignoreCase ? "ig" : "g");
- this.matches = function(reverse, pos) {
- if (reverse) {
- query.lastIndex = 0;
- var line = cm.getLine(pos.line).slice(0, pos.ch), match = query.exec(line), start = 0;
- while (match) {
- start += match.index;
- line = line.slice(match.index);
- query.lastIndex = 0;
- var newmatch = query.exec(line);
- if (newmatch) match = newmatch;
- else break;
- start++;
- }
- } else {
- query.lastIndex = pos.ch;
- var line = cm.getLine(pos.line), match = query.exec(line),
- start = match && match.index;
- }
- if (match)
- return {from: {line: pos.line, ch: start},
- to: {line: pos.line, ch: start + match[0].length},
- match: match};
- };
- } else { // String query
- if (caseFold) query = query.toLowerCase();
- var fold = caseFold ? function(str){return str.toLowerCase();} : function(str){return str;};
- var target = query.split("\n");
- // Different methods for single-line and multi-line queries
- if (target.length == 1)
- this.matches = function(reverse, pos) {
- var line = fold(cm.getLine(pos.line)), len = query.length, match;
- if (reverse ? (pos.ch >= len && (match = line.lastIndexOf(query, pos.ch - len)) != -1)
- : (match = line.indexOf(query, pos.ch)) != -1)
- return {from: {line: pos.line, ch: match},
- to: {line: pos.line, ch: match + len}};
- };
- else
- this.matches = function(reverse, pos) {
- var ln = pos.line, idx = (reverse ? target.length - 1 : 0), match = target[idx], line = fold(cm.getLine(ln));
- var offsetA = (reverse ? line.indexOf(match) + match.length : line.lastIndexOf(match));
- if (reverse ? offsetA >= pos.ch || offsetA != match.length
- : offsetA <= pos.ch || offsetA != line.length - match.length)
- return;
- for (;;) {
- if (reverse ? !ln : ln == cm.lineCount() - 1) return;
- line = fold(cm.getLine(ln += reverse ? -1 : 1));
- match = target[reverse ? --idx : ++idx];
- if (idx > 0 && idx < target.length - 1) {
- if (line != match) return;
- else continue;
- }
- var offsetB = (reverse ? line.lastIndexOf(match) : line.indexOf(match) + match.length);
- if (reverse ? offsetB != line.length - match.length : offsetB != match.length)
- return;
- var start = {line: pos.line, ch: offsetA}, end = {line: ln, ch: offsetB};
- return {from: reverse ? end : start, to: reverse ? start : end};
- }
- };
- }
- }
-
- SearchCursor.prototype = {
- findNext: function() {return this.find(false);},
- findPrevious: function() {return this.find(true);},
-
- find: function(reverse) {
- var self = this, pos = this.cm.clipPos(reverse ? this.pos.from : this.pos.to);
- function savePosAndFail(line) {
- var pos = {line: line, ch: 0};
- self.pos = {from: pos, to: pos};
- self.atOccurrence = false;
- return false;
- }
-
- for (;;) {
- if (this.pos = this.matches(reverse, pos)) {
- this.atOccurrence = true;
- return this.pos.match || true;
- }
- if (reverse) {
- if (!pos.line) return savePosAndFail(0);
- pos = {line: pos.line-1, ch: this.cm.getLine(pos.line-1).length};
- }
- else {
- var maxLine = this.cm.lineCount();
- if (pos.line == maxLine - 1) return savePosAndFail(maxLine);
- pos = {line: pos.line+1, ch: 0};
- }
- }
- },
-
- from: function() {if (this.atOccurrence) return this.pos.from;},
- to: function() {if (this.atOccurrence) return this.pos.to;},
-
- replace: function(newText) {
- var self = this;
- if (this.atOccurrence)
- self.pos.to = this.cm.replaceRange(newText, self.pos.from, self.pos.to);
- }
- };
-
- CodeMirror.defineExtension("getSearchCursor", function(query, pos, caseFold) {
- return new SearchCursor(this, query, pos, caseFold);
- });
-})();
diff --git a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/simple-hint-customized.js b/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/simple-hint-customized.js
deleted file mode 100644
index 4771938758..0000000000
--- a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/simple-hint-customized.js
+++ /dev/null
@@ -1,86 +0,0 @@
-(function () {
- CodeMirror.simpleHint = function (editor, getHints) {
- // We want a single cursor position.
- if (editor.somethingSelected()) return;
- //don't show completion if the token is empty
- var tempToken = editor.getTokenAt(editor.getCursor());
- if (!(/[\S]/gi.test(tempToken.string))) return;
-
- var result = getHints(editor);
- if (!result || !result.list.length) return;
- var completions = result.list;
- function insert(str) {
- editor.replaceRange(str, result.from, result.to);
- }
- // When there is only one completion, use it directly.
- if (completions.length == 1) { insert(completions[0]); return true; }
-
- // Build the select widget
- var complete = document.createElement("div");
- complete.className = "CodeMirror-completions";
- var sel = complete.appendChild(document.createElement("select"));
- // Opera doesn't move the selection when pressing up/down in a
- // multi-select, but it does properly support the size property on
- // single-selects, so no multi-select is necessary.
- if (!window.opera) sel.multiple = true;
-
- for (var i = 0; i < completions.length; ++i) {
- var opt = sel.appendChild(document.createElement("option"));
- var completion = completions[i];
-
- if (typeof completion === 'object') {
- opt.appendChild(document.createTextNode(completion[0]));
- opt.setAttribute("value", completion[1]);
- }
- else if(typeof completion === 'string') {
- opt.appendChild(document.createTextNode(completion));
- opt.setAttribute("value", completion);
- }
- }
- sel.firstChild.selected = true;
- sel.size = Math.min(10, completions.length);
- var pos = editor.cursorCoords();
- complete.style.left = pos.x + "px";
- complete.style.top = pos.yBot + "px";
- document.body.appendChild(complete);
- // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.
- var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth);
- if (winW - pos.x < sel.clientWidth)
- complete.style.left = (pos.x - sel.clientWidth) + "px";
- // Hack to hide the scrollbar.
- if (completions.length <= 10)
- complete.style.width = (sel.clientWidth - 1) + "px";
-
- var done = false;
- function close() {
- if (done) return;
- done = true;
- complete.parentNode.removeChild(complete);
- }
- function pick() {
- insert(completions[sel.selectedIndex][1]);
- close();
- setTimeout(function () { editor.focus(); }, 50);
- }
- CodeMirror.connect(sel, "blur", close);
- CodeMirror.connect(sel, "keydown", function (event) {
- var code = event.keyCode;
- // Enter
- if (code == 13) { CodeMirror.e_stop(event); pick(); }
- // Escape
- else if (code == 27) { CodeMirror.e_stop(event); close(); editor.focus(); }
- else if (code != 38 && code != 40) {
- close(); editor.focus();
- // Pass the event to the CodeMirror instance so that it can handle things like backspace properly.
- editor.triggerOnKeyDown(event);
- setTimeout(function () { CodeMirror.simpleHint(editor, getHints); }, 50);
- }
- });
- CodeMirror.connect(sel, "dblclick", pick);
-
- sel.focus();
- // Opera sometimes ignores focusing a freshly created node
- if (window.opera) setTimeout(function () { if (!done) sel.focus(); }, 100);
- return true;
- };
-})();
diff --git a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/simple-hint.css b/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/simple-hint.css
deleted file mode 100644
index 1872bdebe7..0000000000
--- a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/simple-hint.css
+++ /dev/null
@@ -1,16 +0,0 @@
-.CodeMirror-completions {
- position: absolute;
- z-index: 10;
- overflow: hidden;
- -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
- -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
- box-shadow: 2px 3px 5px rgba(0,0,0,.2);
-}
-.CodeMirror-completions select {
- background: #fafafa;
- outline: none;
- border: none;
- padding: 0;
- margin: 0;
- font-family: monospace;
-}
diff --git a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/simple-hint.js b/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/simple-hint.js
deleted file mode 100644
index a481a0845f..0000000000
--- a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/simple-hint.js
+++ /dev/null
@@ -1,97 +0,0 @@
-(function() {
- CodeMirror.simpleHint = function(editor, getHints, givenOptions) {
- // Determine effective options based on given values and defaults.
- var options = {}, defaults = CodeMirror.simpleHint.defaults;
- for (var opt in defaults)
- if (defaults.hasOwnProperty(opt))
- options[opt] = (givenOptions && givenOptions.hasOwnProperty(opt) ? givenOptions : defaults)[opt];
-
- function collectHints(previousToken) {
- // We want a single cursor position.
- if (editor.somethingSelected()) return;
-
- var tempToken = editor.getTokenAt(editor.getCursor());
-
- // Don't show completions if token has changed and the option is set.
- if (options.closeOnTokenChange && previousToken != null &&
- (tempToken.start != previousToken.start || tempToken.className != previousToken.className)) {
- return;
- }
-
- var result = getHints(editor);
- if (!result || !result.list.length) return;
- var completions = result.list;
- function insert(str) {
- editor.replaceRange(str, result.from, result.to);
- }
- // When there is only one completion, use it directly.
- if (completions.length == 1) {insert(completions[0]); return true;}
-
- // Build the select widget
- var complete = document.createElement("div");
- complete.className = "CodeMirror-completions";
- var sel = complete.appendChild(document.createElement("select"));
- // Opera doesn't move the selection when pressing up/down in a
- // multi-select, but it does properly support the size property on
- // single-selects, so no multi-select is necessary.
- if (!window.opera) sel.multiple = true;
- for (var i = 0; i < completions.length; ++i) {
- var opt = sel.appendChild(document.createElement("option"));
- opt.appendChild(document.createTextNode(completions[i]));
- }
- sel.firstChild.selected = true;
- sel.size = Math.min(10, completions.length);
- var pos = editor.cursorCoords();
- complete.style.left = pos.x + "px";
- complete.style.top = pos.yBot + "px";
- document.body.appendChild(complete);
- // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.
- var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth);
- if(winW - pos.x < sel.clientWidth)
- complete.style.left = (pos.x - sel.clientWidth) + "px";
- // Hack to hide the scrollbar.
- if (completions.length <= 10)
- complete.style.width = (sel.clientWidth - 1) + "px";
-
- var done = false;
- function close() {
- if (done) return;
- done = true;
- complete.parentNode.removeChild(complete);
- }
- function pick() {
- insert(completions[sel.selectedIndex]);
- close();
- setTimeout(function(){editor.focus();}, 50);
- }
- CodeMirror.connect(sel, "blur", close);
- CodeMirror.connect(sel, "keydown", function(event) {
- var code = event.keyCode;
- // Enter
- if (code == 13) {CodeMirror.e_stop(event); pick();}
- // Escape
- else if (code == 27) {CodeMirror.e_stop(event); close(); editor.focus();}
- else if (code != 38 && code != 40 && code != 33 && code != 34) {
- close(); editor.focus();
- // Pass the event to the CodeMirror instance so that it can handle things like backspace properly.
- editor.triggerOnKeyDown(event);
- // Don't show completions if the code is backspace and the option is set.
- if (!options.closeOnBackspace || code != 8) {
- setTimeout(function(){collectHints(tempToken);}, 50);
- }
- }
- });
- CodeMirror.connect(sel, "dblclick", pick);
-
- sel.focus();
- // Opera sometimes ignores focusing a freshly created node
- if (window.opera) setTimeout(function(){if (!done) sel.focus();}, 100);
- return true;
- }
- return collectHints();
- };
- CodeMirror.simpleHint.defaults = {
- closeOnBackspace: true,
- closeOnTokenChange: false
- };
-})();
diff --git a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/xml-hint.js b/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/xml-hint.js
deleted file mode 100644
index f47855683d..0000000000
--- a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/lib/util/xml-hint.js
+++ /dev/null
@@ -1,137 +0,0 @@
-
-(function() {
-
- CodeMirror.xmlHints = [];
-
- CodeMirror.xmlHint = function(cm, simbol) {
-
- if(simbol.length > 0) {
- var cursor = cm.getCursor();
- cm.replaceSelection(simbol);
- cursor = {line: cursor.line, ch: cursor.ch + 1};
- cm.setCursor(cursor);
- }
-
- // dirty hack for simple-hint to receive getHint event on space
- var getTokenAt = editor.getTokenAt;
-
- editor.getTokenAt = function() { return 'disabled'; };
- CodeMirror.simpleHint(cm, getHint);
-
- editor.getTokenAt = getTokenAt;
- };
-
- var getHint = function(cm) {
-
- var cursor = cm.getCursor();
-
- if (cursor.ch > 0) {
-
- var text = cm.getRange({line: 0, ch: 0}, cursor);
- var typed = '';
- var simbol = '';
- for(var i = text.length - 1; i >= 0; i--) {
- if(text[i] == ' ' || text[i] == '<') {
- simbol = text[i];
- break;
- }
- else {
- typed = text[i] + typed;
- }
- }
-
- text = text.slice(0, text.length - typed.length);
-
- var path = getActiveElement(cm, text) + simbol;
- var hints = CodeMirror.xmlHints[path];
-
- if(typeof hints === 'undefined')
- hints = [''];
- else {
- hints = hints.slice(0);
- for (var i = hints.length - 1; i >= 0; i--) {
- if(hints[i].indexOf(typed) != 0)
- hints.splice(i, 1);
- }
- }
-
- return {
- list: hints,
- from: { line: cursor.line, ch: cursor.ch - typed.length },
- to: cursor
- };
- };
- };
-
- var getActiveElement = function(codeMirror, text) {
-
- var element = '';
-
- if(text.length >= 0) {
-
- var regex = new RegExp('<([^!?][^\\s/>]*).*?>', 'g');
-
- var matches = [];
- var match;
- while ((match = regex.exec(text)) != null) {
- matches.push({
- tag: match[1],
- selfclose: (match[0].slice(match[0].length - 2) === '/>')
- });
- }
-
- for (var i = matches.length - 1, skip = 0; i >= 0; i--) {
-
- var item = matches[i];
-
- if (item.tag[0] == '/')
- {
- skip++;
- }
- else if (item.selfclose == false)
- {
- if (skip > 0)
- {
- skip--;
- }
- else
- {
- element = '<' + item.tag + '>' + element;
- }
- }
- }
-
- element += getOpenTag(text);
- }
-
- return element;
- };
-
- var getOpenTag = function(text) {
-
- var open = text.lastIndexOf('<');
- var close = text.lastIndexOf('>');
-
- if (close < open)
- {
- text = text.slice(open);
-
- if(text != '<') {
-
- var space = text.indexOf(' ');
- if(space < 0)
- space = text.indexOf('\t');
- if(space < 0)
- space = text.indexOf('\n');
-
- if (space < 0)
- space = text.length;
-
- return text.slice(0, space);
- }
- }
-
- return '';
- };
-
-})();
diff --git a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/mode/clike/clike.js b/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/mode/clike/clike.js
deleted file mode 100644
index df90300b40..0000000000
--- a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/mode/clike/clike.js
+++ /dev/null
@@ -1,284 +0,0 @@
-CodeMirror.defineMode("clike", function(config, parserConfig) {
- var indentUnit = config.indentUnit,
- keywords = parserConfig.keywords || {},
- builtin = parserConfig.builtin || {},
- blockKeywords = parserConfig.blockKeywords || {},
- atoms = parserConfig.atoms || {},
- hooks = parserConfig.hooks || {},
- multiLineStrings = parserConfig.multiLineStrings;
- var isOperatorChar = /[+\-*&%=<>!?|\/]/;
-
- var curPunc;
-
- function tokenBase(stream, state) {
- var ch = stream.next();
- if (hooks[ch]) {
- var result = hooks[ch](stream, state);
- if (result !== false) return result;
- }
- if (ch == '"' || ch == "'") {
- state.tokenize = tokenString(ch);
- return state.tokenize(stream, state);
- }
- if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
- curPunc = ch;
- return null;
- }
- if (/\d/.test(ch)) {
- stream.eatWhile(/[\w\.]/);
- return "number";
- }
- if (ch == "/") {
- if (stream.eat("*")) {
- state.tokenize = tokenComment;
- return tokenComment(stream, state);
- }
- if (stream.eat("/")) {
- stream.skipToEnd();
- return "comment";
- }
- }
- if (isOperatorChar.test(ch)) {
- stream.eatWhile(isOperatorChar);
- return "operator";
- }
- stream.eatWhile(/[\w\$_]/);
- var cur = stream.current();
- if (keywords.propertyIsEnumerable(cur)) {
- if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
- return "keyword";
- }
- if (builtin.propertyIsEnumerable(cur)) {
- if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
- return "builtin";
- }
- if (atoms.propertyIsEnumerable(cur)) return "atom";
- 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 || multiLineStrings))
- state.tokenize = null;
- return "string";
- };
- }
-
- function tokenComment(stream, state) {
- var maybeEnd = false, ch;
- while (ch = stream.next()) {
- if (ch == "/" && maybeEnd) {
- state.tokenize = null;
- break;
- }
- maybeEnd = (ch == "*");
- }
- return "comment";
- }
-
- function Context(indented, column, type, align, prev) {
- this.indented = indented;
- this.column = column;
- this.type = type;
- this.align = align;
- this.prev = prev;
- }
- function pushContext(state, col, type) {
- return state.context = new Context(state.indented, col, type, null, state.context);
- }
- function popContext(state) {
- var t = state.context.type;
- if (t == ")" || t == "]" || t == "}")
- state.indented = state.context.indented;
- return state.context = state.context.prev;
- }
-
- // Interface
-
- return {
- startState: function(basecolumn) {
- return {
- tokenize: null,
- context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
- indented: 0,
- startOfLine: true
- };
- },
-
- token: function(stream, state) {
- var ctx = state.context;
- if (stream.sol()) {
- if (ctx.align == null) ctx.align = false;
- state.indented = stream.indentation();
- state.startOfLine = true;
- }
- if (stream.eatSpace()) return null;
- curPunc = null;
- var style = (state.tokenize || tokenBase)(stream, state);
- if (style == "comment" || style == "meta") return style;
- if (ctx.align == null) ctx.align = true;
-
- if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state);
- else if (curPunc == "{") pushContext(state, stream.column(), "}");
- else if (curPunc == "[") pushContext(state, stream.column(), "]");
- else if (curPunc == "(") pushContext(state, stream.column(), ")");
- else if (curPunc == "}") {
- while (ctx.type == "statement") ctx = popContext(state);
- if (ctx.type == "}") ctx = popContext(state);
- while (ctx.type == "statement") ctx = popContext(state);
- }
- else if (curPunc == ctx.type) popContext(state);
- else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement"))
- pushContext(state, stream.column(), "statement");
- state.startOfLine = false;
- return style;
- },
-
- indent: function(state, textAfter) {
- if (state.tokenize != tokenBase && state.tokenize != null) return 0;
- var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
- if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
- var closing = firstChar == ctx.type;
- if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : indentUnit);
- else if (ctx.align) return ctx.column + (closing ? 0 : 1);
- else return ctx.indented + (closing ? 0 : indentUnit);
- },
-
- electricChars: "{}"
- };
-});
-
-(function() {
- function words(str) {
- var obj = {}, words = str.split(" ");
- for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
- return obj;
- }
- var cKeywords = "auto if break int case long char register continue return default short do sizeof " +
- "double static else struct entry switch extern typedef float union for unsigned " +
- "goto while enum void const signed volatile";
-
- function cppHook(stream, state) {
- if (!state.startOfLine) return false;
- stream.skipToEnd();
- return "meta";
- }
-
- // C#-style strings where "" escapes a quote.
- function tokenAtString(stream, state) {
- var next;
- while ((next = stream.next()) != null) {
- if (next == '"' && !stream.eat('"')) {
- state.tokenize = null;
- break;
- }
- }
- return "string";
- }
-
- function mimes(ms, mode) {
- for (var i = 0; i < ms.length; ++i) CodeMirror.defineMIME(ms[i], mode);
- }
-
- mimes(["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}
- });
- mimes(["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 " +
- "this using const_cast inline public throw virtual delete mutable protected " +
- "wchar_t"),
- blockKeywords: words("catch class do else finally for if struct switch try while"),
- atoms: words("true false null"),
- hooks: {"#": cppHook}
- });
- CodeMirror.defineMIME("text/x-java", {
- name: "clike",
- keywords: words("abstract assert boolean break byte case catch char class const continue default " +
- "do double else enum extends final finally float for goto if implements import " +
- "instanceof int interface long native new package private protected public " +
- "return short static strictfp super switch synchronized this throw throws transient " +
- "try void volatile while"),
- blockKeywords: words("catch class do else finally for if switch try while"),
- atoms: words("true false null"),
- hooks: {
- "@": function(stream, state) {
- stream.eatWhile(/[\w\$_]/);
- return "meta";
- }
- }
- });
- CodeMirror.defineMIME("text/x-csharp", {
- name: "clike",
- keywords: words("abstract as base break case catch checked class const continue" +
- " default delegate do else enum event explicit extern finally fixed for" +
- " foreach goto if implicit in interface internal is lock namespace new" +
- " operator out override params private protected public readonly ref return sealed" +
- " sizeof stackalloc static struct switch this throw try typeof unchecked" +
- " unsafe using virtual void volatile while add alias ascending descending dynamic from get" +
- " global group into join let orderby partial remove select set value var yield"),
- blockKeywords: words("catch class do else finally for foreach if struct switch try while"),
- builtin: words("Boolean Byte Char DateTime DateTimeOffset Decimal Double" +
- " Guid Int16 Int32 Int64 Object SByte Single String TimeSpan UInt16 UInt32" +
- " UInt64 bool byte char decimal double short int long object" +
- " sbyte float string ushort uint ulong"),
- atoms: words("true false null"),
- hooks: {
- "@": function(stream, state) {
- if (stream.eat('"')) {
- state.tokenize = tokenAtString;
- return tokenAtString(stream, state);
- }
- stream.eatWhile(/[\w\$_]/);
- return "meta";
- }
- }
- });
- CodeMirror.defineMIME("text/x-scala", {
- name: "clike",
- keywords: words(
-
- /* scala */
- "abstract case catch class def do else extends false final finally for forSome if " +
- "implicit import lazy match new null object override package private protected return " +
- "sealed super this throw trait try trye type val var while with yield _ : = => <- <: " +
- "<% >: # @ " +
-
- /* package scala */
- "assert assume require print println printf readLine readBoolean readByte readShort " +
- "readChar readInt readLong readFloat readDouble " +
-
- "AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either " +
- "Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable " +
- "Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering " +
- "Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder " +
- "StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector :: #:: " +
-
- /* package java.lang */
- "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " +
- "Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " +
- "Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " +
- "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"
-
-
- ),
- blockKeywords: words("catch class do else finally for forSome if match switch try while"),
- atoms: words("true false null"),
- hooks: {
- "@": function(stream, state) {
- stream.eatWhile(/[\w\$_]/);
- return "meta";
- }
- }
- });
-}());
diff --git a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/mode/clike/index.html b/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/mode/clike/index.html
deleted file mode 100644
index ae86b9b603..0000000000
--- a/src/Umbraco.Web.UI/umbraco_client/CodeMirror/js/mode/clike/index.html
+++ /dev/null
@@ -1,102 +0,0 @@
-
-
-
-
- CodeMirror: C-like mode
-
-
-
-
-
-
-
-
CodeMirror: C-like mode
-
-
-
-
-
-
Simple mode that tries to handle C-like languages as well as it
- can. Takes two configuration parameters: keywords, an
- object whose property names are the keywords in the language,
- and useCPP, which determines whether C preprocessor
- directives are recognized.