corrade-nucleus-nucleons – Blame information for rev 20
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
20 | office | 1 | define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { |
2 | "use strict"; |
||
3 | |||
4 | var oop = require("../lib/oop"); |
||
5 | var lang = require("../lib/lang"); |
||
6 | var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; |
||
7 | 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|min-height|min-width|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|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index"; |
||
8 | var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; |
||
9 | 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|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"; |
||
10 | var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow"; |
||
11 | 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"; |
||
12 | |||
13 | var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; |
||
14 | var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; |
||
15 | 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"; |
||
16 | |||
17 | var CssHighlightRules = function() { |
||
18 | |||
19 | var keywordMapper = this.createKeywordMapper({ |
||
20 | "support.function": supportFunction, |
||
21 | "support.constant": supportConstant, |
||
22 | "support.type": supportType, |
||
23 | "support.constant.color": supportConstantColor, |
||
24 | "support.constant.fonts": supportConstantFonts |
||
25 | }, "text", true); |
||
26 | |||
27 | this.$rules = { |
||
28 | "start" : [{ |
||
29 | token : "comment", // multi line comment |
||
30 | regex : "\\/\\*", |
||
31 | push : "comment" |
||
32 | }, { |
||
33 | token: "paren.lparen", |
||
34 | regex: "\\{", |
||
35 | push: "ruleset" |
||
36 | }, { |
||
37 | token: "string", |
||
38 | regex: "@.*?{", |
||
39 | push: "media" |
||
40 | }, { |
||
41 | token: "keyword", |
||
42 | regex: "#[a-z0-9-_]+" |
||
43 | }, { |
||
44 | token: "variable", |
||
45 | regex: "\\.[a-z0-9-_]+" |
||
46 | }, { |
||
47 | token: "string", |
||
48 | regex: ":[a-z0-9-_]+" |
||
49 | }, { |
||
50 | token: "constant", |
||
51 | regex: "[a-z0-9-_]+" |
||
52 | }, { |
||
53 | caseInsensitive: true |
||
54 | }], |
||
55 | |||
56 | "media" : [{ |
||
57 | token : "comment", // multi line comment |
||
58 | regex : "\\/\\*", |
||
59 | push : "comment" |
||
60 | }, { |
||
61 | token: "paren.lparen", |
||
62 | regex: "\\{", |
||
63 | push: "ruleset" |
||
64 | }, { |
||
65 | token: "string", |
||
66 | regex: "\\}", |
||
67 | next: "pop" |
||
68 | }, { |
||
69 | token: "keyword", |
||
70 | regex: "#[a-z0-9-_]+" |
||
71 | }, { |
||
72 | token: "variable", |
||
73 | regex: "\\.[a-z0-9-_]+" |
||
74 | }, { |
||
75 | token: "string", |
||
76 | regex: ":[a-z0-9-_]+" |
||
77 | }, { |
||
78 | token: "constant", |
||
79 | regex: "[a-z0-9-_]+" |
||
80 | }, { |
||
81 | caseInsensitive: true |
||
82 | }], |
||
83 | |||
84 | "comment" : [{ |
||
85 | token : "comment", |
||
86 | regex : "\\*\\/", |
||
87 | next : "pop" |
||
88 | }, { |
||
89 | defaultToken : "comment" |
||
90 | }], |
||
91 | |||
92 | "ruleset" : [ |
||
93 | { |
||
94 | token : "paren.rparen", |
||
95 | regex : "\\}", |
||
96 | next: "pop" |
||
97 | }, { |
||
98 | token : "comment", // multi line comment |
||
99 | regex : "\\/\\*", |
||
100 | push : "comment" |
||
101 | }, { |
||
102 | token : "string", // single line |
||
103 | regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' |
||
104 | }, { |
||
105 | token : "string", // single line |
||
106 | regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" |
||
107 | }, { |
||
108 | token : ["constant.numeric", "keyword"], |
||
109 | 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|%)" |
||
110 | }, { |
||
111 | token : "constant.numeric", |
||
112 | regex : numRe |
||
113 | }, { |
||
114 | token : "constant.numeric", // hex6 color |
||
115 | regex : "#[a-f0-9]{6}" |
||
116 | }, { |
||
117 | token : "constant.numeric", // hex3 color |
||
118 | regex : "#[a-f0-9]{3}" |
||
119 | }, { |
||
120 | token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], |
||
121 | regex : pseudoElements |
||
122 | }, { |
||
123 | token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], |
||
124 | regex : pseudoClasses |
||
125 | }, { |
||
126 | token : ["support.function", "string", "support.function"], |
||
127 | regex : "(url\\()(.*)(\\))" |
||
128 | }, { |
||
129 | token : keywordMapper, |
||
130 | regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" |
||
131 | }, { |
||
132 | caseInsensitive: true |
||
133 | }] |
||
134 | }; |
||
135 | |||
136 | this.normalizeRules(); |
||
137 | }; |
||
138 | |||
139 | oop.inherits(CssHighlightRules, TextHighlightRules); |
||
140 | |||
141 | exports.CssHighlightRules = CssHighlightRules; |
||
142 | |||
143 | }); |
||
144 | |||
145 | 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) { |
||
146 | "use strict"; |
||
147 | |||
148 | var oop = require("../lib/oop"); |
||
149 | var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; |
||
150 | var CssHighlightRules = require('./css_highlight_rules'); |
||
151 | |||
152 | var LessHighlightRules = function() { |
||
153 | |||
154 | |||
155 | var keywordList = "@import|@media|@font-face|@keyframes|@-webkit-keyframes|@supports|" + |
||
156 | "@charset|@plugin|@namespace|@document|@page|@viewport|@-ms-viewport|" + |
||
157 | "or|and|when|not"; |
||
158 | |||
159 | var keywords = keywordList.split('|'); |
||
160 | |||
161 | var properties = CssHighlightRules.supportType.split('|'); |
||
162 | |||
163 | var keywordMapper = this.createKeywordMapper({ |
||
164 | "support.constant": CssHighlightRules.supportConstant, |
||
165 | "keyword": keywordList, |
||
166 | "support.constant.color": CssHighlightRules.supportConstantColor, |
||
167 | "support.constant.fonts": CssHighlightRules.supportConstantFonts |
||
168 | }, "identifier", true); |
||
169 | |||
170 | var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; |
||
171 | |||
172 | this.$rules = { |
||
173 | "start" : [ |
||
174 | { |
||
175 | token : "comment", |
||
176 | regex : "\\/\\/.*$" |
||
177 | }, |
||
178 | { |
||
179 | token : "comment", // multi line comment |
||
180 | regex : "\\/\\*", |
||
181 | next : "comment" |
||
182 | }, { |
||
183 | token : "string", // single line |
||
184 | regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' |
||
185 | }, { |
||
186 | token : "string", // single line |
||
187 | regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" |
||
188 | }, { |
||
189 | token : ["constant.numeric", "keyword"], |
||
190 | 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|%)" |
||
191 | }, { |
||
192 | token : "constant.numeric", // hex6 color |
||
193 | regex : "#[a-f0-9]{6}" |
||
194 | }, { |
||
195 | token : "constant.numeric", // hex3 color |
||
196 | regex : "#[a-f0-9]{3}" |
||
197 | }, { |
||
198 | token : "constant.numeric", |
||
199 | regex : numRe |
||
200 | }, { |
||
201 | token : ["support.function", "paren.lparen", "string", "paren.rparen"], |
||
202 | regex : "(url)(\\()(.*)(\\))" |
||
203 | }, { |
||
204 | token : ["support.function", "paren.lparen"], |
||
205 | regex : "(:extend|[a-z0-9_\\-]+)(\\()" |
||
206 | }, { |
||
207 | token : function(value) { |
||
208 | if (keywords.indexOf(value.toLowerCase()) > -1) |
||
209 | return "keyword"; |
||
210 | else |
||
211 | return "variable"; |
||
212 | }, |
||
213 | regex : "[@\\$][a-z0-9_\\-@\\$]*\\b" |
||
214 | }, { |
||
215 | token : "variable", |
||
216 | regex : "[@\\$]\\{[a-z0-9_\\-@\\$]*\\}" |
||
217 | }, { |
||
218 | token : function(first, second) { |
||
219 | if(properties.indexOf(first.toLowerCase()) > -1) { |
||
220 | return ["support.type.property", "text"]; |
||
221 | } |
||
222 | else { |
||
223 | return ["support.type.unknownProperty", "text"]; |
||
224 | } |
||
225 | }, |
||
226 | regex : "([a-z0-9-_]+)(\\s*:)" |
||
227 | }, { |
||
228 | token : "keyword", |
||
229 | regex : "&" // special case - always treat as keyword |
||
230 | }, { |
||
231 | token : keywordMapper, |
||
232 | regex : "\\-?[@a-z_][@a-z0-9_\\-]*" |
||
233 | }, { |
||
234 | token: "variable.language", |
||
235 | regex: "#[a-z0-9-_]+" |
||
236 | }, { |
||
237 | token: "variable.language", |
||
238 | regex: "\\.[a-z0-9-_]+" |
||
239 | }, { |
||
240 | token: "variable.language", |
||
241 | regex: ":[a-z_][a-z0-9-_]*" |
||
242 | }, { |
||
243 | token: "constant", |
||
244 | regex: "[a-z0-9-_]+" |
||
245 | }, { |
||
246 | token : "keyword.operator", |
||
247 | regex : "<|>|<=|>=|=|!=|-|%|\\+|\\*" |
||
248 | }, { |
||
249 | token : "paren.lparen", |
||
250 | regex : "[[({]" |
||
251 | }, { |
||
252 | token : "paren.rparen", |
||
253 | regex : "[\\])}]" |
||
254 | }, { |
||
255 | token : "text", |
||
256 | regex : "\\s+" |
||
257 | }, { |
||
258 | caseInsensitive: true |
||
259 | } |
||
260 | ], |
||
261 | "comment" : [ |
||
262 | { |
||
263 | token : "comment", // closing comment |
||
264 | regex : ".*?\\*\\/", |
||
265 | next : "start" |
||
266 | }, { |
||
267 | token : "comment", // comment spanning whole line |
||
268 | regex : ".+" |
||
269 | } |
||
270 | ] |
||
271 | }; |
||
272 | this.normalizeRules(); |
||
273 | }; |
||
274 | |||
275 | oop.inherits(LessHighlightRules, TextHighlightRules); |
||
276 | |||
277 | exports.LessHighlightRules = LessHighlightRules; |
||
278 | |||
279 | }); |
||
280 | |||
281 | define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { |
||
282 | "use strict"; |
||
283 | |||
284 | var Range = require("../range").Range; |
||
285 | |||
286 | var MatchingBraceOutdent = function() {}; |
||
287 | |||
288 | (function() { |
||
289 | |||
290 | this.checkOutdent = function(line, input) { |
||
291 | if (! /^\s+$/.test(line)) |
||
292 | return false; |
||
293 | |||
294 | return /^\s*\}/.test(input); |
||
295 | }; |
||
296 | |||
297 | this.autoOutdent = function(doc, row) { |
||
298 | var line = doc.getLine(row); |
||
299 | var match = line.match(/^(\s*\})/); |
||
300 | |||
301 | if (!match) return 0; |
||
302 | |||
303 | var column = match[1].length; |
||
304 | var openBracePos = doc.findMatchingBracket({row: row, column: column}); |
||
305 | |||
306 | if (!openBracePos || openBracePos.row == row) return 0; |
||
307 | |||
308 | var indent = this.$getIndent(doc.getLine(openBracePos.row)); |
||
309 | doc.replace(new Range(row, 0, row, column-1), indent); |
||
310 | }; |
||
311 | |||
312 | this.$getIndent = function(line) { |
||
313 | return line.match(/^\s*/)[0]; |
||
314 | }; |
||
315 | |||
316 | }).call(MatchingBraceOutdent.prototype); |
||
317 | |||
318 | exports.MatchingBraceOutdent = MatchingBraceOutdent; |
||
319 | }); |
||
320 | |||
321 | 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) { |
||
322 | "use strict"; |
||
323 | |||
324 | var oop = require("../../lib/oop"); |
||
325 | var Behaviour = require("../behaviour").Behaviour; |
||
326 | var CstyleBehaviour = require("./cstyle").CstyleBehaviour; |
||
327 | var TokenIterator = require("../../token_iterator").TokenIterator; |
||
328 | |||
329 | var CssBehaviour = function () { |
||
330 | |||
331 | this.inherit(CstyleBehaviour); |
||
332 | |||
333 | this.add("colon", "insertion", function (state, action, editor, session, text) { |
||
334 | if (text === ':') { |
||
335 | var cursor = editor.getCursorPosition(); |
||
336 | var iterator = new TokenIterator(session, cursor.row, cursor.column); |
||
337 | var token = iterator.getCurrentToken(); |
||
338 | if (token && token.value.match(/\s+/)) { |
||
339 | token = iterator.stepBackward(); |
||
340 | } |
||
341 | if (token && token.type === 'support.type') { |
||
342 | var line = session.doc.getLine(cursor.row); |
||
343 | var rightChar = line.substring(cursor.column, cursor.column + 1); |
||
344 | if (rightChar === ':') { |
||
345 | return { |
||
346 | text: '', |
||
347 | selection: [1, 1] |
||
348 | } |
||
349 | } |
||
350 | if (!line.substring(cursor.column).match(/^\s*;/)) { |
||
351 | return { |
||
352 | text: ':;', |
||
353 | selection: [1, 1] |
||
354 | } |
||
355 | } |
||
356 | } |
||
357 | } |
||
358 | }); |
||
359 | |||
360 | this.add("colon", "deletion", function (state, action, editor, session, range) { |
||
361 | var selected = session.doc.getTextRange(range); |
||
362 | if (!range.isMultiLine() && selected === ':') { |
||
363 | var cursor = editor.getCursorPosition(); |
||
364 | var iterator = new TokenIterator(session, cursor.row, cursor.column); |
||
365 | var token = iterator.getCurrentToken(); |
||
366 | if (token && token.value.match(/\s+/)) { |
||
367 | token = iterator.stepBackward(); |
||
368 | } |
||
369 | if (token && token.type === 'support.type') { |
||
370 | var line = session.doc.getLine(range.start.row); |
||
371 | var rightChar = line.substring(range.end.column, range.end.column + 1); |
||
372 | if (rightChar === ';') { |
||
373 | range.end.column ++; |
||
374 | return range; |
||
375 | } |
||
376 | } |
||
377 | } |
||
378 | }); |
||
379 | |||
380 | this.add("semicolon", "insertion", function (state, action, editor, session, text) { |
||
381 | if (text === ';') { |
||
382 | var cursor = editor.getCursorPosition(); |
||
383 | var line = session.doc.getLine(cursor.row); |
||
384 | var rightChar = line.substring(cursor.column, cursor.column + 1); |
||
385 | if (rightChar === ';') { |
||
386 | return { |
||
387 | text: '', |
||
388 | selection: [1, 1] |
||
389 | } |
||
390 | } |
||
391 | } |
||
392 | }); |
||
393 | |||
394 | } |
||
395 | oop.inherits(CssBehaviour, CstyleBehaviour); |
||
396 | |||
397 | exports.CssBehaviour = CssBehaviour; |
||
398 | }); |
||
399 | |||
400 | define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module) { |
||
401 | "use strict"; |
||
402 | |||
403 | var propertyMap = { |
||
404 | "background": {"#$0": 1}, |
||
405 | "background-color": {"#$0": 1, "transparent": 1, "fixed": 1}, |
||
406 | "background-image": {"url('/$0')": 1}, |
||
407 | "background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1}, |
||
408 | "background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2}, |
||
409 | "background-attachment": {"scroll": 1, "fixed": 1}, |
||
410 | "background-size": {"cover": 1, "contain": 1}, |
||
411 | "background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1}, |
||
412 | "background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1}, |
||
413 | "border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1}, |
||
414 | "border-color": {"#$0": 1}, |
||
415 | "border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2}, |
||
416 | "border-collapse": {"collapse": 1, "separate": 1}, |
||
417 | "bottom": {"px": 1, "em": 1, "%": 1}, |
||
418 | "clear": {"left": 1, "right": 1, "both": 1, "none": 1}, |
||
419 | "color": {"#$0": 1, "rgb(#$00,0,0)": 1}, |
||
420 | "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}, |
||
421 | "display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1}, |
||
422 | "empty-cells": {"show": 1, "hide": 1}, |
||
423 | "float": {"left": 1, "right": 1, "none": 1}, |
||
424 | "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}, |
||
425 | "font-size": {"px": 1, "em": 1, "%": 1}, |
||
426 | "font-weight": {"bold": 1, "normal": 1}, |
||
427 | "font-style": {"italic": 1, "normal": 1}, |
||
428 | "font-variant": {"normal": 1, "small-caps": 1}, |
||
429 | "height": {"px": 1, "em": 1, "%": 1}, |
||
430 | "left": {"px": 1, "em": 1, "%": 1}, |
||
431 | "letter-spacing": {"normal": 1}, |
||
432 | "line-height": {"normal": 1}, |
||
433 | "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}, |
||
434 | "margin": {"px": 1, "em": 1, "%": 1}, |
||
435 | "margin-right": {"px": 1, "em": 1, "%": 1}, |
||
436 | "margin-left": {"px": 1, "em": 1, "%": 1}, |
||
437 | "margin-top": {"px": 1, "em": 1, "%": 1}, |
||
438 | "margin-bottom": {"px": 1, "em": 1, "%": 1}, |
||
439 | "max-height": {"px": 1, "em": 1, "%": 1}, |
||
440 | "max-width": {"px": 1, "em": 1, "%": 1}, |
||
441 | "min-height": {"px": 1, "em": 1, "%": 1}, |
||
442 | "min-width": {"px": 1, "em": 1, "%": 1}, |
||
443 | "overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, |
||
444 | "overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, |
||
445 | "overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, |
||
446 | "padding": {"px": 1, "em": 1, "%": 1}, |
||
447 | "padding-top": {"px": 1, "em": 1, "%": 1}, |
||
448 | "padding-right": {"px": 1, "em": 1, "%": 1}, |
||
449 | "padding-bottom": {"px": 1, "em": 1, "%": 1}, |
||
450 | "padding-left": {"px": 1, "em": 1, "%": 1}, |
||
451 | "page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, |
||
452 | "page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, |
||
453 | "position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1}, |
||
454 | "right": {"px": 1, "em": 1, "%": 1}, |
||
455 | "table-layout": {"fixed": 1, "auto": 1}, |
||
456 | "text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1}, |
||
457 | "text-align": {"left": 1, "right": 1, "center": 1, "justify": 1}, |
||
458 | "text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1}, |
||
459 | "top": {"px": 1, "em": 1, "%": 1}, |
||
460 | "vertical-align": {"top": 1, "bottom": 1}, |
||
461 | "visibility": {"hidden": 1, "visible": 1}, |
||
462 | "white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1}, |
||
463 | "width": {"px": 1, "em": 1, "%": 1}, |
||
464 | "word-spacing": {"normal": 1}, |
||
465 | "filter": {"alpha(opacity=$0100)": 1}, |
||
466 | |||
467 | "text-shadow": {"$02px 2px 2px #777": 1}, |
||
468 | "text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1}, |
||
469 | "-moz-border-radius": 1, |
||
470 | "-moz-border-radius-topright": 1, |
||
471 | "-moz-border-radius-bottomright": 1, |
||
472 | "-moz-border-radius-topleft": 1, |
||
473 | "-moz-border-radius-bottomleft": 1, |
||
474 | "-webkit-border-radius": 1, |
||
475 | "-webkit-border-top-right-radius": 1, |
||
476 | "-webkit-border-top-left-radius": 1, |
||
477 | "-webkit-border-bottom-right-radius": 1, |
||
478 | "-webkit-border-bottom-left-radius": 1, |
||
479 | "-moz-box-shadow": 1, |
||
480 | "-webkit-box-shadow": 1, |
||
481 | "transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, |
||
482 | "-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, |
||
483 | "-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 } |
||
484 | }; |
||
485 | |||
486 | var CssCompletions = function() { |
||
487 | |||
488 | }; |
||
489 | |||
490 | (function() { |
||
491 | |||
492 | this.completionsDefined = false; |
||
493 | |||
494 | this.defineCompletions = function() { |
||
495 | if (document) { |
||
496 | var style = document.createElement('c').style; |
||
497 | |||
498 | for (var i in style) { |
||
499 | if (typeof style[i] !== 'string') |
||
500 | continue; |
||
501 | |||
502 | var name = i.replace(/[A-Z]/g, function(x) { |
||
503 | return '-' + x.toLowerCase(); |
||
504 | }); |
||
505 | |||
506 | if (!propertyMap.hasOwnProperty(name)) |
||
507 | propertyMap[name] = 1; |
||
508 | } |
||
509 | } |
||
510 | |||
511 | this.completionsDefined = true; |
||
512 | } |
||
513 | |||
514 | this.getCompletions = function(state, session, pos, prefix) { |
||
515 | if (!this.completionsDefined) { |
||
516 | this.defineCompletions(); |
||
517 | } |
||
518 | |||
519 | var token = session.getTokenAt(pos.row, pos.column); |
||
520 | |||
521 | if (!token) |
||
522 | return []; |
||
523 | if (state==='ruleset'){ |
||
524 | var line = session.getLine(pos.row).substr(0, pos.column); |
||
525 | if (/:[^;]+$/.test(line)) { |
||
526 | /([\w\-]+):[^:]*$/.test(line); |
||
527 | |||
528 | return this.getPropertyValueCompletions(state, session, pos, prefix); |
||
529 | } else { |
||
530 | return this.getPropertyCompletions(state, session, pos, prefix); |
||
531 | } |
||
532 | } |
||
533 | |||
534 | return []; |
||
535 | }; |
||
536 | |||
537 | this.getPropertyCompletions = function(state, session, pos, prefix) { |
||
538 | var properties = Object.keys(propertyMap); |
||
539 | return properties.map(function(property){ |
||
540 | return { |
||
541 | caption: property, |
||
542 | snippet: property + ': $0', |
||
543 | meta: "property", |
||
544 | score: Number.MAX_VALUE |
||
545 | }; |
||
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 | |||
553 | if (!property) |
||
554 | return []; |
||
555 | var values = []; |
||
556 | if (property in propertyMap && typeof propertyMap[property] === "object") { |
||
557 | values = Object.keys(propertyMap[property]); |
||
558 | } |
||
559 | return values.map(function(value){ |
||
560 | return { |
||
561 | caption: value, |
||
562 | snippet: value, |
||
563 | meta: "property value", |
||
564 | score: Number.MAX_VALUE |
||
565 | }; |
||
566 | }); |
||
567 | }; |
||
568 | |||
569 | }).call(CssCompletions.prototype); |
||
570 | |||
571 | exports.CssCompletions = CssCompletions; |
||
572 | }); |
||
573 | |||
574 | define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { |
||
575 | "use strict"; |
||
576 | |||
577 | var oop = require("../../lib/oop"); |
||
578 | var Range = require("../../range").Range; |
||
579 | var BaseFoldMode = require("./fold_mode").FoldMode; |
||
580 | |||
581 | var FoldMode = exports.FoldMode = function(commentRegex) { |
||
582 | if (commentRegex) { |
||
583 | this.foldingStartMarker = new RegExp( |
||
584 | this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) |
||
585 | ); |
||
586 | this.foldingStopMarker = new RegExp( |
||
587 | this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) |
||
588 | ); |
||
589 | } |
||
590 | }; |
||
591 | oop.inherits(FoldMode, BaseFoldMode); |
||
592 | |||
593 | (function() { |
||
594 | |||
595 | this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; |
||
596 | this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; |
||
597 | this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; |
||
598 | this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; |
||
599 | this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; |
||
600 | this._getFoldWidgetBase = this.getFoldWidget; |
||
601 | this.getFoldWidget = function(session, foldStyle, row) { |
||
602 | var line = session.getLine(row); |
||
603 | |||
604 | if (this.singleLineBlockCommentRe.test(line)) { |
||
605 | if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) |
||
606 | return ""; |
||
607 | } |
||
608 | |||
609 | var fw = this._getFoldWidgetBase(session, foldStyle, row); |
||
610 | |||
611 | if (!fw && this.startRegionRe.test(line)) |
||
612 | return "start"; // lineCommentRegionStart |
||
613 | |||
614 | return fw; |
||
615 | }; |
||
616 | |||
617 | this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { |
||
618 | var line = session.getLine(row); |
||
619 | |||
620 | if (this.startRegionRe.test(line)) |
||
621 | return this.getCommentRegionBlock(session, line, row); |
||
622 | |||
623 | var match = line.match(this.foldingStartMarker); |
||
624 | if (match) { |
||
625 | var i = match.index; |
||
626 | |||
627 | if (match[1]) |
||
628 | return this.openingBracketBlock(session, match[1], row, i); |
||
629 | |||
630 | var range = session.getCommentFoldRange(row, i + match[0].length, 1); |
||
631 | |||
632 | if (range && !range.isMultiLine()) { |
||
633 | if (forceMultiline) { |
||
634 | range = this.getSectionRange(session, row); |
||
635 | } else if (foldStyle != "all") |
||
636 | range = null; |
||
637 | } |
||
638 | |||
639 | return range; |
||
640 | } |
||
641 | |||
642 | if (foldStyle === "markbegin") |
||
643 | return; |
||
644 | |||
645 | var match = line.match(this.foldingStopMarker); |
||
646 | if (match) { |
||
647 | var i = match.index + match[0].length; |
||
648 | |||
649 | if (match[1]) |
||
650 | return this.closingBracketBlock(session, match[1], row, i); |
||
651 | |||
652 | return session.getCommentFoldRange(row, i, -1); |
||
653 | } |
||
654 | }; |
||
655 | |||
656 | this.getSectionRange = function(session, row) { |
||
657 | var line = session.getLine(row); |
||
658 | var startIndent = line.search(/\S/); |
||
659 | var startRow = row; |
||
660 | var startColumn = line.length; |
||
661 | row = row + 1; |
||
662 | var endRow = row; |
||
663 | var maxRow = session.getLength(); |
||
664 | while (++row < maxRow) { |
||
665 | line = session.getLine(row); |
||
666 | var indent = line.search(/\S/); |
||
667 | if (indent === -1) |
||
668 | continue; |
||
669 | if (startIndent > indent) |
||
670 | break; |
||
671 | var subRange = this.getFoldWidgetRange(session, "all", row); |
||
672 | |||
673 | if (subRange) { |
||
674 | if (subRange.start.row <= startRow) { |
||
675 | break; |
||
676 | } else if (subRange.isMultiLine()) { |
||
677 | row = subRange.end.row; |
||
678 | } else if (startIndent == indent) { |
||
679 | break; |
||
680 | } |
||
681 | } |
||
682 | endRow = row; |
||
683 | } |
||
684 | |||
685 | return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); |
||
686 | }; |
||
687 | this.getCommentRegionBlock = function(session, line, row) { |
||
688 | var startColumn = line.search(/\s*$/); |
||
689 | var maxRow = session.getLength(); |
||
690 | var startRow = row; |
||
691 | |||
692 | var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; |
||
693 | var depth = 1; |
||
694 | while (++row < maxRow) { |
||
695 | line = session.getLine(row); |
||
696 | var m = re.exec(line); |
||
697 | if (!m) continue; |
||
698 | if (m[1]) depth--; |
||
699 | else depth++; |
||
700 | |||
701 | if (!depth) break; |
||
702 | } |
||
703 | |||
704 | var endRow = row; |
||
705 | if (endRow > startRow) { |
||
706 | return new Range(startRow, startColumn, endRow, line.length); |
||
707 | } |
||
708 | }; |
||
709 | |||
710 | }).call(FoldMode.prototype); |
||
711 | |||
712 | }); |
||
713 | |||
714 | 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) { |
||
715 | "use strict"; |
||
716 | |||
717 | var oop = require("../lib/oop"); |
||
718 | var TextMode = require("./text").Mode; |
||
719 | var LessHighlightRules = require("./less_highlight_rules").LessHighlightRules; |
||
720 | var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; |
||
721 | var CssBehaviour = require("./behaviour/css").CssBehaviour; |
||
722 | var CssCompletions = require("./css_completions").CssCompletions; |
||
723 | |||
724 | var CStyleFoldMode = require("./folding/cstyle").FoldMode; |
||
725 | |||
726 | var Mode = function() { |
||
727 | this.HighlightRules = LessHighlightRules; |
||
728 | this.$outdent = new MatchingBraceOutdent(); |
||
729 | this.$behaviour = new CssBehaviour(); |
||
730 | this.$completer = new CssCompletions(); |
||
731 | this.foldingRules = new CStyleFoldMode(); |
||
732 | }; |
||
733 | oop.inherits(Mode, TextMode); |
||
734 | |||
735 | (function() { |
||
736 | |||
737 | this.lineCommentStart = "//"; |
||
738 | this.blockComment = {start: "/*", end: "*/"}; |
||
739 | |||
740 | this.getNextLineIndent = function(state, line, tab) { |
||
741 | var indent = this.$getIndent(line); |
||
742 | var tokens = this.getTokenizer().getLineTokens(line, state).tokens; |
||
743 | if (tokens.length && tokens[tokens.length-1].type == "comment") { |
||
744 | return indent; |
||
745 | } |
||
746 | |||
747 | var match = line.match(/^.*\{\s*$/); |
||
748 | if (match) { |
||
749 | indent += tab; |
||
750 | } |
||
751 | |||
752 | return indent; |
||
753 | }; |
||
754 | |||
755 | this.checkOutdent = function(state, line, input) { |
||
756 | return this.$outdent.checkOutdent(line, input); |
||
757 | }; |
||
758 | |||
759 | this.autoOutdent = function(state, doc, row) { |
||
760 | this.$outdent.autoOutdent(doc, row); |
||
761 | }; |
||
762 | |||
763 | this.getCompletions = function(state, session, pos, prefix) { |
||
764 | return this.$completer.getCompletions("ruleset", session, pos, prefix); |
||
765 | }; |
||
766 | |||
767 | this.$id = "ace/mode/less"; |
||
768 | }).call(Mode.prototype); |
||
769 | |||
770 | exports.Mode = Mode; |
||
771 | |||
772 | }); |