PluginProbe
CSS & JavaScript Toolbox / 11.9
CSS & JavaScript Toolbox v11.9
trunk 0.3 0.8 10 10.1 11 11.2 11.3 11.4 11.5 11.6 11.7 11.8 11.9 11.9.1 12 12.0 12.0.1 12.0.3 12.0.4 12.0.5 12.0.6 12.0.7 6.0 6.0.11 All 60 releases
css-javascript-toolbox / framework / js / ace / mode-html.js

mode-html.js in CSS & JavaScript Toolbox 11.9, at framework/js/ace/mode-html.js

2,194 lines 98.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
2 var oop = require("../lib/oop");
3 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
4 var DocCommentHighlightRules = function () {
5 this.$rules = {
6 "start": [{
7 token: "comment.doc.tag",
8 regex: "@[\\w\\d_]+" // TODO: fix email addresses
9 },
10 DocCommentHighlightRules.getTagRule(),
11 {
12 defaultToken: "comment.doc",
13 caseInsensitive: true
14 }]
15 };
16 };
17 oop.inherits(DocCommentHighlightRules, TextHighlightRules);
18 DocCommentHighlightRules.getTagRule = function (start) {
19 return {
20 token: "comment.doc.tag.storage.type",
21 regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
22 };
23 };
24 DocCommentHighlightRules.getStartRule = function (start) {
25 return {
26 token: "comment.doc",
27 regex: "\\/\\*(?=\\*)",
28 next: start
29 };
30 };
31 DocCommentHighlightRules.getEndRule = function (start) {
32 return {
33 token: "comment.doc",
34 regex: "\\*\\/",
35 next: start
36 };
37 };
38 exports.DocCommentHighlightRules = DocCommentHighlightRules;
39
40 });
41
42 define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
43 var oop = require("../lib/oop");
44 var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
45 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
46 var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
47 var JavaScriptHighlightRules = function (options) {
48 var keywordMapper = this.createKeywordMapper({
49 "variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
50 "Namespace|QName|XML|XMLList|" + // E4X
51 "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
52 "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
53 "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
54 "SyntaxError|TypeError|URIError|" +
55 "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
56 "isNaN|parseFloat|parseInt|" +
57 "JSON|Math|" + // Other
58 "this|arguments|prototype|window|document",
59 "keyword": "const|yield|import|get|set|async|await|" +
60 "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
61 "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
62 "__parent__|__count__|escape|unescape|with|__proto__|" +
63 "class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
64 "storage.type": "const|let|var|function",
65 "constant.language": "null|Infinity|NaN|undefined",
66 "support.function": "alert",
67 "constant.language.boolean": "true|false"
68 }, "identifier");
69 var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
70 var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
71 "u[0-9a-fA-F]{4}|" + // unicode
72 "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode
73 "[0-2][0-7]{0,2}|" + // oct
74 "3[0-7][0-7]?|" + // oct
75 "[4-7][0-7]?|" + //oct
76 ".)";
77 this.$rules = {
78 "no_regex": [
79 DocCommentHighlightRules.getStartRule("doc-start"),
80 comments("no_regex"),
81 {
82 token: "string",
83 regex: "'(?=.)",
84 next: "qstring"
85 }, {
86 token: "string",
87 regex: '"(?=.)',
88 next: "qqstring"
89 }, {
90 token: "constant.numeric",
91 regex: /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/
92 }, {
93 token: "constant.numeric",
94 regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
95 }, {
96 token: [
97 "storage.type", "punctuation.operator", "support.function",
98 "punctuation.operator", "entity.name.function", "text", "keyword.operator"
99 ],
100 regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
101 next: "function_arguments"
102 }, {
103 token: [
104 "storage.type", "punctuation.operator", "entity.name.function", "text",
105 "keyword.operator", "text", "storage.type", "text", "paren.lparen"
106 ],
107 regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
108 next: "function_arguments"
109 }, {
110 token: [
111 "entity.name.function", "text", "keyword.operator", "text", "storage.type",
112 "text", "paren.lparen"
113 ],
114 regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
115 next: "function_arguments"
116 }, {
117 token: [
118 "storage.type", "punctuation.operator", "entity.name.function", "text",
119 "keyword.operator", "text",
120 "storage.type", "text", "entity.name.function", "text", "paren.lparen"
121 ],
122 regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
123 next: "function_arguments"
124 }, {
125 token: [
126 "storage.type", "text", "entity.name.function", "text", "paren.lparen"
127 ],
128 regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
129 next: "function_arguments"
130 }, {
131 token: [
132 "entity.name.function", "text", "punctuation.operator",
133 "text", "storage.type", "text", "paren.lparen"
134 ],
135 regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
136 next: "function_arguments"
137 }, {
138 token: [
139 "text", "text", "storage.type", "text", "paren.lparen"
140 ],
141 regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
142 next: "function_arguments"
143 }, {
144 token: "keyword",
145 regex: "from(?=\\s*('|\"))"
146 }, {
147 token: "keyword",
148 regex: "(?:" + kwBeforeRe + ")\\b",
149 next: "start"
150 }, {
151 token: "support.constant",
152 regex: /that\b/
153 }, {
154 token: ["storage.type", "punctuation.operator", "support.function.firebug"],
155 regex: /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/
156 }, {
157 token: keywordMapper,
158 regex: identifierRe
159 }, {
160 token: "punctuation.operator",
161 regex: /[.](?![.])/,
162 next: "property"
163 }, {
164 token: "storage.type",
165 regex: /=>/,
166 next: "start"
167 }, {
168 token: "keyword.operator",
169 regex: /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,
170 next: "start"
171 }, {
172 token: "punctuation.operator",
173 regex: /[?:,;.]/,
174 next: "start"
175 }, {
176 token: "paren.lparen",
177 regex: /[\[({]/,
178 next: "start"
179 }, {
180 token: "paren.rparen",
181 regex: /[\])}]/
182 }, {
183 token: "comment",
184 regex: /^#!.*$/
185 }
186 ],
187 property: [{
188 token: "text",
189 regex: "\\s+"
190 }, {
191 token: [
192 "storage.type", "punctuation.operator", "entity.name.function", "text",
193 "keyword.operator", "text",
194 "storage.type", "text", "entity.name.function", "text", "paren.lparen"
195 ],
196 regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
197 next: "function_arguments"
198 }, {
199 token: "punctuation.operator",
200 regex: /[.](?![.])/
201 }, {
202 token: "support.function",
203 regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
204 }, {
205 token: "support.function.dom",
206 regex: /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
207 }, {
208 token: "support.constant",
209 regex: /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
210 }, {
211 token: "identifier",
212 regex: identifierRe
213 }, {
214 regex: "",
215 token: "empty",
216 next: "no_regex"
217 }
218 ],
219 "start": [
220 DocCommentHighlightRules.getStartRule("doc-start"),
221 comments("start"),
222 {
223 token: "string.regexp",
224 regex: "\\/",
225 next: "regex"
226 }, {
227 token: "text",
228 regex: "\\s+|^$",
229 next: "start"
230 }, {
231 token: "empty",
232 regex: "",
233 next: "no_regex"
234 }
235 ],
236 "regex": [
237 {
238 token: "regexp.keyword.operator",
239 regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
240 }, {
241 token: "string.regexp",
242 regex: "/[sxngimy]*",
243 next: "no_regex"
244 }, {
245 token: "invalid",
246 regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
247 }, {
248 token: "constant.language.escape",
249 regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
250 }, {
251 token: "constant.language.delimiter",
252 regex: /\|/
253 }, {
254 token: "constant.language.escape",
255 regex: /\[\^?/,
256 next: "regex_character_class"
257 }, {
258 token: "empty",
259 regex: "$",
260 next: "no_regex"
261 }, {
262 defaultToken: "string.regexp"
263 }
264 ],
265 "regex_character_class": [
266 {
267 token: "regexp.charclass.keyword.operator",
268 regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
269 }, {
270 token: "constant.language.escape",
271 regex: "]",
272 next: "regex"
273 }, {
274 token: "constant.language.escape",
275 regex: "-"
276 }, {
277 token: "empty",
278 regex: "$",
279 next: "no_regex"
280 }, {
281 defaultToken: "string.regexp.charachterclass"
282 }
283 ],
284 "default_parameter": [
285 {
286 token: "string",
287 regex: "'(?=.)",
288 push: [
289 {
290 token: "string",
291 regex: "'|$",
292 next: "pop"
293 }, {
294 include: "qstring"
295 }
296 ]
297 }, {
298 token: "string",
299 regex: '"(?=.)',
300 push: [
301 {
302 token: "string",
303 regex: '"|$',
304 next: "pop"
305 }, {
306 include: "qqstring"
307 }
308 ]
309 }, {
310 token: "constant.language",
311 regex: "null|Infinity|NaN|undefined"
312 }, {
313 token: "constant.numeric",
314 regex: /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/
315 }, {
316 token: "constant.numeric",
317 regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
318 }, {
319 token: "punctuation.operator",
320 regex: ",",
321 next: "function_arguments"
322 }, {
323 token: "text",
324 regex: "\\s+"
325 }, {
326 token: "punctuation.operator",
327 regex: "$"
328 }, {
329 token: "empty",
330 regex: "",
331 next: "no_regex"
332 }
333 ],
334 "function_arguments": [
335 comments("function_arguments"),
336 {
337 token: "variable.parameter",
338 regex: identifierRe
339 }, {
340 token: "punctuation.operator",
341 regex: ","
342 }, {
343 token: "text",
344 regex: "\\s+"
345 }, {
346 token: "punctuation.operator",
347 regex: "$"
348 }, {
349 token: "empty",
350 regex: "",
351 next: "no_regex"
352 }
353 ],
354 "qqstring": [
355 {
356 token: "constant.language.escape",
357 regex: escapedRe
358 }, {
359 token: "string",
360 regex: "\\\\$",
361 consumeLineEnd: true
362 }, {
363 token: "string",
364 regex: '"|$',
365 next: "no_regex"
366 }, {
367 defaultToken: "string"
368 }
369 ],
370 "qstring": [
371 {
372 token: "constant.language.escape",
373 regex: escapedRe
374 }, {
375 token: "string",
376 regex: "\\\\$",
377 consumeLineEnd: true
378 }, {
379 token: "string",
380 regex: "'|$",
381 next: "no_regex"
382 }, {
383 defaultToken: "string"
384 }
385 ]
386 };
387 if (!options || !options.noES6) {
388 this.$rules.no_regex.unshift({
389 regex: "[{}]", onMatch: function (val, state, stack) {
390 this.next = val == "{" ? this.nextState : "";
391 if (val == "{" && stack.length) {
392 stack.unshift("start", state);
393 }
394 else if (val == "}" && stack.length) {
395 stack.shift();
396 this.next = stack.shift();
397 if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1)
398 return "paren.quasi.end";
399 }
400 return val == "{" ? "paren.lparen" : "paren.rparen";
401 },
402 nextState: "start"
403 }, {
404 token: "string.quasi.start",
405 regex: /`/,
406 push: [{
407 token: "constant.language.escape",
408 regex: escapedRe
409 }, {
410 token: "paren.quasi.start",
411 regex: /\${/,
412 push: "start"
413 }, {
414 token: "string.quasi.end",
415 regex: /`/,
416 next: "pop"
417 }, {
418 defaultToken: "string.quasi"
419 }]
420 }, {
421 token: ["variable.parameter", "text"],
422 regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
423 }, {
424 token: "paren.lparen",
425 regex: "(\\()(?=.+\\s*=>)",
426 next: "function_arguments"
427 }, {
428 token: "variable.language",
429 regex: "(?:(?:(?:Weak)?(?:Set|Map))|Promise)\\b"
430 });
431 this.$rules["function_arguments"].unshift({
432 token: "keyword.operator",
433 regex: "=",
434 next: "default_parameter"
435 }, {
436 token: "keyword.operator",
437 regex: "\\.{3}"
438 });
439 this.$rules["property"].unshift({
440 token: "support.function",
441 regex: "(findIndex|repeat|startsWith|endsWith|includes|isSafeInteger|trunc|cbrt|log2|log10|sign|then|catch|"
442 + "finally|resolve|reject|race|any|all|allSettled|keys|entries|isInteger)\\b(?=\\()"
443 }, {
444 token: "constant.language",
445 regex: "(?:MAX_SAFE_INTEGER|MIN_SAFE_INTEGER|EPSILON)\\b"
446 });
447 if (!options || options.jsx != false)
448 JSX.call(this);
449 }
450 this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("no_regex")]);
451 this.normalizeRules();
452 };
453 oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
454 function JSX() {
455 var tagRegex = identifierRe.replace("\\d", "\\d\\-");
456 var jsxTag = {
457 onMatch: function (val, state, stack) {
458 var offset = val.charAt(1) == "/" ? 2 : 1;
459 if (offset == 1) {
460 if (state != this.nextState)
461 stack.unshift(this.next, this.nextState, 0);
462 else
463 stack.unshift(this.next);
464 stack[2]++;
465 }
466 else if (offset == 2) {
467 if (state == this.nextState) {
468 stack[1]--;
469 if (!stack[1] || stack[1] < 0) {
470 stack.shift();
471 stack.shift();
472 }
473 }
474 }
475 return [{
476 type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml",
477 value: val.slice(0, offset)
478 }, {
479 type: "meta.tag.tag-name.xml",
480 value: val.substr(offset)
481 }];
482 },
483 regex: "</?" + tagRegex + "",
484 next: "jsxAttributes",
485 nextState: "jsx"
486 };
487 this.$rules.start.unshift(jsxTag);
488 var jsxJsRule = {
489 regex: "{",
490 token: "paren.quasi.start",
491 push: "start"
492 };
493 this.$rules.jsx = [
494 jsxJsRule,
495 jsxTag,
496 { include: "reference" },
497 { defaultToken: "string" }
498 ];
499 this.$rules.jsxAttributes = [{
500 token: "meta.tag.punctuation.tag-close.xml",
501 regex: "/?>",
502 onMatch: function (value, currentState, stack) {
503 if (currentState == stack[0])
504 stack.shift();
505 if (value.length == 2) {
506 if (stack[0] == this.nextState)
507 stack[1]--;
508 if (!stack[1] || stack[1] < 0) {
509 stack.splice(0, 2);
510 }
511 }
512 this.next = stack[0] || "start";
513 return [{ type: this.token, value: value }];
514 },
515 nextState: "jsx"
516 },
517 jsxJsRule,
518 comments("jsxAttributes"),
519 {
520 token: "entity.other.attribute-name.xml",
521 regex: tagRegex
522 }, {
523 token: "keyword.operator.attribute-equals.xml",
524 regex: "="
525 }, {
526 token: "text.tag-whitespace.xml",
527 regex: "\\s+"
528 }, {
529 token: "string.attribute-value.xml",
530 regex: "'",
531 stateName: "jsx_attr_q",
532 push: [
533 { token: "string.attribute-value.xml", regex: "'", next: "pop" },
534 { include: "reference" },
535 { defaultToken: "string.attribute-value.xml" }
536 ]
537 }, {
538 token: "string.attribute-value.xml",
539 regex: '"',
540 stateName: "jsx_attr_qq",
541 push: [
542 { token: "string.attribute-value.xml", regex: '"', next: "pop" },
543 { include: "reference" },
544 { defaultToken: "string.attribute-value.xml" }
545 ]
546 },
547 jsxTag
548 ];
549 this.$rules.reference = [{
550 token: "constant.language.escape.reference.xml",
551 regex: "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
552 }];
553 }
554 function comments(next) {
555 return [
556 {
557 token: "comment",
558 regex: /\/\*/,
559 next: [
560 DocCommentHighlightRules.getTagRule(),
561 { token: "comment", regex: "\\*\\/", next: next || "pop" },
562 { defaultToken: "comment", caseInsensitive: true }
563 ]
564 }, {
565 token: "comment",
566 regex: "\\/\\/",
567 next: [
568 DocCommentHighlightRules.getTagRule(),
569 { token: "comment", regex: "$|^", next: next || "pop" },
570 { defaultToken: "comment", caseInsensitive: true }
571 ]
572 }
573 ];
574 }
575 exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
576
577 });
578
579 define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
580 var Range = require("../range").Range;
581 var MatchingBraceOutdent = function () { };
582 (function () {
583 this.checkOutdent = function (line, input) {
584 if (!/^\s+$/.test(line))
585 return false;
586 return /^\s*\}/.test(input);
587 };
588 this.autoOutdent = function (doc, row) {
589 var line = doc.getLine(row);
590 var match = line.match(/^(\s*\})/);
591 if (!match)
592 return 0;
593 var column = match[1].length;
594 var openBracePos = doc.findMatchingBracket({ row: row, column: column });
595 if (!openBracePos || openBracePos.row == row)
596 return 0;
597 var indent = this.$getIndent(doc.getLine(openBracePos.row));
598 doc.replace(new Range(row, 0, row, column - 1), indent);
599 };
600 this.$getIndent = function (line) {
601 return line.match(/^\s*/)[0];
602 };
603 }).call(MatchingBraceOutdent.prototype);
604 exports.MatchingBraceOutdent = MatchingBraceOutdent;
605
606 });
607
608 define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
609 var oop = require("../../lib/oop");
610 var Range = require("../../range").Range;
611 var BaseFoldMode = require("./fold_mode").FoldMode;
612 var FoldMode = exports.FoldMode = function (commentRegex) {
613 if (commentRegex) {
614 this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
615 this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
616 }
617 };
618 oop.inherits(FoldMode, BaseFoldMode);
619 (function () {
620 this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
621 this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
622 this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
623 this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
624 this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
625 this._getFoldWidgetBase = this.getFoldWidget;
626 this.getFoldWidget = function (session, foldStyle, row) {
627 var line = session.getLine(row);
628 if (this.singleLineBlockCommentRe.test(line)) {
629 if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
630 return "";
631 }
632 var fw = this._getFoldWidgetBase(session, foldStyle, row);
633 if (!fw && this.startRegionRe.test(line))
634 return "start"; // lineCommentRegionStart
635 return fw;
636 };
637 this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
638 var line = session.getLine(row);
639 if (this.startRegionRe.test(line))
640 return this.getCommentRegionBlock(session, line, row);
641 var match = line.match(this.foldingStartMarker);
642 if (match) {
643 var i = match.index;
644 if (match[1])
645 return this.openingBracketBlock(session, match[1], row, i);
646 var range = session.getCommentFoldRange(row, i + match[0].length, 1);
647 if (range && !range.isMultiLine()) {
648 if (forceMultiline) {
649 range = this.getSectionRange(session, row);
650 }
651 else if (foldStyle != "all")
652 range = null;
653 }
654 return range;
655 }
656 if (foldStyle === "markbegin")
657 return;
658 var match = line.match(this.foldingStopMarker);
659 if (match) {
660 var i = match.index + match[0].length;
661 if (match[1])
662 return this.closingBracketBlock(session, match[1], row, i);
663 return session.getCommentFoldRange(row, i, -1);
664 }
665 };
666 this.getSectionRange = function (session, row) {
667 var line = session.getLine(row);
668 var startIndent = line.search(/\S/);
669 var startRow = row;
670 var startColumn = line.length;
671 row = row + 1;
672 var endRow = row;
673 var maxRow = session.getLength();
674 while (++row < maxRow) {
675 line = session.getLine(row);
676 var indent = line.search(/\S/);
677 if (indent === -1)
678 continue;
679 if (startIndent > indent)
680 break;
681 var subRange = this.getFoldWidgetRange(session, "all", row);
682 if (subRange) {
683 if (subRange.start.row <= startRow) {
684 break;
685 }
686 else if (subRange.isMultiLine()) {
687 row = subRange.end.row;
688 }
689 else if (startIndent == indent) {
690 break;
691 }
692 }
693 endRow = row;
694 }
695 return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
696 };
697 this.getCommentRegionBlock = function (session, line, row) {
698 var startColumn = line.search(/\s*$/);
699 var maxRow = session.getLength();
700 var startRow = row;
701 var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
702 var depth = 1;
703 while (++row < maxRow) {
704 line = session.getLine(row);
705 var m = re.exec(line);
706 if (!m)
707 continue;
708 if (m[1])
709 depth--;
710 else
711 depth++;
712 if (!depth)
713 break;
714 }
715 var endRow = row;
716 if (endRow > startRow) {
717 return new Range(startRow, startColumn, endRow, line.length);
718 }
719 };
720 }).call(FoldMode.prototype);
721
722 });
723
724 define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
725 var oop = require("../lib/oop");
726 var TextMode = require("./text").Mode;
727 var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
728 var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
729 var WorkerClient = require("../worker/worker_client").WorkerClient;
730 var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
731 var CStyleFoldMode = require("./folding/cstyle").FoldMode;
732 var Mode = function () {
733 this.HighlightRules = JavaScriptHighlightRules;
734 this.$outdent = new MatchingBraceOutdent();
735 this.$behaviour = new CstyleBehaviour();
736 this.foldingRules = new CStyleFoldMode();
737 };
738 oop.inherits(Mode, TextMode);
739 (function () {
740 this.lineCommentStart = "//";
741 this.blockComment = { start: "/*", end: "*/" };
742 this.$quotes = { '"': '"', "'": "'", "`": "`" };
743 this.getNextLineIndent = function (state, line, tab) {
744 var indent = this.$getIndent(line);
745 var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
746 var tokens = tokenizedLine.tokens;
747 var endState = tokenizedLine.state;
748 if (tokens.length && tokens[tokens.length - 1].type == "comment") {
749 return indent;
750 }
751 if (state == "start" || state == "no_regex") {
752 var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);
753 if (match) {
754 indent += tab;
755 }
756 }
757 else if (state == "doc-start") {
758 if (endState == "start" || endState == "no_regex") {
759 return "";
760 }
761 var match = line.match(/^\s*(\/?)\*/);
762 if (match) {
763 if (match[1]) {
764 indent += " ";
765 }
766 indent += "* ";
767 }
768 }
769 return indent;
770 };
771 this.checkOutdent = function (state, line, input) {
772 return this.$outdent.checkOutdent(line, input);
773 };
774 this.autoOutdent = function (state, doc, row) {
775 this.$outdent.autoOutdent(doc, row);
776 };
777 this.createWorker = function (session) {
778 var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
779 worker.attachToDocument(session.getDocument());
780 worker.on("annotate", function (results) {
781 session.setAnnotations(results.data);
782 });
783 worker.on("terminate", function () {
784 session.clearAnnotations();
785 });
786 return worker;
787 };
788 this.$id = "ace/mode/javascript";
789 this.snippetFileId = "ace/snippets/javascript";
790 }).call(Mode.prototype);
791 exports.Mode = Mode;
792
793 });
794
795 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";
796 var oop = require("../lib/oop");
797 var lang = require("../lib/lang");
798 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
799 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";
800 var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
801 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";
802 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";
803 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";
804 var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))";
805 var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
806 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";
807 var CssHighlightRules = function () {
808 var keywordMapper = this.createKeywordMapper({
809 "support.function": supportFunction,
810 "support.constant": supportConstant,
811 "support.type": supportType,
812 "support.constant.color": supportConstantColor,
813 "support.constant.fonts": supportConstantFonts
814 }, "text", true);
815 this.$rules = {
816 "start": [{
817 include: ["strings", "url", "comments"]
818 }, {
819 token: "paren.lparen",
820 regex: "\\{",
821 next: "ruleset"
822 }, {
823 token: "paren.rparen",
824 regex: "\\}"
825 }, {
826 token: "string",
827 regex: "@(?!viewport)",
828 next: "media"
829 }, {
830 token: "keyword",
831 regex: "#[a-z0-9-_]+"
832 }, {
833 token: "keyword",
834 regex: "%"
835 }, {
836 token: "variable",
837 regex: "\\.[a-z0-9-_]+"
838 }, {
839 token: "string",
840 regex: ":[a-z0-9-_]+"
841 }, {
842 token: "constant.numeric",
843 regex: numRe
844 }, {
845 token: "constant",
846 regex: "[a-z0-9-_]+"
847 }, {
848 caseInsensitive: true
849 }],
850 "media": [{
851 include: ["strings", "url", "comments"]
852 }, {
853 token: "paren.lparen",
854 regex: "\\{",
855 next: "start"
856 }, {
857 token: "paren.rparen",
858 regex: "\\}",
859 next: "start"
860 }, {
861 token: "string",
862 regex: ";",
863 next: "start"
864 }, {
865 token: "keyword",
866 regex: "(?:media|supports|document|charset|import|namespace|media|supports|document"
867 + "|page|font|keyframes|viewport|counter-style|font-feature-values"
868 + "|swash|ornaments|annotation|stylistic|styleset|character-variant)"
869 }],
870 "comments": [{
871 token: "comment",
872 regex: "\\/\\*",
873 push: [{
874 token: "comment",
875 regex: "\\*\\/",
876 next: "pop"
877 }, {
878 defaultToken: "comment"
879 }]
880 }],
881 "ruleset": [{
882 regex: "-(webkit|ms|moz|o)-",
883 token: "text"
884 }, {
885 token: "punctuation.operator",
886 regex: "[:;]"
887 }, {
888 token: "paren.rparen",
889 regex: "\\}",
890 next: "start"
891 }, {
892 include: ["strings", "url", "comments"]
893 }, {
894 token: ["constant.numeric", "keyword"],
895 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|%)"
896 }, {
897 token: "constant.numeric",
898 regex: numRe
899 }, {
900 token: "constant.numeric",
901 regex: "#[a-f0-9]{6}"
902 }, {
903 token: "constant.numeric",
904 regex: "#[a-f0-9]{3}"
905 }, {
906 token: ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
907 regex: pseudoElements
908 }, {
909 token: ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
910 regex: pseudoClasses
911 }, {
912 include: "url"
913 }, {
914 token: keywordMapper,
915 regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
916 }, {
917 caseInsensitive: true
918 }],
919 url: [{
920 token: "support.function",
921 regex: "(?:url(:?-prefix)?|domain|regexp)\\(",
922 push: [{
923 token: "support.function",
924 regex: "\\)",
925 next: "pop"
926 }, {
927 defaultToken: "string"
928 }]
929 }],
930 strings: [{
931 token: "string.start",
932 regex: "'",
933 push: [{
934 token: "string.end",
935 regex: "'|$",
936 next: "pop"
937 }, {
938 include: "escapes"
939 }, {
940 token: "constant.language.escape",
941 regex: /\\$/,
942 consumeLineEnd: true
943 }, {
944 defaultToken: "string"
945 }]
946 }, {
947 token: "string.start",
948 regex: '"',
949 push: [{
950 token: "string.end",
951 regex: '"|$',
952 next: "pop"
953 }, {
954 include: "escapes"
955 }, {
956 token: "constant.language.escape",
957 regex: /\\$/,
958 consumeLineEnd: true
959 }, {
960 defaultToken: "string"
961 }]
962 }],
963 escapes: [{
964 token: "constant.language.escape",
965 regex: /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/
966 }]
967 };
968 this.normalizeRules();
969 };
970 oop.inherits(CssHighlightRules, TextHighlightRules);
971 exports.CssHighlightRules = CssHighlightRules;
972
973 });
974
975 define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module){"use strict";
976 var propertyMap = {
977 "background": { "#$0": 1 },
978 "background-color": { "#$0": 1, "transparent": 1, "fixed": 1 },
979 "background-image": { "url('/$0')": 1 },
980 "background-repeat": { "repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1 },
981 "background-position": { "bottom": 2, "center": 2, "left": 2, "right": 2, "top": 2, "inherit": 2 },
982 "background-attachment": { "scroll": 1, "fixed": 1 },
983 "background-size": { "cover": 1, "contain": 1 },
984 "background-clip": { "border-box": 1, "padding-box": 1, "content-box": 1 },
985 "background-origin": { "border-box": 1, "padding-box": 1, "content-box": 1 },
986 "border": { "solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1 },
987 "border-color": { "#$0": 1 },
988 "border-style": { "solid": 2, "dashed": 2, "dotted": 2, "double": 2, "groove": 2, "hidden": 2, "inherit": 2, "inset": 2, "none": 2, "outset": 2, "ridged": 2 },
989 "border-collapse": { "collapse": 1, "separate": 1 },
990 "bottom": { "px": 1, "em": 1, "%": 1 },
991 "clear": { "left": 1, "right": 1, "both": 1, "none": 1 },
992 "color": { "#$0": 1, "rgb(#$00,0,0)": 1 },
993 "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 },
994 "display": { "none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1 },
995 "empty-cells": { "show": 1, "hide": 1 },
996 "float": { "left": 1, "right": 1, "none": 1 },
997 "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 },
998 "font-size": { "px": 1, "em": 1, "%": 1 },
999 "font-weight": { "bold": 1, "normal": 1 },
1000 "font-style": { "italic": 1, "normal": 1 },
1001 "font-variant": { "normal": 1, "small-caps": 1 },
1002 "height": { "px": 1, "em": 1, "%": 1 },
1003 "left": { "px": 1, "em": 1, "%": 1 },
1004 "letter-spacing": { "normal": 1 },
1005 "line-height": { "normal": 1 },
1006 "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 },
1007 "margin": { "px": 1, "em": 1, "%": 1 },
1008 "margin-right": { "px": 1, "em": 1, "%": 1 },
1009 "margin-left": { "px": 1, "em": 1, "%": 1 },
1010 "margin-top": { "px": 1, "em": 1, "%": 1 },
1011 "margin-bottom": { "px": 1, "em": 1, "%": 1 },
1012 "max-height": { "px": 1, "em": 1, "%": 1 },
1013 "max-width": { "px": 1, "em": 1, "%": 1 },
1014 "min-height": { "px": 1, "em": 1, "%": 1 },
1015 "min-width": { "px": 1, "em": 1, "%": 1 },
1016 "overflow": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
1017 "overflow-x": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
1018 "overflow-y": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
1019 "padding": { "px": 1, "em": 1, "%": 1 },
1020 "padding-top": { "px": 1, "em": 1, "%": 1 },
1021 "padding-right": { "px": 1, "em": 1, "%": 1 },
1022 "padding-bottom": { "px": 1, "em": 1, "%": 1 },
1023 "padding-left": { "px": 1, "em": 1, "%": 1 },
1024 "page-break-after": { "auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1 },
1025 "page-break-before": { "auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1 },
1026 "position": { "absolute": 1, "relative": 1, "fixed": 1, "static": 1 },
1027 "right": { "px": 1, "em": 1, "%": 1 },
1028 "table-layout": { "fixed": 1, "auto": 1 },
1029 "text-decoration": { "none": 1, "underline": 1, "line-through": 1, "blink": 1 },
1030 "text-align": { "left": 1, "right": 1, "center": 1, "justify": 1 },
1031 "text-transform": { "capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1 },
1032 "top": { "px": 1, "em": 1, "%": 1 },
1033 "vertical-align": { "top": 1, "bottom": 1 },
1034 "visibility": { "hidden": 1, "visible": 1 },
1035 "white-space": { "nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1 },
1036 "width": { "px": 1, "em": 1, "%": 1 },
1037 "word-spacing": { "normal": 1 },
1038 "filter": { "alpha(opacity=$0100)": 1 },
1039 "text-shadow": { "$02px 2px 2px #777": 1 },
1040 "text-overflow": { "ellipsis-word": 1, "clip": 1, "ellipsis": 1 },
1041 "-moz-border-radius": 1,
1042 "-moz-border-radius-topright": 1,
1043 "-moz-border-radius-bottomright": 1,
1044 "-moz-border-radius-topleft": 1,
1045 "-moz-border-radius-bottomleft": 1,
1046 "-webkit-border-radius": 1,
1047 "-webkit-border-top-right-radius": 1,
1048 "-webkit-border-top-left-radius": 1,
1049 "-webkit-border-bottom-right-radius": 1,
1050 "-webkit-border-bottom-left-radius": 1,
1051 "-moz-box-shadow": 1,
1052 "-webkit-box-shadow": 1,
1053 "transform": { "rotate($00deg)": 1, "skew($00deg)": 1 },
1054 "-moz-transform": { "rotate($00deg)": 1, "skew($00deg)": 1 },
1055 "-webkit-transform": { "rotate($00deg)": 1, "skew($00deg)": 1 }
1056 };
1057 var CssCompletions = function () {
1058 };
1059 (function () {
1060 this.completionsDefined = false;
1061 this.defineCompletions = function () {
1062 if (document) {
1063 var style = document.createElement('c').style;
1064 for (var i in style) {
1065 if (typeof style[i] !== 'string')
1066 continue;
1067 var name = i.replace(/[A-Z]/g, function (x) {
1068 return '-' + x.toLowerCase();
1069 });
1070 if (!propertyMap.hasOwnProperty(name))
1071 propertyMap[name] = 1;
1072 }
1073 }
1074 this.completionsDefined = true;
1075 };
1076 this.getCompletions = function (state, session, pos, prefix) {
1077 if (!this.completionsDefined) {
1078 this.defineCompletions();
1079 }
1080 if (state === 'ruleset' || session.$mode.$id == "ace/mode/scss") {
1081 var line = session.getLine(pos.row).substr(0, pos.column);
1082 var inParens = /\([^)]*$/.test(line);
1083 if (inParens) {
1084 line = line.substr(line.lastIndexOf('(') + 1);
1085 }
1086 if (/:[^;]+$/.test(line)) {
1087 /([\w\-]+):[^:]*$/.test(line);
1088 return this.getPropertyValueCompletions(state, session, pos, prefix);
1089 }
1090 else {
1091 return this.getPropertyCompletions(state, session, pos, prefix, inParens);
1092 }
1093 }
1094 return [];
1095 };
1096 this.getPropertyCompletions = function (state, session, pos, prefix, skipSemicolon) {
1097 skipSemicolon = skipSemicolon || false;
1098 var properties = Object.keys(propertyMap);
1099 return properties.map(function (property) {
1100 return {
1101 caption: property,
1102 snippet: property + ': $0' + (skipSemicolon ? '' : ';'),
1103 meta: "property",
1104 score: 1000000
1105 };
1106 });
1107 };
1108 this.getPropertyValueCompletions = function (state, session, pos, prefix) {
1109 var line = session.getLine(pos.row).substr(0, pos.column);
1110 var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1];
1111 if (!property)
1112 return [];
1113 var values = [];
1114 if (property in propertyMap && typeof propertyMap[property] === "object") {
1115 values = Object.keys(propertyMap[property]);
1116 }
1117 return values.map(function (value) {
1118 return {
1119 caption: value,
1120 snippet: value,
1121 meta: "property value",
1122 score: 1000000
1123 };
1124 });
1125 };
1126 }).call(CssCompletions.prototype);
1127 exports.CssCompletions = CssCompletions;
1128
1129 });
1130
1131 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";
1132 var oop = require("../../lib/oop");
1133 var Behaviour = require("../behaviour").Behaviour;
1134 var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
1135 var TokenIterator = require("../../token_iterator").TokenIterator;
1136 var CssBehaviour = function () {
1137 this.inherit(CstyleBehaviour);
1138 this.add("colon", "insertion", function (state, action, editor, session, text) {
1139 if (text === ':' && editor.selection.isEmpty()) {
1140 var cursor = editor.getCursorPosition();
1141 var iterator = new TokenIterator(session, cursor.row, cursor.column);
1142 var token = iterator.getCurrentToken();
1143 if (token && token.value.match(/\s+/)) {
1144 token = iterator.stepBackward();
1145 }
1146 if (token && token.type === 'support.type') {
1147 var line = session.doc.getLine(cursor.row);
1148 var rightChar = line.substring(cursor.column, cursor.column + 1);
1149 if (rightChar === ':') {
1150 return {
1151 text: '',
1152 selection: [1, 1]
1153 };
1154 }
1155 if (/^(\s+[^;]|\s*$)/.test(line.substring(cursor.column))) {
1156 return {
1157 text: ':;',
1158 selection: [1, 1]
1159 };
1160 }
1161 }
1162 }
1163 });
1164 this.add("colon", "deletion", function (state, action, editor, session, range) {
1165 var selected = session.doc.getTextRange(range);
1166 if (!range.isMultiLine() && selected === ':') {
1167 var cursor = editor.getCursorPosition();
1168 var iterator = new TokenIterator(session, cursor.row, cursor.column);
1169 var token = iterator.getCurrentToken();
1170 if (token && token.value.match(/\s+/)) {
1171 token = iterator.stepBackward();
1172 }
1173 if (token && token.type === 'support.type') {
1174 var line = session.doc.getLine(range.start.row);
1175 var rightChar = line.substring(range.end.column, range.end.column + 1);
1176 if (rightChar === ';') {
1177 range.end.column++;
1178 return range;
1179 }
1180 }
1181 }
1182 });
1183 this.add("semicolon", "insertion", function (state, action, editor, session, text) {
1184 if (text === ';' && editor.selection.isEmpty()) {
1185 var cursor = editor.getCursorPosition();
1186 var line = session.doc.getLine(cursor.row);
1187 var rightChar = line.substring(cursor.column, cursor.column + 1);
1188 if (rightChar === ';') {
1189 return {
1190 text: '',
1191 selection: [1, 1]
1192 };
1193 }
1194 }
1195 });
1196 this.add("!important", "insertion", function (state, action, editor, session, text) {
1197 if (text === '!' && editor.selection.isEmpty()) {
1198 var cursor = editor.getCursorPosition();
1199 var line = session.doc.getLine(cursor.row);
1200 if (/^\s*(;|}|$)/.test(line.substring(cursor.column))) {
1201 return {
1202 text: '!important',
1203 selection: [10, 10]
1204 };
1205 }
1206 }
1207 });
1208 };
1209 oop.inherits(CssBehaviour, CstyleBehaviour);
1210 exports.CssBehaviour = CssBehaviour;
1211
1212 });
1213
1214 define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
1215 var oop = require("../lib/oop");
1216 var TextMode = require("./text").Mode;
1217 var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
1218 var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
1219 var WorkerClient = require("../worker/worker_client").WorkerClient;
1220 var CssCompletions = require("./css_completions").CssCompletions;
1221 var CssBehaviour = require("./behaviour/css").CssBehaviour;
1222 var CStyleFoldMode = require("./folding/cstyle").FoldMode;
1223 var Mode = function () {
1224 this.HighlightRules = CssHighlightRules;
1225 this.$outdent = new MatchingBraceOutdent();
1226 this.$behaviour = new CssBehaviour();
1227 this.$completer = new CssCompletions();
1228 this.foldingRules = new CStyleFoldMode();
1229 };
1230 oop.inherits(Mode, TextMode);
1231 (function () {
1232 this.foldingRules = "cStyle";
1233 this.blockComment = { start: "/*", end: "*/" };
1234 this.getNextLineIndent = function (state, line, tab) {
1235 var indent = this.$getIndent(line);
1236 var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
1237 if (tokens.length && tokens[tokens.length - 1].type == "comment") {
1238 return indent;
1239 }
1240 var match = line.match(/^.*\{\s*$/);
1241 if (match) {
1242 indent += tab;
1243 }
1244 return indent;
1245 };
1246 this.checkOutdent = function (state, line, input) {
1247 return this.$outdent.checkOutdent(line, input);
1248 };
1249 this.autoOutdent = function (state, doc, row) {
1250 this.$outdent.autoOutdent(doc, row);
1251 };
1252 this.getCompletions = function (state, session, pos, prefix) {
1253 return this.$completer.getCompletions(state, session, pos, prefix);
1254 };
1255 this.createWorker = function (session) {
1256 var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
1257 worker.attachToDocument(session.getDocument());
1258 worker.on("annotate", function (e) {
1259 session.setAnnotations(e.data);
1260 });
1261 worker.on("terminate", function () {
1262 session.clearAnnotations();
1263 });
1264 return worker;
1265 };
1266 this.$id = "ace/mode/css";
1267 this.snippetFileId = "ace/snippets/css";
1268 }).call(Mode.prototype);
1269 exports.Mode = Mode;
1270
1271 });
1272
1273 define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
1274 var oop = require("../lib/oop");
1275 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1276 var XmlHighlightRules = function (normalize) {
1277 var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*";
1278 this.$rules = {
1279 start: [
1280 { token: "string.cdata.xml", regex: "<\\!\\[CDATA\\[", next: "cdata" },
1281 {
1282 token: ["punctuation.instruction.xml", "keyword.instruction.xml"],
1283 regex: "(<\\?)(" + tagRegex + ")", next: "processing_instruction"
1284 },
1285 { token: "comment.start.xml", regex: "<\\!--", next: "comment" },
1286 {
1287 token: ["xml-pe.doctype.xml", "xml-pe.doctype.xml"],
1288 regex: "(<\\!)(DOCTYPE)(?=[\\s])", next: "doctype", caseInsensitive: true
1289 },
1290 { include: "tag" },
1291 { token: "text.end-tag-open.xml", regex: "</" },
1292 { token: "text.tag-open.xml", regex: "<" },
1293 { include: "reference" },
1294 { defaultToken: "text.xml" }
1295 ],
1296 processing_instruction: [{
1297 token: "entity.other.attribute-name.decl-attribute-name.xml",
1298 regex: tagRegex
1299 }, {
1300 token: "keyword.operator.decl-attribute-equals.xml",
1301 regex: "="
1302 }, {
1303 include: "whitespace"
1304 }, {
1305 include: "string"
1306 }, {
1307 token: "punctuation.xml-decl.xml",
1308 regex: "\\?>",
1309 next: "start"
1310 }],
1311 doctype: [
1312 { include: "whitespace" },
1313 { include: "string" },
1314 { token: "xml-pe.doctype.xml", regex: ">", next: "start" },
1315 { token: "xml-pe.xml", regex: "[-_a-zA-Z0-9:]+" },
1316 { token: "punctuation.int-subset", regex: "\\[", push: "int_subset" }
1317 ],
1318 int_subset: [{
1319 token: "text.xml",
1320 regex: "\\s+"
1321 }, {
1322 token: "punctuation.int-subset.xml",
1323 regex: "]",
1324 next: "pop"
1325 }, {
1326 token: ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
1327 regex: "(<\\!)(" + tagRegex + ")",
1328 push: [{
1329 token: "text",
1330 regex: "\\s+"
1331 },
1332 {
1333 token: "punctuation.markup-decl.xml",
1334 regex: ">",
1335 next: "pop"
1336 },
1337 { include: "string" }]
1338 }],
1339 cdata: [
1340 { token: "string.cdata.xml", regex: "\\]\\]>", next: "start" },
1341 { token: "text.xml", regex: "\\s+" },
1342 { token: "text.xml", regex: "(?:[^\\]]|\\](?!\\]>))+" }
1343 ],
1344 comment: [
1345 { token: "comment.end.xml", regex: "-->", next: "start" },
1346 { defaultToken: "comment.xml" }
1347 ],
1348 reference: [{
1349 token: "constant.language.escape.reference.xml",
1350 regex: "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
1351 }],
1352 attr_reference: [{
1353 token: "constant.language.escape.reference.attribute-value.xml",
1354 regex: "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
1355 }],
1356 tag: [{
1357 token: ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
1358 regex: "(?:(<)|(</))((?:" + tagRegex + ":)?" + tagRegex + ")",
1359 next: [
1360 { include: "attributes" },
1361 { token: "meta.tag.punctuation.tag-close.xml", regex: "/?>", next: "start" }
1362 ]
1363 }],
1364 tag_whitespace: [
1365 { token: "text.tag-whitespace.xml", regex: "\\s+" }
1366 ],
1367 whitespace: [
1368 { token: "text.whitespace.xml", regex: "\\s+" }
1369 ],
1370 string: [{
1371 token: "string.xml",
1372 regex: "'",
1373 push: [
1374 { token: "string.xml", regex: "'", next: "pop" },
1375 { defaultToken: "string.xml" }
1376 ]
1377 }, {
1378 token: "string.xml",
1379 regex: '"',
1380 push: [
1381 { token: "string.xml", regex: '"', next: "pop" },
1382 { defaultToken: "string.xml" }
1383 ]
1384 }],
1385 attributes: [{
1386 token: "entity.other.attribute-name.xml",
1387 regex: tagRegex
1388 }, {
1389 token: "keyword.operator.attribute-equals.xml",
1390 regex: "="
1391 }, {
1392 include: "tag_whitespace"
1393 }, {
1394 include: "attribute_value"
1395 }],
1396 attribute_value: [{
1397 token: "string.attribute-value.xml",
1398 regex: "'",
1399 push: [
1400 { token: "string.attribute-value.xml", regex: "'", next: "pop" },
1401 { include: "attr_reference" },
1402 { defaultToken: "string.attribute-value.xml" }
1403 ]
1404 }, {
1405 token: "string.attribute-value.xml",
1406 regex: '"',
1407 push: [
1408 { token: "string.attribute-value.xml", regex: '"', next: "pop" },
1409 { include: "attr_reference" },
1410 { defaultToken: "string.attribute-value.xml" }
1411 ]
1412 }]
1413 };
1414 if (this.constructor === XmlHighlightRules)
1415 this.normalizeRules();
1416 };
1417 (function () {
1418 this.embedTagRules = function (HighlightRules, prefix, tag) {
1419 this.$rules.tag.unshift({
1420 token: ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
1421 regex: "(<)(" + tag + "(?=\\s|>|$))",
1422 next: [
1423 { include: "attributes" },
1424 { token: "meta.tag.punctuation.tag-close.xml", regex: "/?>", next: prefix + "start" }
1425 ]
1426 });
1427 this.$rules[tag + "-end"] = [
1428 { include: "attributes" },
1429 { token: "meta.tag.punctuation.tag-close.xml", regex: "/?>", next: "start",
1430 onMatch: function (value, currentState, stack) {
1431 stack.splice(0);
1432 return this.token;
1433 } }
1434 ];
1435 this.embedRules(HighlightRules, prefix, [{
1436 token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
1437 regex: "(</)(" + tag + "(?=\\s|>|$))",
1438 next: tag + "-end"
1439 }, {
1440 token: "string.cdata.xml",
1441 regex: "<\\!\\[CDATA\\["
1442 }, {
1443 token: "string.cdata.xml",
1444 regex: "\\]\\]>"
1445 }]);
1446 };
1447 }).call(TextHighlightRules.prototype);
1448 oop.inherits(XmlHighlightRules, TextHighlightRules);
1449 exports.XmlHighlightRules = XmlHighlightRules;
1450
1451 });
1452
1453 define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module){"use strict";
1454 var oop = require("../lib/oop");
1455 var lang = require("../lib/lang");
1456 var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
1457 var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
1458 var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
1459 var tagMap = lang.createMap({
1460 a: 'anchor',
1461 button: 'form',
1462 form: 'form',
1463 img: 'image',
1464 input: 'form',
1465 label: 'form',
1466 option: 'form',
1467 script: 'script',
1468 select: 'form',
1469 textarea: 'form',
1470 style: 'style',
1471 table: 'table',
1472 tbody: 'table',
1473 td: 'table',
1474 tfoot: 'table',
1475 th: 'table',
1476 tr: 'table'
1477 });
1478 var HtmlHighlightRules = function () {
1479 XmlHighlightRules.call(this);
1480 this.addRules({
1481 attributes: [{
1482 include: "tag_whitespace"
1483 }, {
1484 token: "entity.other.attribute-name.xml",
1485 regex: "[-_a-zA-Z0-9:.]+"
1486 }, {
1487 token: "keyword.operator.attribute-equals.xml",
1488 regex: "=",
1489 push: [{
1490 include: "tag_whitespace"
1491 }, {
1492 token: "string.unquoted.attribute-value.html",
1493 regex: "[^<>='\"`\\s]+",
1494 next: "pop"
1495 }, {
1496 token: "empty",
1497 regex: "",
1498 next: "pop"
1499 }]
1500 }, {
1501 include: "attribute_value"
1502 }],
1503 tag: [{
1504 token: function (start, tag) {
1505 var group = tagMap[tag];
1506 return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml",
1507 "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"];
1508 },
1509 regex: "(</?)([-_a-zA-Z0-9:.]+)",
1510 next: "tag_stuff"
1511 }],
1512 tag_stuff: [
1513 { include: "attributes" },
1514 { token: "meta.tag.punctuation.tag-close.xml", regex: "/?>", next: "start" }
1515 ]
1516 });
1517 this.embedTagRules(CssHighlightRules, "css-", "style");
1518 this.embedTagRules(new JavaScriptHighlightRules({ jsx: false }).getRules(), "js-", "script");
1519 if (this.constructor === HtmlHighlightRules)
1520 this.normalizeRules();
1521 };
1522 oop.inherits(HtmlHighlightRules, XmlHighlightRules);
1523 exports.HtmlHighlightRules = HtmlHighlightRules;
1524
1525 });
1526
1527 define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
1528 var oop = require("../../lib/oop");
1529 var Behaviour = require("../behaviour").Behaviour;
1530 var TokenIterator = require("../../token_iterator").TokenIterator;
1531 var lang = require("../../lib/lang");
1532 function is(token, type) {
1533 return token && token.type.lastIndexOf(type + ".xml") > -1;
1534 }
1535 var XmlBehaviour = function () {
1536 this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
1537 if (text == '"' || text == "'") {
1538 var quote = text;
1539 var selected = session.doc.getTextRange(editor.getSelectionRange());
1540 if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
1541 return {
1542 text: quote + selected + quote,
1543 selection: false
1544 };
1545 }
1546 var cursor = editor.getCursorPosition();
1547 var line = session.doc.getLine(cursor.row);
1548 var rightChar = line.substring(cursor.column, cursor.column + 1);
1549 var iterator = new TokenIterator(session, cursor.row, cursor.column);
1550 var token = iterator.getCurrentToken();
1551 if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
1552 return {
1553 text: "",
1554 selection: [1, 1]
1555 };
1556 }
1557 if (!token)
1558 token = iterator.stepBackward();
1559 if (!token)
1560 return;
1561 while (is(token, "tag-whitespace") || is(token, "whitespace")) {
1562 token = iterator.stepBackward();
1563 }
1564 var rightSpace = !rightChar || rightChar.match(/\s/);
1565 if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
1566 return {
1567 text: quote + quote,
1568 selection: [1, 1]
1569 };
1570 }
1571 }
1572 });
1573 this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
1574 var selected = session.doc.getTextRange(range);
1575 if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
1576 var line = session.doc.getLine(range.start.row);
1577 var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
1578 if (rightChar == selected) {
1579 range.end.column++;
1580 return range;
1581 }
1582 }
1583 });
1584 this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
1585 if (text == '>') {
1586 var position = editor.getSelectionRange().start;
1587 var iterator = new TokenIterator(session, position.row, position.column);
1588 var token = iterator.getCurrentToken() || iterator.stepBackward();
1589 if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
1590 return;
1591 if (is(token, "reference.attribute-value"))
1592 return;
1593 if (is(token, "attribute-value")) {
1594 var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
1595 if (position.column < tokenEndColumn)
1596 return;
1597 if (position.column == tokenEndColumn) {
1598 var nextToken = iterator.stepForward();
1599 if (nextToken && is(nextToken, "attribute-value"))
1600 return;
1601 iterator.stepBackward();
1602 }
1603 }
1604 if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
1605 return;
1606 while (!is(token, "tag-name")) {
1607 token = iterator.stepBackward();
1608 if (token.value == "<") {
1609 token = iterator.stepForward();
1610 break;
1611 }
1612 }
1613 var tokenRow = iterator.getCurrentTokenRow();
1614 var tokenColumn = iterator.getCurrentTokenColumn();
1615 if (is(iterator.stepBackward(), "end-tag-open"))
1616 return;
1617 var element = token.value;
1618 if (tokenRow == position.row)
1619 element = element.substring(0, position.column - tokenColumn);
1620 if (this.voidElements.hasOwnProperty(element.toLowerCase()))
1621 return;
1622 return {
1623 text: ">" + "</" + element + ">",
1624 selection: [1, 1]
1625 };
1626 }
1627 });
1628 this.add("autoindent", "insertion", function (state, action, editor, session, text) {
1629 if (text == "\n") {
1630 var cursor = editor.getCursorPosition();
1631 var line = session.getLine(cursor.row);
1632 var iterator = new TokenIterator(session, cursor.row, cursor.column);
1633 var token = iterator.getCurrentToken();
1634 if (token && token.type.indexOf("tag-close") !== -1) {
1635 if (token.value == "/>")
1636 return;
1637 while (token && token.type.indexOf("tag-name") === -1) {
1638 token = iterator.stepBackward();
1639 }
1640 if (!token) {
1641 return;
1642 }
1643 var tag = token.value;
1644 var row = iterator.getCurrentTokenRow();
1645 token = iterator.stepBackward();
1646 if (!token || token.type.indexOf("end-tag") !== -1) {
1647 return;
1648 }
1649 if (this.voidElements && !this.voidElements[tag]) {
1650 var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
1651 var line = session.getLine(row);
1652 var nextIndent = this.$getIndent(line);
1653 var indent = nextIndent + session.getTabString();
1654 if (nextToken && nextToken.value === "</") {
1655 return {
1656 text: "\n" + indent + "\n" + nextIndent,
1657 selection: [1, indent.length, 1, indent.length]
1658 };
1659 }
1660 else {
1661 return {
1662 text: "\n" + indent
1663 };
1664 }
1665 }
1666 }
1667 }
1668 });
1669 };
1670 oop.inherits(XmlBehaviour, Behaviour);
1671 exports.XmlBehaviour = XmlBehaviour;
1672
1673 });
1674
1675 define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
1676 var oop = require("../../lib/oop");
1677 var BaseFoldMode = require("./fold_mode").FoldMode;
1678 var FoldMode = exports.FoldMode = function (defaultMode, subModes) {
1679 this.defaultMode = defaultMode;
1680 this.subModes = subModes;
1681 };
1682 oop.inherits(FoldMode, BaseFoldMode);
1683 (function () {
1684 this.$getMode = function (state) {
1685 if (typeof state != "string")
1686 state = state[0];
1687 for (var key in this.subModes) {
1688 if (state.indexOf(key) === 0)
1689 return this.subModes[key];
1690 }
1691 return null;
1692 };
1693 this.$tryMode = function (state, session, foldStyle, row) {
1694 var mode = this.$getMode(state);
1695 return (mode ? mode.getFoldWidget(session, foldStyle, row) : "");
1696 };
1697 this.getFoldWidget = function (session, foldStyle, row) {
1698 return (this.$tryMode(session.getState(row - 1), session, foldStyle, row) ||
1699 this.$tryMode(session.getState(row), session, foldStyle, row) ||
1700 this.defaultMode.getFoldWidget(session, foldStyle, row));
1701 };
1702 this.getFoldWidgetRange = function (session, foldStyle, row) {
1703 var mode = this.$getMode(session.getState(row - 1));
1704 if (!mode || !mode.getFoldWidget(session, foldStyle, row))
1705 mode = this.$getMode(session.getState(row));
1706 if (!mode || !mode.getFoldWidget(session, foldStyle, row))
1707 mode = this.defaultMode;
1708 return mode.getFoldWidgetRange(session, foldStyle, row);
1709 };
1710 }).call(FoldMode.prototype);
1711
1712 });
1713
1714 define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
1715 var oop = require("../../lib/oop");
1716 var Range = require("../../range").Range;
1717 var BaseFoldMode = require("./fold_mode").FoldMode;
1718 var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
1719 BaseFoldMode.call(this);
1720 this.voidElements = voidElements || {};
1721 this.optionalEndTags = oop.mixin({}, this.voidElements);
1722 if (optionalEndTags)
1723 oop.mixin(this.optionalEndTags, optionalEndTags);
1724 };
1725 oop.inherits(FoldMode, BaseFoldMode);
1726 var Tag = function () {
1727 this.tagName = "";
1728 this.closing = false;
1729 this.selfClosing = false;
1730 this.start = { row: 0, column: 0 };
1731 this.end = { row: 0, column: 0 };
1732 };
1733 function is(token, type) {
1734 return token.type.lastIndexOf(type + ".xml") > -1;
1735 }
1736 (function () {
1737 this.getFoldWidget = function (session, foldStyle, row) {
1738 var tag = this._getFirstTagInLine(session, row);
1739 if (!tag)
1740 return this.getCommentFoldWidget(session, row);
1741 if (tag.closing || (!tag.tagName && tag.selfClosing))
1742 return foldStyle === "markbeginend" ? "end" : "";
1743 if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
1744 return "";
1745 if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
1746 return "";
1747 return "start";
1748 };
1749 this.getCommentFoldWidget = function (session, row) {
1750 if (/comment/.test(session.getState(row)) && /<!-/.test(session.getLine(row)))
1751 return "start";
1752 return "";
1753 };
1754 this._getFirstTagInLine = function (session, row) {
1755 var tokens = session.getTokens(row);
1756 var tag = new Tag();
1757 for (var i = 0; i < tokens.length; i++) {
1758 var token = tokens[i];
1759 if (is(token, "tag-open")) {
1760 tag.end.column = tag.start.column + token.value.length;
1761 tag.closing = is(token, "end-tag-open");
1762 token = tokens[++i];
1763 if (!token)
1764 return null;
1765 tag.tagName = token.value;
1766 tag.end.column += token.value.length;
1767 for (i++; i < tokens.length; i++) {
1768 token = tokens[i];
1769 tag.end.column += token.value.length;
1770 if (is(token, "tag-close")) {
1771 tag.selfClosing = token.value == '/>';
1772 break;
1773 }
1774 }
1775 return tag;
1776 }
1777 else if (is(token, "tag-close")) {
1778 tag.selfClosing = token.value == '/>';
1779 return tag;
1780 }
1781 tag.start.column += token.value.length;
1782 }
1783 return null;
1784 };
1785 this._findEndTagInLine = function (session, row, tagName, startColumn) {
1786 var tokens = session.getTokens(row);
1787 var column = 0;
1788 for (var i = 0; i < tokens.length; i++) {
1789 var token = tokens[i];
1790 column += token.value.length;
1791 if (column < startColumn)
1792 continue;
1793 if (is(token, "end-tag-open")) {
1794 token = tokens[i + 1];
1795 if (token && token.value == tagName)
1796 return true;
1797 }
1798 }
1799 return false;
1800 };
1801 this.getFoldWidgetRange = function (session, foldStyle, row) {
1802 var tags = session.getMatchingTags({ row: row, column: 0 });
1803 if (tags) {
1804 return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
1805 }
1806 else {
1807 return this.getCommentFoldWidget(session, row)
1808 && session.getCommentFoldRange(row, session.getLine(row).length);
1809 }
1810 };
1811 }).call(FoldMode.prototype);
1812
1813 });
1814
1815 define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
1816 var oop = require("../../lib/oop");
1817 var MixedFoldMode = require("./mixed").FoldMode;
1818 var XmlFoldMode = require("./xml").FoldMode;
1819 var CStyleFoldMode = require("./cstyle").FoldMode;
1820 var FoldMode = exports.FoldMode = function (voidElements, optionalTags) {
1821 MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), {
1822 "js-": new CStyleFoldMode(),
1823 "css-": new CStyleFoldMode()
1824 });
1825 };
1826 oop.inherits(FoldMode, MixedFoldMode);
1827
1828 });
1829
1830 define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module){"use strict";
1831 var TokenIterator = require("../token_iterator").TokenIterator;
1832 var commonAttributes = [
1833 "accesskey",
1834 "class",
1835 "contenteditable",
1836 "contextmenu",
1837 "dir",
1838 "draggable",
1839 "dropzone",
1840 "hidden",
1841 "id",
1842 "inert",
1843 "itemid",
1844 "itemprop",
1845 "itemref",
1846 "itemscope",
1847 "itemtype",
1848 "lang",
1849 "spellcheck",
1850 "style",
1851 "tabindex",
1852 "title",
1853 "translate"
1854 ];
1855 var eventAttributes = [
1856 "onabort",
1857 "onblur",
1858 "oncancel",
1859 "oncanplay",
1860 "oncanplaythrough",
1861 "onchange",
1862 "onclick",
1863 "onclose",
1864 "oncontextmenu",
1865 "oncuechange",
1866 "ondblclick",
1867 "ondrag",
1868 "ondragend",
1869 "ondragenter",
1870 "ondragleave",
1871 "ondragover",
1872 "ondragstart",
1873 "ondrop",
1874 "ondurationchange",
1875 "onemptied",
1876 "onended",
1877 "onerror",
1878 "onfocus",
1879 "oninput",
1880 "oninvalid",
1881 "onkeydown",
1882 "onkeypress",
1883 "onkeyup",
1884 "onload",
1885 "onloadeddata",
1886 "onloadedmetadata",
1887 "onloadstart",
1888 "onmousedown",
1889 "onmousemove",
1890 "onmouseout",
1891 "onmouseover",
1892 "onmouseup",
1893 "onmousewheel",
1894 "onpause",
1895 "onplay",
1896 "onplaying",
1897 "onprogress",
1898 "onratechange",
1899 "onreset",
1900 "onscroll",
1901 "onseeked",
1902 "onseeking",
1903 "onselect",
1904 "onshow",
1905 "onstalled",
1906 "onsubmit",
1907 "onsuspend",
1908 "ontimeupdate",
1909 "onvolumechange",
1910 "onwaiting"
1911 ];
1912 var globalAttributes = commonAttributes.concat(eventAttributes);
1913 var attributeMap = {
1914 "a": { "href": 1, "target": { "_blank": 1, "top": 1 }, "ping": 1, "rel": { "nofollow": 1, "alternate": 1, "author": 1, "bookmark": 1, "help": 1, "license": 1, "next": 1, "noreferrer": 1, "prefetch": 1, "prev": 1, "search": 1, "tag": 1 }, "media": 1, "hreflang": 1, "type": 1 },
1915 "abbr": {},
1916 "address": {},
1917 "area": { "shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1 },
1918 "article": { "pubdate": 1 },
1919 "aside": {},
1920 "audio": { "src": 1, "autobuffer": 1, "autoplay": { "autoplay": 1 }, "loop": { "loop": 1 }, "controls": { "controls": 1 }, "muted": { "muted": 1 }, "preload": { "auto": 1, "metadata": 1, "none": 1 } },
1921 "b": {},
1922 "base": { "href": 1, "target": 1 },
1923 "bdi": {},
1924 "bdo": {},
1925 "blockquote": { "cite": 1 },
1926 "body": { "onafterprint": 1, "onbeforeprint": 1, "onbeforeunload": 1, "onhashchange": 1, "onmessage": 1, "onoffline": 1, "onpopstate": 1, "onredo": 1, "onresize": 1, "onstorage": 1, "onundo": 1, "onunload": 1 },
1927 "br": {},
1928 "button": { "autofocus": 1, "disabled": { "disabled": 1 }, "form": 1, "formaction": 1, "formenctype": 1, "formmethod": 1, "formnovalidate": 1, "formtarget": 1, "name": 1, "value": 1, "type": { "button": 1, "submit": 1 } },
1929 "canvas": { "width": 1, "height": 1 },
1930 "caption": {},
1931 "cite": {},
1932 "code": {},
1933 "col": { "span": 1 },
1934 "colgroup": { "span": 1 },
1935 "command": { "type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1 },
1936 "data": {},
1937 "datalist": {},
1938 "dd": {},
1939 "del": { "cite": 1, "datetime": 1 },
1940 "details": { "open": 1 },
1941 "dfn": {},
1942 "dialog": { "open": 1 },
1943 "div": {},
1944 "dl": {},
1945 "dt": {},
1946 "em": {},
1947 "embed": { "src": 1, "height": 1, "width": 1, "type": 1 },
1948 "fieldset": { "disabled": 1, "form": 1, "name": 1 },
1949 "figcaption": {},
1950 "figure": {},
1951 "footer": {},
1952 "form": { "accept-charset": 1, "action": 1, "autocomplete": 1, "enctype": { "multipart/form-data": 1, "application/x-www-form-urlencoded": 1 }, "method": { "get": 1, "post": 1 }, "name": 1, "novalidate": 1, "target": { "_blank": 1, "top": 1 } },
1953 "h1": {},
1954 "h2": {},
1955 "h3": {},
1956 "h4": {},
1957 "h5": {},
1958 "h6": {},
1959 "head": {},
1960 "header": {},
1961 "hr": {},
1962 "html": { "manifest": 1 },
1963 "i": {},
1964 "iframe": { "name": 1, "src": 1, "height": 1, "width": 1, "sandbox": { "allow-same-origin": 1, "allow-top-navigation": 1, "allow-forms": 1, "allow-scripts": 1 }, "seamless": { "seamless": 1 } },
1965 "img": { "alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1 },
1966 "input": {
1967 "type": { "text": 1, "password": 1, "hidden": 1, "checkbox": 1, "submit": 1, "radio": 1, "file": 1, "button": 1, "reset": 1, "image": 31, "color": 1, "date": 1, "datetime": 1, "datetime-local": 1, "email": 1, "month": 1, "number": 1, "range": 1, "search": 1, "tel": 1, "time": 1, "url": 1, "week": 1 },
1968 "accept": 1, "alt": 1, "autocomplete": { "on": 1, "off": 1 }, "autofocus": { "autofocus": 1 }, "checked": { "checked": 1 }, "disabled": { "disabled": 1 }, "form": 1, "formaction": 1, "formenctype": { "application/x-www-form-urlencoded": 1, "multipart/form-data": 1, "text/plain": 1 }, "formmethod": { "get": 1, "post": 1 }, "formnovalidate": { "formnovalidate": 1 }, "formtarget": { "_blank": 1, "_self": 1, "_parent": 1, "_top": 1 }, "height": 1, "list": 1, "max": 1, "maxlength": 1, "min": 1, "multiple": { "multiple": 1 }, "name": 1, "pattern": 1, "placeholder": 1, "readonly": { "readonly": 1 }, "required": { "required": 1 }, "size": 1, "src": 1, "step": 1, "width": 1, "files": 1, "value": 1
1969 },
1970 "ins": { "cite": 1, "datetime": 1 },
1971 "kbd": {},
1972 "keygen": { "autofocus": 1, "challenge": { "challenge": 1 }, "disabled": { "disabled": 1 }, "form": 1, "keytype": { "rsa": 1, "dsa": 1, "ec": 1 }, "name": 1 },
1973 "label": { "form": 1, "for": 1 },
1974 "legend": {},
1975 "li": { "value": 1 },
1976 "link": { "href": 1, "hreflang": 1, "rel": { "stylesheet": 1, "icon": 1 }, "media": { "all": 1, "screen": 1, "print": 1 }, "type": { "text/css": 1, "image/png": 1, "image/jpeg": 1, "image/gif": 1 }, "sizes": 1 },
1977 "main": {},
1978 "map": { "name": 1 },
1979 "mark": {},
1980 "math": {},
1981 "menu": { "type": 1, "label": 1 },
1982 "meta": { "http-equiv": { "content-type": 1 }, "name": { "description": 1, "keywords": 1 }, "content": { "text/html; charset=UTF-8": 1 }, "charset": 1 },
1983 "meter": { "value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1 },
1984 "nav": {},
1985 "noscript": { "href": 1 },
1986 "object": { "param": 1, "data": 1, "type": 1, "height": 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1 },
1987 "ol": { "start": 1, "reversed": 1 },
1988 "optgroup": { "disabled": 1, "label": 1 },
1989 "option": { "disabled": 1, "selected": 1, "label": 1, "value": 1 },
1990 "output": { "for": 1, "form": 1, "name": 1 },
1991 "p": {},
1992 "param": { "name": 1, "value": 1 },
1993 "pre": {},
1994 "progress": { "value": 1, "max": 1 },
1995 "q": { "cite": 1 },
1996 "rp": {},
1997 "rt": {},
1998 "ruby": {},
1999 "s": {},
2000 "samp": {},
2001 "script": { "charset": 1, "type": { "text/javascript": 1 }, "src": 1, "defer": 1, "async": 1 },
2002 "select": { "autofocus": 1, "disabled": 1, "form": 1, "multiple": { "multiple": 1 }, "name": 1, "size": 1, "readonly": { "readonly": 1 } },
2003 "small": {},
2004 "source": { "src": 1, "type": 1, "media": 1 },
2005 "span": {},
2006 "strong": {},
2007 "style": { "type": 1, "media": { "all": 1, "screen": 1, "print": 1 }, "scoped": 1 },
2008 "sub": {},
2009 "sup": {},
2010 "svg": {},
2011 "table": { "summary": 1 },
2012 "tbody": {},
2013 "td": { "headers": 1, "rowspan": 1, "colspan": 1 },
2014 "textarea": { "autofocus": { "autofocus": 1 }, "disabled": { "disabled": 1 }, "form": 1, "maxlength": 1, "name": 1, "placeholder": 1, "readonly": { "readonly": 1 }, "required": { "required": 1 }, "rows": 1, "cols": 1, "wrap": { "on": 1, "off": 1, "hard": 1, "soft": 1 } },
2015 "tfoot": {},
2016 "th": { "headers": 1, "rowspan": 1, "colspan": 1, "scope": 1 },
2017 "thead": {},
2018 "time": { "datetime": 1 },
2019 "title": {},
2020 "tr": {},
2021 "track": { "kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1 },
2022 "section": {},
2023 "summary": {},
2024 "u": {},
2025 "ul": {},
2026 "var": {},
2027 "video": { "src": 1, "autobuffer": 1, "autoplay": { "autoplay": 1 }, "loop": { "loop": 1 }, "controls": { "controls": 1 }, "width": 1, "height": 1, "poster": 1, "muted": { "muted": 1 }, "preload": { "auto": 1, "metadata": 1, "none": 1 } },
2028 "wbr": {}
2029 };
2030 var elements = Object.keys(attributeMap);
2031 function is(token, type) {
2032 return token.type.lastIndexOf(type + ".xml") > -1;
2033 }
2034 function findTagName(session, pos) {
2035 var iterator = new TokenIterator(session, pos.row, pos.column);
2036 var token = iterator.getCurrentToken();
2037 while (token && !is(token, "tag-name")) {
2038 token = iterator.stepBackward();
2039 }
2040 if (token)
2041 return token.value;
2042 }
2043 function findAttributeName(session, pos) {
2044 var iterator = new TokenIterator(session, pos.row, pos.column);
2045 var token = iterator.getCurrentToken();
2046 while (token && !is(token, "attribute-name")) {
2047 token = iterator.stepBackward();
2048 }
2049 if (token)
2050 return token.value;
2051 }
2052 var HtmlCompletions = function () {
2053 };
2054 (function () {
2055 this.getCompletions = function (state, session, pos, prefix) {
2056 var token = session.getTokenAt(pos.row, pos.column);
2057 if (!token)
2058 return [];
2059 if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open"))
2060 return this.getTagCompletions(state, session, pos, prefix);
2061 if (is(token, "tag-whitespace") || is(token, "attribute-name"))
2062 return this.getAttributeCompletions(state, session, pos, prefix);
2063 if (is(token, "attribute-value"))
2064 return this.getAttributeValueCompletions(state, session, pos, prefix);
2065 var line = session.getLine(pos.row).substr(0, pos.column);
2066 if (/&[a-z]*$/i.test(line))
2067 return this.getHTMLEntityCompletions(state, session, pos, prefix);
2068 return [];
2069 };
2070 this.getTagCompletions = function (state, session, pos, prefix) {
2071 return elements.map(function (element) {
2072 return {
2073 value: element,
2074 meta: "tag",
2075 score: 1000000
2076 };
2077 });
2078 };
2079 this.getAttributeCompletions = function (state, session, pos, prefix) {
2080 var tagName = findTagName(session, pos);
2081 if (!tagName)
2082 return [];
2083 var attributes = globalAttributes;
2084 if (tagName in attributeMap) {
2085 attributes = attributes.concat(Object.keys(attributeMap[tagName]));
2086 }
2087 return attributes.map(function (attribute) {
2088 return {
2089 caption: attribute,
2090 snippet: attribute + '="$0"',
2091 meta: "attribute",
2092 score: 1000000
2093 };
2094 });
2095 };
2096 this.getAttributeValueCompletions = function (state, session, pos, prefix) {
2097 var tagName = findTagName(session, pos);
2098 var attributeName = findAttributeName(session, pos);
2099 if (!tagName)
2100 return [];
2101 var values = [];
2102 if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") {
2103 values = Object.keys(attributeMap[tagName][attributeName]);
2104 }
2105 return values.map(function (value) {
2106 return {
2107 caption: value,
2108 snippet: value,
2109 meta: "attribute value",
2110 score: 1000000
2111 };
2112 });
2113 };
2114 this.getHTMLEntityCompletions = function (state, session, pos, prefix) {
2115 var values = ['Aacute;', 'aacute;', 'Acirc;', 'acirc;', 'acute;', 'AElig;', 'aelig;', 'Agrave;', 'agrave;', 'alefsym;', 'Alpha;', 'alpha;', 'amp;', 'and;', 'ang;', 'Aring;', 'aring;', 'asymp;', 'Atilde;', 'atilde;', 'Auml;', 'auml;', 'bdquo;', 'Beta;', 'beta;', 'brvbar;', 'bull;', 'cap;', 'Ccedil;', 'ccedil;', 'cedil;', 'cent;', 'Chi;', 'chi;', 'circ;', 'clubs;', 'cong;', 'copy;', 'crarr;', 'cup;', 'curren;', 'Dagger;', 'dagger;', 'dArr;', 'darr;', 'deg;', 'Delta;', 'delta;', 'diams;', 'divide;', 'Eacute;', 'eacute;', 'Ecirc;', 'ecirc;', 'Egrave;', 'egrave;', 'empty;', 'emsp;', 'ensp;', 'Epsilon;', 'epsilon;', 'equiv;', 'Eta;', 'eta;', 'ETH;', 'eth;', 'Euml;', 'euml;', 'euro;', 'exist;', 'fnof;', 'forall;', 'frac12;', 'frac14;', 'frac34;', 'frasl;', 'Gamma;', 'gamma;', 'ge;', 'gt;', 'hArr;', 'harr;', 'hearts;', 'hellip;', 'Iacute;', 'iacute;', 'Icirc;', 'icirc;', 'iexcl;', 'Igrave;', 'igrave;', 'image;', 'infin;', 'int;', 'Iota;', 'iota;', 'iquest;', 'isin;', 'Iuml;', 'iuml;', 'Kappa;', 'kappa;', 'Lambda;', 'lambda;', 'lang;', 'laquo;', 'lArr;', 'larr;', 'lceil;', 'ldquo;', 'le;', 'lfloor;', 'lowast;', 'loz;', 'lrm;', 'lsaquo;', 'lsquo;', 'lt;', 'macr;', 'mdash;', 'micro;', 'middot;', 'minus;', 'Mu;', 'mu;', 'nabla;', 'nbsp;', 'ndash;', 'ne;', 'ni;', 'not;', 'notin;', 'nsub;', 'Ntilde;', 'ntilde;', 'Nu;', 'nu;', 'Oacute;', 'oacute;', 'Ocirc;', 'ocirc;', 'OElig;', 'oelig;', 'Ograve;', 'ograve;', 'oline;', 'Omega;', 'omega;', 'Omicron;', 'omicron;', 'oplus;', 'or;', 'ordf;', 'ordm;', 'Oslash;', 'oslash;', 'Otilde;', 'otilde;', 'otimes;', 'Ouml;', 'ouml;', 'para;', 'part;', 'permil;', 'perp;', 'Phi;', 'phi;', 'Pi;', 'pi;', 'piv;', 'plusmn;', 'pound;', 'Prime;', 'prime;', 'prod;', 'prop;', 'Psi;', 'psi;', 'quot;', 'radic;', 'rang;', 'raquo;', 'rArr;', 'rarr;', 'rceil;', 'rdquo;', 'real;', 'reg;', 'rfloor;', 'Rho;', 'rho;', 'rlm;', 'rsaquo;', 'rsquo;', 'sbquo;', 'Scaron;', 'scaron;', 'sdot;', 'sect;', 'shy;', 'Sigma;', 'sigma;', 'sigmaf;', 'sim;', 'spades;', 'sub;', 'sube;', 'sum;', 'sup;', 'sup1;', 'sup2;', 'sup3;', 'supe;', 'szlig;', 'Tau;', 'tau;', 'there4;', 'Theta;', 'theta;', 'thetasym;', 'thinsp;', 'THORN;', 'thorn;', 'tilde;', 'times;', 'trade;', 'Uacute;', 'uacute;', 'uArr;', 'uarr;', 'Ucirc;', 'ucirc;', 'Ugrave;', 'ugrave;', 'uml;', 'upsih;', 'Upsilon;', 'upsilon;', 'Uuml;', 'uuml;', 'weierp;', 'Xi;', 'xi;', 'Yacute;', 'yacute;', 'yen;', 'Yuml;', 'yuml;', 'Zeta;', 'zeta;', 'zwj;', 'zwnj;'];
2116 return values.map(function (value) {
2117 return {
2118 caption: value,
2119 snippet: value,
2120 meta: "html entity",
2121 score: 1000000
2122 };
2123 });
2124 };
2125 }).call(HtmlCompletions.prototype);
2126 exports.HtmlCompletions = HtmlCompletions;
2127
2128 });
2129
2130 define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"], function(require, exports, module){"use strict";
2131 var oop = require("../lib/oop");
2132 var lang = require("../lib/lang");
2133 var TextMode = require("./text").Mode;
2134 var JavaScriptMode = require("./javascript").Mode;
2135 var CssMode = require("./css").Mode;
2136 var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
2137 var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
2138 var HtmlFoldMode = require("./folding/html").FoldMode;
2139 var HtmlCompletions = require("./html_completions").HtmlCompletions;
2140 var WorkerClient = require("../worker/worker_client").WorkerClient;
2141 var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"];
2142 var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"];
2143 var Mode = function (options) {
2144 this.fragmentContext = options && options.fragmentContext;
2145 this.HighlightRules = HtmlHighlightRules;
2146 this.$behaviour = new XmlBehaviour();
2147 this.$completer = new HtmlCompletions();
2148 this.createModeDelegates({
2149 "js-": JavaScriptMode,
2150 "css-": CssMode
2151 });
2152 this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags));
2153 };
2154 oop.inherits(Mode, TextMode);
2155 (function () {
2156 this.blockComment = { start: "<!--", end: "-->" };
2157 this.voidElements = lang.arrayToMap(voidElements);
2158 this.getNextLineIndent = function (state, line, tab) {
2159 return this.$getIndent(line);
2160 };
2161 this.checkOutdent = function (state, line, input) {
2162 return false;
2163 };
2164 this.getCompletions = function (state, session, pos, prefix) {
2165 return this.$completer.getCompletions(state, session, pos, prefix);
2166 };
2167 this.createWorker = function (session) {
2168 if (this.constructor != Mode)
2169 return;
2170 var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker");
2171 worker.attachToDocument(session.getDocument());
2172 if (this.fragmentContext)
2173 worker.call("setOptions", [{ context: this.fragmentContext }]);
2174 worker.on("error", function (e) {
2175 session.setAnnotations(e.data);
2176 });
2177 worker.on("terminate", function () {
2178 session.clearAnnotations();
2179 });
2180 return worker;
2181 };
2182 this.$id = "ace/mode/html";
2183 this.snippetFileId = "ace/snippets/html";
2184 }).call(Mode.prototype);
2185 exports.Mode = Mode;
2186
2187 }); (function() {
2188 window.require(["ace/mode/html"], function(m) {
2189 if (typeof module == "object" && typeof exports == "object" && module) {
2190 module.exports = m;
2191 }
2192 });
2193 })();
2194