summaryrefslogtreecommitdiff
path: root/public/vendor/codemirror/addon/lint
diff options
context:
space:
mode:
authorWu Cheng-Han2016-11-28 01:36:48 +0800
committerWu Cheng-Han2016-11-28 01:36:48 +0800
commit9f79ed929e4156dc8b5b45161895d70d51cfa5a2 (patch)
tree760e0491a52558036b93b0c986e96aa95b4c0127 /public/vendor/codemirror/addon/lint
parent3a305b8258782797b328f2ce46e8bb74e9603594 (diff)
Update to move custom CodeMirror codebase to our own repo and update webpack build config
Diffstat (limited to 'public/vendor/codemirror/addon/lint')
-rw-r--r--public/vendor/codemirror/addon/lint/coffeescript-lint.js41
-rw-r--r--public/vendor/codemirror/addon/lint/css-lint.js35
-rw-r--r--public/vendor/codemirror/addon/lint/html-lint.js46
-rw-r--r--public/vendor/codemirror/addon/lint/javascript-lint.js136
-rw-r--r--public/vendor/codemirror/addon/lint/json-lint.js31
-rw-r--r--public/vendor/codemirror/addon/lint/lint.css73
-rw-r--r--public/vendor/codemirror/addon/lint/lint.js239
-rw-r--r--public/vendor/codemirror/addon/lint/yaml-lint.js28
8 files changed, 0 insertions, 629 deletions
diff --git a/public/vendor/codemirror/addon/lint/coffeescript-lint.js b/public/vendor/codemirror/addon/lint/coffeescript-lint.js
deleted file mode 100644
index 7e39428f..00000000
--- a/public/vendor/codemirror/addon/lint/coffeescript-lint.js
+++ /dev/null
@@ -1,41 +0,0 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-// Depends on coffeelint.js from http://www.coffeelint.org/js/coffeelint.js
-
-// declare global: coffeelint
-
-(function(mod) {
- if (typeof exports == "object" && typeof module == "object") // CommonJS
- mod(require("../../lib/codemirror"));
- else if (typeof define == "function" && define.amd) // AMD
- define(["../../lib/codemirror"], mod);
- else // Plain browser env
- mod(CodeMirror);
-})(function(CodeMirror) {
-"use strict";
-
-CodeMirror.registerHelper("lint", "coffeescript", function(text) {
- var found = [];
- var parseError = function(err) {
- var loc = err.lineNumber;
- found.push({from: CodeMirror.Pos(loc-1, 0),
- to: CodeMirror.Pos(loc, 0),
- severity: err.level,
- message: err.message});
- };
- try {
- var res = coffeelint.lint(text);
- for(var i = 0; i < res.length; i++) {
- parseError(res[i]);
- }
- } catch(e) {
- found.push({from: CodeMirror.Pos(e.location.first_line, 0),
- to: CodeMirror.Pos(e.location.last_line, e.location.last_column),
- severity: 'error',
- message: e.message});
- }
- return found;
-});
-
-});
diff --git a/public/vendor/codemirror/addon/lint/css-lint.js b/public/vendor/codemirror/addon/lint/css-lint.js
deleted file mode 100644
index 1f61b479..00000000
--- a/public/vendor/codemirror/addon/lint/css-lint.js
+++ /dev/null
@@ -1,35 +0,0 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-// Depends on csslint.js from https://github.com/stubbornella/csslint
-
-// declare global: CSSLint
-
-(function(mod) {
- if (typeof exports == "object" && typeof module == "object") // CommonJS
- mod(require("../../lib/codemirror"));
- else if (typeof define == "function" && define.amd) // AMD
- define(["../../lib/codemirror"], mod);
- else // Plain browser env
- mod(CodeMirror);
-})(function(CodeMirror) {
-"use strict";
-
-CodeMirror.registerHelper("lint", "css", function(text) {
- var found = [];
- if (!window.CSSLint) return found;
- var results = CSSLint.verify(text), messages = results.messages, message = null;
- for ( var i = 0; i < messages.length; i++) {
- message = messages[i];
- var startLine = message.line -1, endLine = message.line -1, startCol = message.col -1, endCol = message.col;
- found.push({
- from: CodeMirror.Pos(startLine, startCol),
- to: CodeMirror.Pos(endLine, endCol),
- message: message.message,
- severity : message.type
- });
- }
- return found;
-});
-
-});
diff --git a/public/vendor/codemirror/addon/lint/html-lint.js b/public/vendor/codemirror/addon/lint/html-lint.js
deleted file mode 100644
index 1e841709..00000000
--- a/public/vendor/codemirror/addon/lint/html-lint.js
+++ /dev/null
@@ -1,46 +0,0 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-// Depends on htmlhint.js from http://htmlhint.com/js/htmlhint.js
-
-// declare global: HTMLHint
-
-(function(mod) {
- if (typeof exports == "object" && typeof module == "object") // CommonJS
- mod(require("../../lib/codemirror"), require("htmlhint"));
- else if (typeof define == "function" && define.amd) // AMD
- define(["../../lib/codemirror", "htmlhint"], mod);
- else // Plain browser env
- mod(CodeMirror);
-})(function(CodeMirror) {
- "use strict";
-
- var defaultRules = {
- "tagname-lowercase": true,
- "attr-lowercase": true,
- "attr-value-double-quotes": true,
- "doctype-first": false,
- "tag-pair": true,
- "spec-char-escape": true,
- "id-unique": true,
- "src-not-empty": true,
- "attr-no-duplication": true
- };
-
- CodeMirror.registerHelper("lint", "html", function(text, options) {
- var found = [];
- if (!window.HTMLHint) return found;
- var messages = HTMLHint.verify(text, options && options.rules || defaultRules);
- for (var i = 0; i < messages.length; i++) {
- var message = messages[i];
- var startLine = message.line - 1, endLine = message.line - 1, startCol = message.col - 1, endCol = message.col;
- found.push({
- from: CodeMirror.Pos(startLine, startCol),
- to: CodeMirror.Pos(endLine, endCol),
- message: message.message,
- severity : message.type
- });
- }
- return found;
- });
-});
diff --git a/public/vendor/codemirror/addon/lint/javascript-lint.js b/public/vendor/codemirror/addon/lint/javascript-lint.js
deleted file mode 100644
index d4f2ae9a..00000000
--- a/public/vendor/codemirror/addon/lint/javascript-lint.js
+++ /dev/null
@@ -1,136 +0,0 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
- if (typeof exports == "object" && typeof module == "object") // CommonJS
- mod(require("../../lib/codemirror"));
- else if (typeof define == "function" && define.amd) // AMD
- define(["../../lib/codemirror"], mod);
- else // Plain browser env
- mod(CodeMirror);
-})(function(CodeMirror) {
- "use strict";
- // declare global: JSHINT
-
- var bogus = [ "Dangerous comment" ];
-
- var warnings = [ [ "Expected '{'",
- "Statement body should be inside '{ }' braces." ] ];
-
- var errors = [ "Missing semicolon", "Extra comma", "Missing property name",
- "Unmatched ", " and instead saw", " is not defined",
- "Unclosed string", "Stopping, unable to continue" ];
-
- function validator(text, options) {
- if (!window.JSHINT) return [];
- JSHINT(text, options, options.globals);
- var errors = JSHINT.data().errors, result = [];
- if (errors) parseErrors(errors, result);
- return result;
- }
-
- CodeMirror.registerHelper("lint", "javascript", validator);
-
- function cleanup(error) {
- // All problems are warnings by default
- fixWith(error, warnings, "warning", true);
- fixWith(error, errors, "error");
-
- return isBogus(error) ? null : error;
- }
-
- function fixWith(error, fixes, severity, force) {
- var description, fix, find, replace, found;
-
- description = error.description;
-
- for ( var i = 0; i < fixes.length; i++) {
- fix = fixes[i];
- find = (typeof fix === "string" ? fix : fix[0]);
- replace = (typeof fix === "string" ? null : fix[1]);
- found = description.indexOf(find) !== -1;
-
- if (force || found) {
- error.severity = severity;
- }
- if (found && replace) {
- error.description = replace;
- }
- }
- }
-
- function isBogus(error) {
- var description = error.description;
- for ( var i = 0; i < bogus.length; i++) {
- if (description.indexOf(bogus[i]) !== -1) {
- return true;
- }
- }
- return false;
- }
-
- function parseErrors(errors, output) {
- for ( var i = 0; i < errors.length; i++) {
- var error = errors[i];
- if (error) {
- var linetabpositions, index;
-
- linetabpositions = [];
-
- // This next block is to fix a problem in jshint. Jshint
- // replaces
- // all tabs with spaces then performs some checks. The error
- // positions (character/space) are then reported incorrectly,
- // not taking the replacement step into account. Here we look
- // at the evidence line and try to adjust the character position
- // to the correct value.
- if (error.evidence) {
- // Tab positions are computed once per line and cached
- var tabpositions = linetabpositions[error.line];
- if (!tabpositions) {
- var evidence = error.evidence;
- tabpositions = [];
- // ugggh phantomjs does not like this
- // forEachChar(evidence, function(item, index) {
- Array.prototype.forEach.call(evidence, function(item,
- index) {
- if (item === '\t') {
- // First col is 1 (not 0) to match error
- // positions
- tabpositions.push(index + 1);
- }
- });
- linetabpositions[error.line] = tabpositions;
- }
- if (tabpositions.length > 0) {
- var pos = error.character;
- tabpositions.forEach(function(tabposition) {
- if (pos > tabposition) pos -= 1;
- });
- error.character = pos;
- }
- }
-
- var start = error.character - 1, end = start + 1;
- if (error.evidence) {
- index = error.evidence.substring(start).search(/.\b/);
- if (index > -1) {
- end += index;
- }
- }
-
- // Convert to format expected by validation service
- error.description = error.reason;// + "(jshint)";
- error.start = error.character;
- error.end = end;
- error = cleanup(error);
-
- if (error)
- output.push({message: error.description,
- severity: error.severity,
- from: CodeMirror.Pos(error.line - 1, start),
- to: CodeMirror.Pos(error.line - 1, end)});
- }
- }
- }
-});
diff --git a/public/vendor/codemirror/addon/lint/json-lint.js b/public/vendor/codemirror/addon/lint/json-lint.js
deleted file mode 100644
index 9dbb616b..00000000
--- a/public/vendor/codemirror/addon/lint/json-lint.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-// Depends on jsonlint.js from https://github.com/zaach/jsonlint
-
-// declare global: jsonlint
-
-(function(mod) {
- if (typeof exports == "object" && typeof module == "object") // CommonJS
- mod(require("../../lib/codemirror"));
- else if (typeof define == "function" && define.amd) // AMD
- define(["../../lib/codemirror"], mod);
- else // Plain browser env
- mod(CodeMirror);
-})(function(CodeMirror) {
-"use strict";
-
-CodeMirror.registerHelper("lint", "json", function(text) {
- var found = [];
- jsonlint.parseError = function(str, hash) {
- var loc = hash.loc;
- found.push({from: CodeMirror.Pos(loc.first_line - 1, loc.first_column),
- to: CodeMirror.Pos(loc.last_line - 1, loc.last_column),
- message: str});
- };
- try { jsonlint.parse(text); }
- catch(e) {}
- return found;
-});
-
-});
diff --git a/public/vendor/codemirror/addon/lint/lint.css b/public/vendor/codemirror/addon/lint/lint.css
deleted file mode 100644
index f097cfe3..00000000
--- a/public/vendor/codemirror/addon/lint/lint.css
+++ /dev/null
@@ -1,73 +0,0 @@
-/* The lint marker gutter */
-.CodeMirror-lint-markers {
- width: 16px;
-}
-
-.CodeMirror-lint-tooltip {
- background-color: #ffd;
- border: 1px solid black;
- border-radius: 4px 4px 4px 4px;
- color: black;
- font-family: monospace;
- font-size: 10pt;
- overflow: hidden;
- padding: 2px 5px;
- position: fixed;
- white-space: pre;
- white-space: pre-wrap;
- z-index: 100;
- max-width: 600px;
- opacity: 0;
- transition: opacity .4s;
- -moz-transition: opacity .4s;
- -webkit-transition: opacity .4s;
- -o-transition: opacity .4s;
- -ms-transition: opacity .4s;
-}
-
-.CodeMirror-lint-mark-error, .CodeMirror-lint-mark-warning {
- background-position: left bottom;
- background-repeat: repeat-x;
-}
-
-.CodeMirror-lint-mark-error {
- background-image:
- url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==")
- ;
-}
-
-.CodeMirror-lint-mark-warning {
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=");
-}
-
-.CodeMirror-lint-marker-error, .CodeMirror-lint-marker-warning {
- background-position: center center;
- background-repeat: no-repeat;
- cursor: pointer;
- display: inline-block;
- height: 16px;
- width: 16px;
- vertical-align: middle;
- position: relative;
-}
-
-.CodeMirror-lint-message-error, .CodeMirror-lint-message-warning {
- padding-left: 18px;
- background-position: top left;
- background-repeat: no-repeat;
-}
-
-.CodeMirror-lint-marker-error, .CodeMirror-lint-message-error {
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII=");
-}
-
-.CodeMirror-lint-marker-warning, .CodeMirror-lint-message-warning {
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII=");
-}
-
-.CodeMirror-lint-marker-multiple {
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC");
- background-repeat: no-repeat;
- background-position: right bottom;
- width: 100%; height: 100%;
-}
diff --git a/public/vendor/codemirror/addon/lint/lint.js b/public/vendor/codemirror/addon/lint/lint.js
deleted file mode 100644
index e3a45276..00000000
--- a/public/vendor/codemirror/addon/lint/lint.js
+++ /dev/null
@@ -1,239 +0,0 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
- if (typeof exports == "object" && typeof module == "object") // CommonJS
- mod(require("../../lib/codemirror"));
- else if (typeof define == "function" && define.amd) // AMD
- define(["../../lib/codemirror"], mod);
- else // Plain browser env
- mod(CodeMirror);
-})(function(CodeMirror) {
- "use strict";
- var GUTTER_ID = "CodeMirror-lint-markers";
-
- function showTooltip(e, content) {
- var tt = document.createElement("div");
- tt.className = "CodeMirror-lint-tooltip";
- tt.appendChild(content.cloneNode(true));
- document.body.appendChild(tt);
-
- function position(e) {
- if (!tt.parentNode) return CodeMirror.off(document, "mousemove", position);
- tt.style.top = Math.max(0, e.clientY - tt.offsetHeight - 5) + "px";
- tt.style.left = (e.clientX + 5) + "px";
- }
- CodeMirror.on(document, "mousemove", position);
- position(e);
- if (tt.style.opacity != null) tt.style.opacity = 1;
- return tt;
- }
- function rm(elt) {
- if (elt.parentNode) elt.parentNode.removeChild(elt);
- }
- function hideTooltip(tt) {
- if (!tt.parentNode) return;
- if (tt.style.opacity == null) rm(tt);
- tt.style.opacity = 0;
- setTimeout(function() { rm(tt); }, 600);
- }
-
- function showTooltipFor(e, content, node) {
- var tooltip = showTooltip(e, content);
- function hide() {
- CodeMirror.off(node, "mouseout", hide);
- if (tooltip) { hideTooltip(tooltip); tooltip = null; }
- }
- var poll = setInterval(function() {
- if (tooltip) for (var n = node;; n = n.parentNode) {
- if (n && n.nodeType == 11) n = n.host;
- if (n == document.body) return;
- if (!n) { hide(); break; }
- }
- if (!tooltip) return clearInterval(poll);
- }, 400);
- CodeMirror.on(node, "mouseout", hide);
- }
-
- function LintState(cm, options, hasGutter) {
- this.marked = [];
- this.options = options;
- this.timeout = null;
- this.hasGutter = hasGutter;
- this.onMouseOver = function(e) { onMouseOver(cm, e); };
- this.waitingFor = 0
- }
-
- function parseOptions(_cm, options) {
- if (options instanceof Function) return {getAnnotations: options};
- if (!options || options === true) options = {};
- return options;
- }
-
- function clearMarks(cm) {
- var state = cm.state.lint;
- if (state.hasGutter) cm.clearGutter(GUTTER_ID);
- for (var i = 0; i < state.marked.length; ++i)
- state.marked[i].clear();
- state.marked.length = 0;
- }
-
- function makeMarker(labels, severity, multiple, tooltips) {
- var marker = document.createElement("div"), inner = marker;
- marker.className = "CodeMirror-lint-marker-" + severity;
- if (multiple) {
- inner = marker.appendChild(document.createElement("div"));
- inner.className = "CodeMirror-lint-marker-multiple";
- }
-
- if (tooltips != false) CodeMirror.on(inner, "mouseover", function(e) {
- showTooltipFor(e, labels, inner);
- });
-
- return marker;
- }
-
- function getMaxSeverity(a, b) {
- if (a == "error") return a;
- else return b;
- }
-
- function groupByLine(annotations) {
- var lines = [];
- for (var i = 0; i < annotations.length; ++i) {
- var ann = annotations[i], line = ann.from.line;
- (lines[line] || (lines[line] = [])).push(ann);
- }
- return lines;
- }
-
- function annotationTooltip(ann) {
- var severity = ann.severity;
- if (!severity) severity = "error";
- var tip = document.createElement("div");
- tip.className = "CodeMirror-lint-message-" + severity;
- tip.appendChild(document.createTextNode(ann.message));
- return tip;
- }
-
- function lintAsync(cm, getAnnotations, passOptions) {
- var state = cm.state.lint
- var id = ++state.waitingFor
- function abort() {
- id = -1
- cm.off("change", abort)
- }
- cm.on("change", abort)
- getAnnotations(cm.getValue(), function(annotations, arg2) {
- cm.off("change", abort)
- if (state.waitingFor != id) return
- if (arg2 && annotations instanceof CodeMirror) annotations = arg2
- updateLinting(cm, annotations)
- }, passOptions, cm);
- }
-
- function startLinting(cm) {
- var state = cm.state.lint, options = state.options;
- var passOptions = options.options || options; // Support deprecated passing of `options` property in options
- var getAnnotations = options.getAnnotations || cm.getHelper(CodeMirror.Pos(0, 0), "lint");
- if (!getAnnotations) return;
- if (options.async || getAnnotations.async) {
- lintAsync(cm, getAnnotations, passOptions)
- } else {
- updateLinting(cm, getAnnotations(cm.getValue(), passOptions, cm));
- }
- }
-
- function updateLinting(cm, annotationsNotSorted) {
- clearMarks(cm);
- var state = cm.state.lint, options = state.options;
-
- var annotations = groupByLine(annotationsNotSorted);
-
- for (var line = 0; line < annotations.length; ++line) {
- var anns = annotations[line];
- if (!anns) continue;
-
- var maxSeverity = null;
- var tipLabel = state.hasGutter && document.createDocumentFragment();
-
- for (var i = 0; i < anns.length; ++i) {
- var ann = anns[i];
- var severity = ann.severity;
- if (!severity) severity = "error";
- maxSeverity = getMaxSeverity(maxSeverity, severity);
-
- if (options.formatAnnotation) ann = options.formatAnnotation(ann);
- if (state.hasGutter) tipLabel.appendChild(annotationTooltip(ann));
-
- if (ann.to) state.marked.push(cm.markText(ann.from, ann.to, {
- className: "CodeMirror-lint-mark-" + severity,
- __annotation: ann
- }));
- }
-
- if (state.hasGutter)
- cm.setGutterMarker(line, GUTTER_ID, makeMarker(tipLabel, maxSeverity, anns.length > 1,
- state.options.tooltips));
- }
- if (options.onUpdateLinting) options.onUpdateLinting(annotationsNotSorted, annotations, cm);
- }
-
- function onChange(cm) {
- var state = cm.state.lint;
- if (!state) return;
- clearTimeout(state.timeout);
- state.timeout = setTimeout(function(){startLinting(cm);}, state.options.delay || 500);
- }
-
- function popupTooltips(annotations, e) {
- var target = e.target || e.srcElement;
- var tooltip = document.createDocumentFragment();
- for (var i = 0; i < annotations.length; i++) {
- var ann = annotations[i];
- tooltip.appendChild(annotationTooltip(ann));
- }
- showTooltipFor(e, tooltip, target);
- }
-
- function onMouseOver(cm, e) {
- var target = e.target || e.srcElement;
- if (!/\bCodeMirror-lint-mark-/.test(target.className)) return;
- var box = target.getBoundingClientRect(), x = (box.left + box.right) / 2, y = (box.top + box.bottom) / 2;
- var spans = cm.findMarksAt(cm.coordsChar({left: x, top: y}, "client"));
-
- var annotations = [];
- for (var i = 0; i < spans.length; ++i) {
- var ann = spans[i].__annotation;
- if (ann) annotations.push(ann);
- }
- if (annotations.length) popupTooltips(annotations, e);
- }
-
- CodeMirror.defineOption("lint", false, function(cm, val, old) {
- if (old && old != CodeMirror.Init) {
- clearMarks(cm);
- if (cm.state.lint.options.lintOnChange !== false)
- cm.off("change", onChange);
- CodeMirror.off(cm.getWrapperElement(), "mouseover", cm.state.lint.onMouseOver);
- clearTimeout(cm.state.lint.timeout);
- delete cm.state.lint;
- }
-
- if (val) {
- var gutters = cm.getOption("gutters"), hasLintGutter = false;
- for (var i = 0; i < gutters.length; ++i) if (gutters[i] == GUTTER_ID) hasLintGutter = true;
- var state = cm.state.lint = new LintState(cm, parseOptions(cm, val), hasLintGutter);
- if (state.options.lintOnChange !== false)
- cm.on("change", onChange);
- if (state.options.tooltips != false)
- CodeMirror.on(cm.getWrapperElement(), "mouseover", state.onMouseOver);
-
- startLinting(cm);
- }
- });
-
- CodeMirror.defineExtension("performLint", function() {
- if (this.state.lint) startLinting(this);
- });
-});
diff --git a/public/vendor/codemirror/addon/lint/yaml-lint.js b/public/vendor/codemirror/addon/lint/yaml-lint.js
deleted file mode 100644
index 3f77e525..00000000
--- a/public/vendor/codemirror/addon/lint/yaml-lint.js
+++ /dev/null
@@ -1,28 +0,0 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
- if (typeof exports == "object" && typeof module == "object") // CommonJS
- mod(require("../../lib/codemirror"));
- else if (typeof define == "function" && define.amd) // AMD
- define(["../../lib/codemirror"], mod);
- else // Plain browser env
- mod(CodeMirror);
-})(function(CodeMirror) {
-"use strict";
-
-// Depends on js-yaml.js from https://github.com/nodeca/js-yaml
-
-// declare global: jsyaml
-
-CodeMirror.registerHelper("lint", "yaml", function(text) {
- var found = [];
- try { jsyaml.load(text); }
- catch(e) {
- var loc = e.mark;
- found.push({ from: CodeMirror.Pos(loc.line, loc.column), to: CodeMirror.Pos(loc.line, loc.column), message: e.message });
- }
- return found;
-});
-
-});