Debian Codegraph @

extensions/CodeEditor/modules/lib/ace/mode-less.js

raw symbols SCIP
1 ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
2 var oop = require("../lib/oop");
3 var lang = require("../lib/lang");
4 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
5 var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|max-zoom|min-height|min-width|min-zoom|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|user-select|user-zoom|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index";
6 var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
7 var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|flex-end|flex-start|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero|zoom";
8 var supportConstantColor = exports.supportConstantColor = "aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen";
9 var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace";
10 var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))";
11 var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
12 var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
13 var CssHighlightRules = function () {
14 var keywordMapper = this.createKeywordMapper({
15 "support.function": supportFunction,
16 "support.constant": supportConstant,
17 "support.type": supportType,
18 "support.constant.color": supportConstantColor,
19 "support.constant.fonts": supportConstantFonts
20 }, "text", true);
21 this.$rules = {
22 "start": [{
23 include: ["strings", "url", "comments"]
24 }, {
25 token: "paren.lparen",
26 regex: "\\{",
27 next: "ruleset"
28 }, {
29 token: "paren.rparen",
30 regex: "\\}"
31 }, {
32 token: "string",
33 regex: "@(?!viewport)",
34 next: "media"
35 }, {
36 token: "keyword",
37 regex: "#[a-z0-9-_]+"
38 }, {
39 token: "keyword",
40 regex: "%"
41 }, {
42 token: "variable",
43 regex: "\\.[a-z0-9-_]+"
44 }, {
45 token: "string",
46 regex: ":[a-z0-9-_]+"
47 }, {
48 token: "constant.numeric",
49 regex: numRe
50 }, {
51 token: "constant",
52 regex: "[a-z0-9-_]+"
53 }, {
54 caseInsensitive: true
55 }],
56 "media": [{
57 include: ["strings", "url", "comments"]
58 }, {
59 token: "paren.lparen",
60 regex: "\\{",
61 next: "start"
62 }, {
63 token: "paren.rparen",
64 regex: "\\}",
65 next: "start"
66 }, {
67 token: "string",
68 regex: ";",
69 next: "start"
70 }, {
71 token: "keyword",
72 regex: "(?:media|supports|document|charset|import|namespace|media|supports|document"
73 + "|page|font|keyframes|viewport|counter-style|font-feature-values"
74 + "|swash|ornaments|annotation|stylistic|styleset|character-variant)"
75 }],
76 "comments": [{
77 token: "comment", // multi line comment
78 regex: "\\/\\*",
79 push: [{
80 token: "comment",
81 regex: "\\*\\/",
82 next: "pop"
83 }, {
84 defaultToken: "comment"
85 }]
86 }],
87 "ruleset": [{
88 regex: "-(webkit|ms|moz|o)-",
89 token: "text"
90 }, {
91 token: "punctuation.operator",
92 regex: "[:;]"
93 }, {
94 token: "paren.rparen",
95 regex: "\\}",
96 next: "start"
97 }, {
98 include: ["strings", "url", "comments"]
99 }, {
100 token: ["constant.numeric", "keyword"],
101 regex: "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vmax|vmin|vm|vw|%)"
102 }, {
103 token: "constant.numeric",
104 regex: numRe
105 }, {
106 token: "constant.numeric", // hex6 color
107 regex: "#[a-f0-9]{6}"
108 }, {
109 token: "constant.numeric", // hex3 color
110 regex: "#[a-f0-9]{3}"
111 }, {
112 token: ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
113 regex: pseudoElements
114 }, {
115 token: ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
116 regex: pseudoClasses
117 }, {
118 include: "url"
119 }, {
120 token: keywordMapper,
121 regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
122 }, {
123 caseInsensitive: true
124 }],
125 url: [{
126 token: "support.function",
127 regex: "(?:url(:?-prefix)?|domain|regexp)\\(",
128 push: [{
129 token: "support.function",
130 regex: "\\)",
131 next: "pop"
132 }, {
133 defaultToken: "string"
134 }]
135 }],
136 strings: [{
137 token: "string.start",
138 regex: "'",
139 push: [{
140 token: "string.end",
141 regex: "'|$",
142 next: "pop"
143 }, {
144 include: "escapes"
145 }, {
146 token: "constant.language.escape",
147 regex: /\\$/,
148 consumeLineEnd: true
149 }, {
150 defaultToken: "string"
151 }]
152 }, {
153 token: "string.start",
154 regex: '"',
155 push: [{
156 token: "string.end",
157 regex: '"|$',
158 next: "pop"
159 }, {
160 include: "escapes"
161 }, {
162 token: "constant.language.escape",
163 regex: /\\$/,
164 consumeLineEnd: true
165 }, {
166 defaultToken: "string"
167 }]
168 }],
169 escapes: [{
170 token: "constant.language.escape",
171 regex: /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/
172 }]
173 };
174 this.normalizeRules();
175 };
176 oop.inherits(CssHighlightRules, TextHighlightRules);
177 exports.CssHighlightRules = CssHighlightRules;
178
179 });
180
181 ace.define("ace/mode/less_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules","ace/mode/css_highlight_rules"], function(require, exports, module){"use strict";
182 var oop = require("../lib/oop");
183 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
184 var CssHighlightRules = require('./css_highlight_rules');
185 var LessHighlightRules = function () {
186 var keywordList = "@import|@media|@font-face|@keyframes|@-webkit-keyframes|@supports|" +
187 "@charset|@plugin|@namespace|@document|@page|@viewport|@-ms-viewport|" +
188 "or|and|when|not";
189 var keywords = keywordList.split('|');
190 var properties = CssHighlightRules.supportType.split('|');
191 var keywordMapper = this.createKeywordMapper({
192 "support.constant": CssHighlightRules.supportConstant,
193 "keyword": keywordList,
194 "support.constant.color": CssHighlightRules.supportConstantColor,
195 "support.constant.fonts": CssHighlightRules.supportConstantFonts
196 }, "identifier", true);
197 var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
198 this.$rules = {
199 "start": [
200 {
201 token: "comment",
202 regex: "\\/\\/.*$"
203 },
204 {
205 token: "comment", // multi line comment
206 regex: "\\/\\*",
207 next: "comment"
208 }, {
209 token: "string", // single line
210 regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
211 }, {
212 token: "string", // single line
213 regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
214 }, {
215 token: ["constant.numeric", "keyword"],
216 regex: "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)"
217 }, {
218 token: "constant.numeric", // hex6 color
219 regex: "#[a-f0-9]{6}"
220 }, {
221 token: "constant.numeric", // hex3 color
222 regex: "#[a-f0-9]{3}"
223 }, {
224 token: "constant.numeric",
225 regex: numRe
226 }, {
227 token: ["support.function", "paren.lparen", "string", "paren.rparen"],
228 regex: "(url)(\\()(.*)(\\))"
229 }, {
230 token: ["support.function", "paren.lparen"],
231 regex: "(:extend|[a-z0-9_\\-]+)(\\()"
232 }, {
233 token: function (value) {
234 if (keywords.indexOf(value.toLowerCase()) > -1)
235 return "keyword";
236 else
237 return "variable";
238 },
239 regex: "[@\\$][a-z0-9_\\-@\\$]*\\b"
240 }, {
241 token: "variable",
242 regex: "[@\\$]\\{[a-z0-9_\\-@\\$]*\\}"
243 }, {
244 token: function (first, second) {
245 if (properties.indexOf(first.toLowerCase()) > -1) {
246 return ["support.type.property", "text"];
247 }
248 else {
249 return ["support.type.unknownProperty", "text"];
250 }
251 },
252 regex: "([a-z0-9-_]+)(\\s*:)"
253 }, {
254 token: "keyword",
255 regex: "&" // special case - always treat as keyword
256 }, {
257 token: keywordMapper,
258 regex: "\\-?[@a-z_][@a-z0-9_\\-]*"
259 }, {
260 token: "variable.language",
261 regex: "#[a-z0-9-_]+"
262 }, {
263 token: "variable.language",
264 regex: "\\.[a-z0-9-_]+"
265 }, {
266 token: "variable.language",
267 regex: ":[a-z_][a-z0-9-_]*"
268 }, {
269 token: "constant",
270 regex: "[a-z0-9-_]+"
271 }, {
272 token: "keyword.operator",
273 regex: "<|>|<=|>=|=|!=|-|%|\\+|\\*"
274 }, {
275 token: "paren.lparen",
276 regex: "[[({]"
277 }, {
278 token: "paren.rparen",
279 regex: "[\\])}]"
280 }, {
281 token: "text",
282 regex: "\\s+"
283 }, {
284 caseInsensitive: true
285 }
286 ],
287 "comment": [
288 {
289 token: "comment", // closing comment
290 regex: "\\*\\/",
291 next: "start"
292 }, {
293 defaultToken: "comment"
294 }
295 ]
296 };
297 this.normalizeRules();
298 };
299 oop.inherits(LessHighlightRules, TextHighlightRules);
300 exports.LessHighlightRules = LessHighlightRules;
301
302 });
303
304 ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
305 var Range = require("../range").Range;
306 var MatchingBraceOutdent = function () { };
307 (function () {
308 this.checkOutdent = function (line, input) {
309 if (!/^\s+$/.test(line))
310 return false;
311 return /^\s*\}/.test(input);
312 };
313 this.autoOutdent = function (doc, row) {
314 var line = doc.getLine(row);
315 var match = line.match(/^(\s*\})/);
316 if (!match)
317 return 0;
318 var column = match[1].length;
319 var openBracePos = doc.findMatchingBracket({ row: row, column: column });
320 if (!openBracePos || openBracePos.row == row)
321 return 0;
322 var indent = this.$getIndent(doc.getLine(openBracePos.row));
323 doc.replace(new Range(row, 0, row, column - 1), indent);
324 };
325 this.$getIndent = function (line) {
326 return line.match(/^\s*/)[0];
327 };
328 }).call(MatchingBraceOutdent.prototype);
329 exports.MatchingBraceOutdent = MatchingBraceOutdent;
330
331 });
332
333 ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module){"use strict";
334 var oop = require("../../lib/oop");
335 var Behaviour = require("../behaviour").Behaviour;
336 var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
337 var TokenIterator = require("../../token_iterator").TokenIterator;
338 var CssBehaviour = function () {
339 this.inherit(CstyleBehaviour);
340 this.add("colon", "insertion", function (state, action, editor, session, text) {
341 if (text === ':' && editor.selection.isEmpty()) {
342 var cursor = editor.getCursorPosition();
343 var iterator = new TokenIterator(session, cursor.row, cursor.column);
344 var token = iterator.getCurrentToken();
345 if (token && token.value.match(/\s+/)) {
346 token = iterator.stepBackward();
347 }
348 if (token && token.type === 'support.type') {
349 var line = session.doc.getLine(cursor.row);
350 var rightChar = line.substring(cursor.column, cursor.column + 1);
351 if (rightChar === ':') {
352 return {
353 text: '',
354 selection: [1, 1]
355 };
356 }
357 if (/^(\s+[^;]|\s*$)/.test(line.substring(cursor.column))) {
358 return {
359 text: ':;',
360 selection: [1, 1]
361 };
362 }
363 }
364 }
365 });
366 this.add("colon", "deletion", function (state, action, editor, session, range) {
367 var selected = session.doc.getTextRange(range);
368 if (!range.isMultiLine() && selected === ':') {
369 var cursor = editor.getCursorPosition();
370 var iterator = new TokenIterator(session, cursor.row, cursor.column);
371 var token = iterator.getCurrentToken();
372 if (token && token.value.match(/\s+/)) {
373 token = iterator.stepBackward();
374 }
375 if (token && token.type === 'support.type') {
376 var line = session.doc.getLine(range.start.row);
377 var rightChar = line.substring(range.end.column, range.end.column + 1);
378 if (rightChar === ';') {
379 range.end.column++;
380 return range;
381 }
382 }
383 }
384 });
385 this.add("semicolon", "insertion", function (state, action, editor, session, text) {
386 if (text === ';' && editor.selection.isEmpty()) {
387 var cursor = editor.getCursorPosition();
388 var line = session.doc.getLine(cursor.row);
389 var rightChar = line.substring(cursor.column, cursor.column + 1);
390 if (rightChar === ';') {
391 return {
392 text: '',
393 selection: [1, 1]
394 };
395 }
396 }
397 });
398 this.add("!important", "insertion", function (state, action, editor, session, text) {
399 if (text === '!' && editor.selection.isEmpty()) {
400 var cursor = editor.getCursorPosition();
401 var line = session.doc.getLine(cursor.row);
402 if (/^\s*(;|}|$)/.test(line.substring(cursor.column))) {
403 return {
404 text: '!important',
405 selection: [10, 10]
406 };
407 }
408 }
409 });
410 };
411 oop.inherits(CssBehaviour, CstyleBehaviour);
412 exports.CssBehaviour = CssBehaviour;
413
414 });
415
416 ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module){"use strict";
417 var propertyMap = {
418 "background": { "#$0": 1 },
419 "background-color": { "#$0": 1, "transparent": 1, "fixed": 1 },
420 "background-image": { "url('/$0')": 1 },
421 "background-repeat": { "repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1 },
422 "background-position": { "bottom": 2, "center": 2, "left": 2, "right": 2, "top": 2, "inherit": 2 },
423 "background-attachment": { "scroll": 1, "fixed": 1 },
424 "background-size": { "cover": 1, "contain": 1 },
425 "background-clip": { "border-box": 1, "padding-box": 1, "content-box": 1 },
426 "background-origin": { "border-box": 1, "padding-box": 1, "content-box": 1 },
427 "border": { "solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1 },
428 "border-color": { "#$0": 1 },
429 "border-style": { "solid": 2, "dashed": 2, "dotted": 2, "double": 2, "groove": 2, "hidden": 2, "inherit": 2, "inset": 2, "none": 2, "outset": 2, "ridged": 2 },
430 "border-collapse": { "collapse": 1, "separate": 1 },
431 "bottom": { "px": 1, "em": 1, "%": 1 },
432 "clear": { "left": 1, "right": 1, "both": 1, "none": 1 },
433 "color": { "#$0": 1, "rgb(#$00,0,0)": 1 },
434 "cursor": { "default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1 },
435 "display": { "none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1 },
436 "empty-cells": { "show": 1, "hide": 1 },
437 "float": { "left": 1, "right": 1, "none": 1 },
438 "font-family": { "Arial": 2, "Comic Sans MS": 2, "Consolas": 2, "Courier New": 2, "Courier": 2, "Georgia": 2, "Monospace": 2, "Sans-Serif": 2, "Segoe UI": 2, "Tahoma": 2, "Times New Roman": 2, "Trebuchet MS": 2, "Verdana": 1 },
439 "font-size": { "px": 1, "em": 1, "%": 1 },
440 "font-weight": { "bold": 1, "normal": 1 },
441 "font-style": { "italic": 1, "normal": 1 },
442 "font-variant": { "normal": 1, "small-caps": 1 },
443 "height": { "px": 1, "em": 1, "%": 1 },
444 "left": { "px": 1, "em": 1, "%": 1 },
445 "letter-spacing": { "normal": 1 },
446 "line-height": { "normal": 1 },
447 "list-style-type": { "none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1 },
448 "margin": { "px": 1, "em": 1, "%": 1 },
449 "margin-right": { "px": 1, "em": 1, "%": 1 },
450 "margin-left": { "px": 1, "em": 1, "%": 1 },
451 "margin-top": { "px": 1, "em": 1, "%": 1 },
452 "margin-bottom": { "px": 1, "em": 1, "%": 1 },
453 "max-height": { "px": 1, "em": 1, "%": 1 },
454 "max-width": { "px": 1, "em": 1, "%": 1 },
455 "min-height": { "px": 1, "em": 1, "%": 1 },
456 "min-width": { "px": 1, "em": 1, "%": 1 },
457 "overflow": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
458 "overflow-x": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
459 "overflow-y": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
460 "padding": { "px": 1, "em": 1, "%": 1 },
461 "padding-top": { "px": 1, "em": 1, "%": 1 },
462 "padding-right": { "px": 1, "em": 1, "%": 1 },
463 "padding-bottom": { "px": 1, "em": 1, "%": 1 },
464 "padding-left": { "px": 1, "em": 1, "%": 1 },
465 "page-break-after": { "auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1 },
466 "page-break-before": { "auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1 },
467 "position": { "absolute": 1, "relative": 1, "fixed": 1, "static": 1 },
468 "right": { "px": 1, "em": 1, "%": 1 },
469 "table-layout": { "fixed": 1, "auto": 1 },
470 "text-decoration": { "none": 1, "underline": 1, "line-through": 1, "blink": 1 },
471 "text-align": { "left": 1, "right": 1, "center": 1, "justify": 1 },
472 "text-transform": { "capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1 },
473 "top": { "px": 1, "em": 1, "%": 1 },
474 "vertical-align": { "top": 1, "bottom": 1 },
475 "visibility": { "hidden": 1, "visible": 1 },
476 "white-space": { "nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1 },
477 "width": { "px": 1, "em": 1, "%": 1 },
478 "word-spacing": { "normal": 1 },
479 "filter": { "alpha(opacity=$0100)": 1 },
480 "text-shadow": { "$02px 2px 2px #777": 1 },
481 "text-overflow": { "ellipsis-word": 1, "clip": 1, "ellipsis": 1 },
482 "-moz-border-radius": 1,
483 "-moz-border-radius-topright": 1,
484 "-moz-border-radius-bottomright": 1,
485 "-moz-border-radius-topleft": 1,
486 "-moz-border-radius-bottomleft": 1,
487 "-webkit-border-radius": 1,
488 "-webkit-border-top-right-radius": 1,
489 "-webkit-border-top-left-radius": 1,
490 "-webkit-border-bottom-right-radius": 1,
491 "-webkit-border-bottom-left-radius": 1,
492 "-moz-box-shadow": 1,
493 "-webkit-box-shadow": 1,
494 "transform": { "rotate($00deg)": 1, "skew($00deg)": 1 },
495 "-moz-transform": { "rotate($00deg)": 1, "skew($00deg)": 1 },
496 "-webkit-transform": { "rotate($00deg)": 1, "skew($00deg)": 1 }
497 };
498 var CssCompletions = function () {
499 };
500 (function () {
501 this.completionsDefined = false;
502 this.defineCompletions = function () {
503 if (document) {
504 var style = document.createElement('c').style;
505 for (var i in style) {
506 if (typeof style[i] !== 'string')
507 continue;
508 var name = i.replace(/[A-Z]/g, function (x) {
509 return '-' + x.toLowerCase();
510 });
511 if (!propertyMap.hasOwnProperty(name))
512 propertyMap[name] = 1;
513 }
514 }
515 this.completionsDefined = true;
516 };
517 this.getCompletions = function (state, session, pos, prefix) {
518 if (!this.completionsDefined) {
519 this.defineCompletions();
520 }
521 if (state === 'ruleset' || session.$mode.$id == "ace/mode/scss") {
522 var line = session.getLine(pos.row).substr(0, pos.column);
523 var inParens = /\([^)]*$/.test(line);
524 if (inParens) {
525 line = line.substr(line.lastIndexOf('(') + 1);
526 }
527 if (/:[^;]+$/.test(line)) {
528 /([\w\-]+):[^:]*$/.test(line);
529 return this.getPropertyValueCompletions(state, session, pos, prefix);
530 }
531 else {
532 return this.getPropertyCompletions(state, session, pos, prefix, inParens);
533 }
534 }
535 return [];
536 };
537 this.getPropertyCompletions = function (state, session, pos, prefix, skipSemicolon) {
538 skipSemicolon = skipSemicolon || false;
539 var properties = Object.keys(propertyMap);
540 return properties.map(function (property) {
541 return {
542 caption: property,
543 snippet: property + ': $0' + (skipSemicolon ? '' : ';'),
544 meta: "property",
545 score: 1000000
546 };
547 });
548 };
549 this.getPropertyValueCompletions = function (state, session, pos, prefix) {
550 var line = session.getLine(pos.row).substr(0, pos.column);
551 var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1];
552 if (!property)
553 return [];
554 var values = [];
555 if (property in propertyMap && typeof propertyMap[property] === "object") {
556 values = Object.keys(propertyMap[property]);
557 }
558 return values.map(function (value) {
559 return {
560 caption: value,
561 snippet: value,
562 meta: "property value",
563 score: 1000000
564 };
565 });
566 };
567 }).call(CssCompletions.prototype);
568 exports.CssCompletions = CssCompletions;
569
570 });
571
572 ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
573 var oop = require("../../lib/oop");
574 var Range = require("../../range").Range;
575 var BaseFoldMode = require("./fold_mode").FoldMode;
576 var FoldMode = exports.FoldMode = function (commentRegex) {
577 if (commentRegex) {
578 this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
579 this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
580 }
581 };
582 oop.inherits(FoldMode, BaseFoldMode);
583 (function () {
584 this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
585 this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
586 this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
587 this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
588 this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
589 this._getFoldWidgetBase = this.getFoldWidget;
590 this.getFoldWidget = function (session, foldStyle, row) {
591 var line = session.getLine(row);
592 if (this.singleLineBlockCommentRe.test(line)) {
593 if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
594 return "";
595 }
596 var fw = this._getFoldWidgetBase(session, foldStyle, row);
597 if (!fw && this.startRegionRe.test(line))
598 return "start"; // lineCommentRegionStart
599 return fw;
600 };
601 this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
602 var line = session.getLine(row);
603 if (this.startRegionRe.test(line))
604 return this.getCommentRegionBlock(session, line, row);
605 var match = line.match(this.foldingStartMarker);
606 if (match) {
607 var i = match.index;
608 if (match[1])
609 return this.openingBracketBlock(session, match[1], row, i);
610 var range = session.getCommentFoldRange(row, i + match[0].length, 1);
611 if (range && !range.isMultiLine()) {
612 if (forceMultiline) {
613 range = this.getSectionRange(session, row);
614 }
615 else if (foldStyle != "all")
616 range = null;
617 }
618 return range;
619 }
620 if (foldStyle === "markbegin")
621 return;
622 var match = line.match(this.foldingStopMarker);
623 if (match) {
624 var i = match.index + match[0].length;
625 if (match[1])
626 return this.closingBracketBlock(session, match[1], row, i);
627 return session.getCommentFoldRange(row, i, -1);
628 }
629 };
630 this.getSectionRange = function (session, row) {
631 var line = session.getLine(row);
632 var startIndent = line.search(/\S/);
633 var startRow = row;
634 var startColumn = line.length;
635 row = row + 1;
636 var endRow = row;
637 var maxRow = session.getLength();
638 while (++row < maxRow) {
639 line = session.getLine(row);
640 var indent = line.search(/\S/);
641 if (indent === -1)
642 continue;
643 if (startIndent > indent)
644 break;
645 var subRange = this.getFoldWidgetRange(session, "all", row);
646 if (subRange) {
647 if (subRange.start.row <= startRow) {
648 break;
649 }
650 else if (subRange.isMultiLine()) {
651 row = subRange.end.row;
652 }
653 else if (startIndent == indent) {
654 break;
655 }
656 }
657 endRow = row;
658 }
659 return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
660 };
661 this.getCommentRegionBlock = function (session, line, row) {
662 var startColumn = line.search(/\s*$/);
663 var maxRow = session.getLength();
664 var startRow = row;
665 var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
666 var depth = 1;
667 while (++row < maxRow) {
668 line = session.getLine(row);
669 var m = re.exec(line);
670 if (!m)
671 continue;
672 if (m[1])
673 depth--;
674 else
675 depth++;
676 if (!depth)
677 break;
678 }
679 var endRow = row;
680 if (endRow > startRow) {
681 return new Range(startRow, startColumn, endRow, line.length);
682 }
683 };
684 }).call(FoldMode.prototype);
685
686 });
687
688 ace.define("ace/mode/less",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/less_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/css","ace/mode/css_completions","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
689 var oop = require("../lib/oop");
690 var TextMode = require("./text").Mode;
691 var LessHighlightRules = require("./less_highlight_rules").LessHighlightRules;
692 var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
693 var CssBehaviour = require("./behaviour/css").CssBehaviour;
694 var CssCompletions = require("./css_completions").CssCompletions;
695 var CStyleFoldMode = require("./folding/cstyle").FoldMode;
696 var Mode = function () {
697 this.HighlightRules = LessHighlightRules;
698 this.$outdent = new MatchingBraceOutdent();
699 this.$behaviour = new CssBehaviour();
700 this.$completer = new CssCompletions();
701 this.foldingRules = new CStyleFoldMode();
702 };
703 oop.inherits(Mode, TextMode);
704 (function () {
705 this.lineCommentStart = "//";
706 this.blockComment = { start: "/*", end: "*/" };
707 this.getNextLineIndent = function (state, line, tab) {
708 var indent = this.$getIndent(line);
709 var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
710 if (tokens.length && tokens[tokens.length - 1].type == "comment") {
711 return indent;
712 }
713 var match = line.match(/^.*\{\s*$/);
714 if (match) {
715 indent += tab;
716 }
717 return indent;
718 };
719 this.checkOutdent = function (state, line, input) {
720 return this.$outdent.checkOutdent(line, input);
721 };
722 this.autoOutdent = function (state, doc, row) {
723 this.$outdent.autoOutdent(doc, row);
724 };
725 this.getCompletions = function (state, session, pos, prefix) {
726 return this.$completer.getCompletions("ruleset", session, pos, prefix);
727 };
728 this.$id = "ace/mode/less";
729 }).call(Mode.prototype);
730 exports.Mode = Mode;
731
732 }); (function() {
733 ace.require(["ace/mode/less"], function(m) {
734 if (typeof module == "object" && typeof exports == "object" && module) {
735 module.exports = m;
736 }
737 });
738 })();
739