PluginProbe
Smart Grid-Layout Design for Contact Form 7 / 3.3.4
Smart Grid-Layout Design for Contact Form 7 v3.3.4
4.18.0 4.17.0 3.2.0 3.2.1 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 4.0.0 4.0.1 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4 4.10 4.11 4.12 4.13 4.14 All 119 releases
cf7-grid-layout / assets / codemirror / addon / lint / css-lint.js

css-lint.js in Smart Grid-Layout Design for Contact Form 7 3.3.4, at assets/codemirror/addon/lint/css-lint.js

41 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 // Distributed under an MIT license: http://codemirror.net/LICENSE
3
4 // Depends on csslint.js from https://github.com/stubbornella/csslint
5
6 // declare global: CSSLint
7
8 (function(mod) {
9 if (typeof exports == "object" && typeof module == "object") // CommonJS
10 mod(require("../../lib/codemirror"));
11 else if (typeof define == "function" && define.amd) // AMD
12 define(["../../lib/codemirror"], mod);
13 else // Plain browser env
14 mod(CodeMirror);
15 })(function(CodeMirror) {
16 "use strict";
17
18 CodeMirror.registerHelper("lint", "css", function(text, options) {
19 var found = [];
20 if (!window.CSSLint) {
21 if (window.console) {
22 window.console.error("Error: window.CSSLint not defined, CodeMirror CSS linting cannot run.");
23 }
24 return found;
25 }
26 var results = CSSLint.verify(text, options), messages = results.messages, message = null;
27 for ( var i = 0; i < messages.length; i++) {
28 message = messages[i];
29 var startLine = message.line -1, endLine = message.line -1, startCol = message.col -1, endCol = message.col;
30 found.push({
31 from: CodeMirror.Pos(startLine, startCol),
32 to: CodeMirror.Pos(endLine, endCol),
33 message: message.message,
34 severity : message.type
35 });
36 }
37 return found;
38 });
39
40 });
41