formagic 0.3.9 → 0.3.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app/assets/javascripts/formagic.coffee +5 -2
- data/app/assets/javascripts/formagic/form.coffee +4 -1
- data/app/assets/javascripts/formagic/inputs/ace-css.coffee +25 -0
- data/app/assets/javascripts/formagic/inputs/ace-html.coffee +25 -0
- data/app/assets/javascripts/formagic/inputs/ace-js.coffee +25 -0
- data/app/assets/javascripts/formagic/inputs/ace-markdown.coffee +51 -0
- data/app/assets/javascripts/formagic/inputs/{markdown_toolbar.coffee → ace-markdown_toolbar.coffee} +27 -7
- data/app/assets/javascripts/formagic/inputs/{html.coffee → ace.coffee} +27 -29
- data/app/assets/javascripts/formagic/inputs/documents_reorder.coffee +3 -0
- data/app/assets/javascripts/formagic/inputs/list_reorder.coffee +2 -0
- data/app/assets/javascripts/formagic/inputs/url.coffee +1 -1
- data/app/assets/javascripts/vendor/ace.js +264 -123
- data/app/assets/javascripts/vendor/mode-css.js +1008 -0
- data/app/assets/javascripts/vendor/mode-html.js +488 -129
- data/app/assets/javascripts/vendor/mode-javascript.js +1154 -0
- data/app/assets/javascripts/vendor/mode-markdown.js +489 -129
- data/app/assets/javascripts/vendor/slip.js +792 -0
- data/app/assets/stylesheets/formagic.scss +9 -1
- data/app/assets/stylesheets/formagic/{nested-form.scss → documents.scss} +0 -0
- data/app/assets/stylesheets/formagic/markdown.scss +4 -1
- data/app/assets/stylesheets/formagic/switch.scss +1 -1
- data/lib/formagic/version.rb +1 -1
- metadata +12 -6
- data/app/assets/javascripts/formagic/inputs/markdown.coffee +0 -94
@@ -54,6 +54,7 @@ define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/
|
|
54
54
|
var oop = require("../lib/oop");
|
55
55
|
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
|
56
56
|
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
57
|
+
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
|
57
58
|
|
58
59
|
var JavaScriptHighlightRules = function(options) {
|
59
60
|
var keywordMapper = this.createKeywordMapper({
|
@@ -83,7 +84,6 @@ var JavaScriptHighlightRules = function(options) {
|
|
83
84
|
"constant.language.boolean": "true|false"
|
84
85
|
}, "identifier");
|
85
86
|
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
|
86
|
-
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
|
87
87
|
|
88
88
|
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
|
89
89
|
"u[0-9a-fA-F]{4}|" + // unicode
|
@@ -171,15 +171,6 @@ var JavaScriptHighlightRules = function(options) {
|
|
171
171
|
token : "keyword",
|
172
172
|
regex : "(?:" + kwBeforeRe + ")\\b",
|
173
173
|
next : "start"
|
174
|
-
}, {
|
175
|
-
token : ["punctuation.operator", "support.function"],
|
176
|
-
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|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|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(?=\()/
|
177
|
-
}, {
|
178
|
-
token : ["punctuation.operator", "support.function.dom"],
|
179
|
-
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(?=\()/
|
180
|
-
}, {
|
181
|
-
token : ["punctuation.operator", "support.constant"],
|
182
|
-
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/
|
183
174
|
}, {
|
184
175
|
token : ["support.constant"],
|
185
176
|
regex : /that\b/
|
@@ -189,9 +180,13 @@ var JavaScriptHighlightRules = function(options) {
|
|
189
180
|
}, {
|
190
181
|
token : keywordMapper,
|
191
182
|
regex : identifierRe
|
183
|
+
}, {
|
184
|
+
token : "punctuation.operator",
|
185
|
+
regex : /[.](?![.])/,
|
186
|
+
next : "property"
|
192
187
|
}, {
|
193
188
|
token : "keyword.operator",
|
194
|
-
regex :
|
189
|
+
regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,
|
195
190
|
next : "start"
|
196
191
|
}, {
|
197
192
|
token : "punctuation.operator",
|
@@ -209,6 +204,38 @@ var JavaScriptHighlightRules = function(options) {
|
|
209
204
|
regex: /^#!.*$/
|
210
205
|
}
|
211
206
|
],
|
207
|
+
property: [{
|
208
|
+
token : "text",
|
209
|
+
regex : "\\s+"
|
210
|
+
}, {
|
211
|
+
token : [
|
212
|
+
"storage.type", "punctuation.operator", "entity.name.function", "text",
|
213
|
+
"keyword.operator", "text",
|
214
|
+
"storage.type", "text", "entity.name.function", "text", "paren.lparen"
|
215
|
+
],
|
216
|
+
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",
|
217
|
+
next: "function_arguments"
|
218
|
+
}, {
|
219
|
+
token : "punctuation.operator",
|
220
|
+
regex : /[.](?![.])/
|
221
|
+
}, {
|
222
|
+
token : "support.function",
|
223
|
+
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|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|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(?=\()/
|
224
|
+
}, {
|
225
|
+
token : "support.function.dom",
|
226
|
+
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(?=\()/
|
227
|
+
}, {
|
228
|
+
token : "support.constant",
|
229
|
+
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/
|
230
|
+
}, {
|
231
|
+
token : "identifier",
|
232
|
+
regex : identifierRe
|
233
|
+
}, {
|
234
|
+
regex: "",
|
235
|
+
token: "empty",
|
236
|
+
next: "no_regex"
|
237
|
+
}
|
238
|
+
],
|
212
239
|
"start": [
|
213
240
|
DocCommentHighlightRules.getStartRule("doc-start"),
|
214
241
|
{
|
@@ -363,7 +390,7 @@ var JavaScriptHighlightRules = function(options) {
|
|
363
390
|
if (val == "}" && stack.length) {
|
364
391
|
stack.shift();
|
365
392
|
this.next = stack.shift();
|
366
|
-
if (this.next.indexOf("string") != -1)
|
393
|
+
if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1)
|
367
394
|
return "paren.quasi.end";
|
368
395
|
}
|
369
396
|
return val == "{" ? "paren.lparen" : "paren.rparen";
|
@@ -387,6 +414,9 @@ var JavaScriptHighlightRules = function(options) {
|
|
387
414
|
defaultToken: "string.quasi"
|
388
415
|
}]
|
389
416
|
});
|
417
|
+
|
418
|
+
if (!options || !options.noJSX)
|
419
|
+
JSX.call(this);
|
390
420
|
}
|
391
421
|
|
392
422
|
this.embedRules(DocCommentHighlightRules, "doc-",
|
@@ -397,6 +427,105 @@ var JavaScriptHighlightRules = function(options) {
|
|
397
427
|
|
398
428
|
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
|
399
429
|
|
430
|
+
function JSX() {
|
431
|
+
var tagRegex = identifierRe.replace("\\d", "\\d\\-");
|
432
|
+
var jsxTag = {
|
433
|
+
onMatch : function(val, state, stack) {
|
434
|
+
var offset = val.charAt(1) == "/" ? 2 : 1;
|
435
|
+
if (offset == 1) {
|
436
|
+
if (state != this.nextState)
|
437
|
+
stack.unshift(this.next, this.nextState, 0);
|
438
|
+
else
|
439
|
+
stack.unshift(this.next);
|
440
|
+
stack[2]++;
|
441
|
+
} else if (offset == 2) {
|
442
|
+
if (state == this.nextState) {
|
443
|
+
stack[1]--;
|
444
|
+
if (!stack[1] || stack[1] < 0) {
|
445
|
+
stack.shift();
|
446
|
+
stack.shift();
|
447
|
+
}
|
448
|
+
}
|
449
|
+
}
|
450
|
+
return [{
|
451
|
+
type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml",
|
452
|
+
value: val.slice(0, offset)
|
453
|
+
}, {
|
454
|
+
type: "meta.tag.tag-name.xml",
|
455
|
+
value: val.substr(offset)
|
456
|
+
}];
|
457
|
+
},
|
458
|
+
regex : "</?" + tagRegex + "",
|
459
|
+
next: "jsxAttributes",
|
460
|
+
nextState: "jsx"
|
461
|
+
};
|
462
|
+
this.$rules.start.unshift(jsxTag);
|
463
|
+
var jsxJsRule = {
|
464
|
+
regex: "{",
|
465
|
+
token: "paren.quasi.start",
|
466
|
+
push: "start"
|
467
|
+
};
|
468
|
+
this.$rules.jsx = [
|
469
|
+
jsxJsRule,
|
470
|
+
jsxTag,
|
471
|
+
{include : "reference"},
|
472
|
+
{defaultToken: "string"}
|
473
|
+
];
|
474
|
+
this.$rules.jsxAttributes = [{
|
475
|
+
token : "meta.tag.punctuation.tag-close.xml",
|
476
|
+
regex : "/?>",
|
477
|
+
onMatch : function(value, currentState, stack) {
|
478
|
+
if (currentState == stack[0])
|
479
|
+
stack.shift();
|
480
|
+
if (value.length == 2) {
|
481
|
+
if (stack[0] == this.nextState)
|
482
|
+
stack[1]--;
|
483
|
+
if (!stack[1] || stack[1] < 0) {
|
484
|
+
stack.splice(0, 2);
|
485
|
+
}
|
486
|
+
}
|
487
|
+
this.next = stack[0] || "start";
|
488
|
+
return [{type: this.token, value: value}];
|
489
|
+
},
|
490
|
+
nextState: "jsx"
|
491
|
+
},
|
492
|
+
jsxJsRule,
|
493
|
+
{
|
494
|
+
token : "entity.other.attribute-name.xml",
|
495
|
+
regex : tagRegex
|
496
|
+
}, {
|
497
|
+
token : "keyword.operator.attribute-equals.xml",
|
498
|
+
regex : "="
|
499
|
+
}, {
|
500
|
+
token : "text.tag-whitespace.xml",
|
501
|
+
regex : "\\s+"
|
502
|
+
}, {
|
503
|
+
token : "string.attribute-value.xml",
|
504
|
+
regex : "'",
|
505
|
+
stateName : "jsx_attr_q",
|
506
|
+
push : [
|
507
|
+
{token : "string.attribute-value.xml", regex: "'", next: "pop"},
|
508
|
+
jsxJsRule,
|
509
|
+
{include : "reference"},
|
510
|
+
{defaultToken : "string.attribute-value.xml"}
|
511
|
+
]
|
512
|
+
}, {
|
513
|
+
token : "string.attribute-value.xml",
|
514
|
+
regex : '"',
|
515
|
+
stateName : "jsx_attr_qq",
|
516
|
+
push : [
|
517
|
+
jsxJsRule,
|
518
|
+
{token : "string.attribute-value.xml", regex: '"', next: "pop"},
|
519
|
+
{include : "reference"},
|
520
|
+
{defaultToken : "string.attribute-value.xml"}
|
521
|
+
]
|
522
|
+
}];
|
523
|
+
this.$rules.reference = [{
|
524
|
+
token : "constant.language.escape.reference.xml",
|
525
|
+
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
|
526
|
+
}];
|
527
|
+
}
|
528
|
+
|
400
529
|
exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
|
401
530
|
});
|
402
531
|
|
@@ -1830,6 +1959,180 @@ exports.CssHighlightRules = CssHighlightRules;
|
|
1830
1959
|
|
1831
1960
|
});
|
1832
1961
|
|
1962
|
+
define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module) {
|
1963
|
+
"use strict";
|
1964
|
+
|
1965
|
+
var propertyMap = {
|
1966
|
+
"background": {"#$0": 1},
|
1967
|
+
"background-color": {"#$0": 1, "transparent": 1, "fixed": 1},
|
1968
|
+
"background-image": {"url('/$0')": 1},
|
1969
|
+
"background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1},
|
1970
|
+
"background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2,},
|
1971
|
+
"background-attachment": {"scroll": 1, "fixed": 1},
|
1972
|
+
"background-size": {"cover": 1, "contain": 1},
|
1973
|
+
"background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1},
|
1974
|
+
"background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1},
|
1975
|
+
"border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1},
|
1976
|
+
"border-color": {"#$0": 1},
|
1977
|
+
"border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2,},
|
1978
|
+
"border-collapse": {"collapse": 1, "separate": 1},
|
1979
|
+
"bottom": {"px": 1, "em": 1, "%": 1},
|
1980
|
+
"clear": {"left": 1, "right": 1, "both": 1, "none": 1},
|
1981
|
+
"color": {"#$0": 1, "rgb(#$00,0,0)": 1},
|
1982
|
+
"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},
|
1983
|
+
"display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1},
|
1984
|
+
"empty-cells": {"show": 1, "hide": 1},
|
1985
|
+
"float": {"left": 1, "right": 1, "none": 1},
|
1986
|
+
"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},
|
1987
|
+
"font-size": {"px": 1, "em": 1, "%": 1},
|
1988
|
+
"font-weight": {"bold": 1, "normal": 1},
|
1989
|
+
"font-style": {"italic": 1, "normal": 1},
|
1990
|
+
"font-variant": {"normal": 1, "small-caps": 1},
|
1991
|
+
"height": {"px": 1, "em": 1, "%": 1},
|
1992
|
+
"left": {"px": 1, "em": 1, "%": 1},
|
1993
|
+
"letter-spacing": {"normal": 1},
|
1994
|
+
"line-height": {"normal": 1},
|
1995
|
+
"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},
|
1996
|
+
"margin": {"px": 1, "em": 1, "%": 1},
|
1997
|
+
"margin-right": {"px": 1, "em": 1, "%": 1},
|
1998
|
+
"margin-left": {"px": 1, "em": 1, "%": 1},
|
1999
|
+
"margin-top": {"px": 1, "em": 1, "%": 1},
|
2000
|
+
"margin-bottom": {"px": 1, "em": 1, "%": 1},
|
2001
|
+
"max-height": {"px": 1, "em": 1, "%": 1},
|
2002
|
+
"max-width": {"px": 1, "em": 1, "%": 1},
|
2003
|
+
"min-height": {"px": 1, "em": 1, "%": 1},
|
2004
|
+
"min-width": {"px": 1, "em": 1, "%": 1},
|
2005
|
+
"overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
|
2006
|
+
"overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
|
2007
|
+
"overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
|
2008
|
+
"padding": {"px": 1, "em": 1, "%": 1},
|
2009
|
+
"padding-top": {"px": 1, "em": 1, "%": 1},
|
2010
|
+
"padding-right": {"px": 1, "em": 1, "%": 1},
|
2011
|
+
"padding-bottom": {"px": 1, "em": 1, "%": 1},
|
2012
|
+
"padding-left": {"px": 1, "em": 1, "%": 1},
|
2013
|
+
"page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1},
|
2014
|
+
"page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1},
|
2015
|
+
"position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1},
|
2016
|
+
"right": {"px": 1, "em": 1, "%": 1},
|
2017
|
+
"table-layout": {"fixed": 1, "auto": 1},
|
2018
|
+
"text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1},
|
2019
|
+
"text-align": {"left": 1, "right": 1, "center": 1, "justify": 1},
|
2020
|
+
"text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1},
|
2021
|
+
"top": {"px": 1, "em": 1, "%": 1},
|
2022
|
+
"vertical-align": {"top": 1, "bottom": 1},
|
2023
|
+
"visibility": {"hidden": 1, "visible": 1},
|
2024
|
+
"white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1},
|
2025
|
+
"width": {"px": 1, "em": 1, "%": 1},
|
2026
|
+
"word-spacing": {"normal": 1},
|
2027
|
+
"filter": {"alpha(opacity=$0100)": 1},
|
2028
|
+
|
2029
|
+
"text-shadow": {"$02px 2px 2px #777": 1},
|
2030
|
+
"text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1},
|
2031
|
+
"-moz-border-radius": 1,
|
2032
|
+
"-moz-border-radius-topright": 1,
|
2033
|
+
"-moz-border-radius-bottomright": 1,
|
2034
|
+
"-moz-border-radius-topleft": 1,
|
2035
|
+
"-moz-border-radius-bottomleft": 1,
|
2036
|
+
"-webkit-border-radius": 1,
|
2037
|
+
"-webkit-border-top-right-radius": 1,
|
2038
|
+
"-webkit-border-top-left-radius": 1,
|
2039
|
+
"-webkit-border-bottom-right-radius": 1,
|
2040
|
+
"-webkit-border-bottom-left-radius": 1,
|
2041
|
+
"-moz-box-shadow": 1,
|
2042
|
+
"-webkit-box-shadow": 1,
|
2043
|
+
"transform": {"rotate($00deg)": 1, "skew($00deg)": 1},
|
2044
|
+
"-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1},
|
2045
|
+
"-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 }
|
2046
|
+
};
|
2047
|
+
|
2048
|
+
var CssCompletions = function() {
|
2049
|
+
|
2050
|
+
};
|
2051
|
+
|
2052
|
+
(function() {
|
2053
|
+
|
2054
|
+
this.completionsDefined = false;
|
2055
|
+
|
2056
|
+
this.defineCompletions = function() {
|
2057
|
+
if (document) {
|
2058
|
+
var style = document.createElement('c').style;
|
2059
|
+
|
2060
|
+
for (var i in style) {
|
2061
|
+
if (typeof style[i] !== 'string')
|
2062
|
+
continue;
|
2063
|
+
|
2064
|
+
var name = i.replace(/[A-Z]/g, function(x) {
|
2065
|
+
return '-' + x.toLowerCase();
|
2066
|
+
});
|
2067
|
+
|
2068
|
+
if (!propertyMap.hasOwnProperty(name))
|
2069
|
+
propertyMap[name] = 1;
|
2070
|
+
}
|
2071
|
+
}
|
2072
|
+
|
2073
|
+
this.completionsDefined = true;
|
2074
|
+
}
|
2075
|
+
|
2076
|
+
this.getCompletions = function(state, session, pos, prefix) {
|
2077
|
+
if (!this.completionsDefined) {
|
2078
|
+
this.defineCompletions();
|
2079
|
+
}
|
2080
|
+
|
2081
|
+
var token = session.getTokenAt(pos.row, pos.column);
|
2082
|
+
|
2083
|
+
if (!token)
|
2084
|
+
return [];
|
2085
|
+
if (state==='ruleset'){
|
2086
|
+
var line = session.getLine(pos.row).substr(0, pos.column);
|
2087
|
+
if (/:[^;]+$/.test(line)) {
|
2088
|
+
/([\w\-]+):[^:]*$/.test(line);
|
2089
|
+
|
2090
|
+
return this.getPropertyValueCompletions(state, session, pos, prefix);
|
2091
|
+
} else {
|
2092
|
+
return this.getPropertyCompletions(state, session, pos, prefix);
|
2093
|
+
}
|
2094
|
+
}
|
2095
|
+
|
2096
|
+
return [];
|
2097
|
+
};
|
2098
|
+
|
2099
|
+
this.getPropertyCompletions = function(state, session, pos, prefix) {
|
2100
|
+
var properties = Object.keys(propertyMap);
|
2101
|
+
return properties.map(function(property){
|
2102
|
+
return {
|
2103
|
+
caption: property,
|
2104
|
+
snippet: property + ': $0',
|
2105
|
+
meta: "property",
|
2106
|
+
score: Number.MAX_VALUE
|
2107
|
+
};
|
2108
|
+
});
|
2109
|
+
};
|
2110
|
+
|
2111
|
+
this.getPropertyValueCompletions = function(state, session, pos, prefix) {
|
2112
|
+
var line = session.getLine(pos.row).substr(0, pos.column);
|
2113
|
+
var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1];
|
2114
|
+
|
2115
|
+
if (!property)
|
2116
|
+
return [];
|
2117
|
+
var values = [];
|
2118
|
+
if (property in propertyMap && typeof propertyMap[property] === "object") {
|
2119
|
+
values = Object.keys(propertyMap[property]);
|
2120
|
+
}
|
2121
|
+
return values.map(function(value){
|
2122
|
+
return {
|
2123
|
+
caption: value,
|
2124
|
+
snippet: value,
|
2125
|
+
meta: "property value",
|
2126
|
+
score: Number.MAX_VALUE
|
2127
|
+
};
|
2128
|
+
});
|
2129
|
+
};
|
2130
|
+
|
2131
|
+
}).call(CssCompletions.prototype);
|
2132
|
+
|
2133
|
+
exports.CssCompletions = CssCompletions;
|
2134
|
+
});
|
2135
|
+
|
1833
2136
|
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) {
|
1834
2137
|
"use strict";
|
1835
2138
|
|
@@ -1909,7 +2212,7 @@ oop.inherits(CssBehaviour, CstyleBehaviour);
|
|
1909
2212
|
exports.CssBehaviour = CssBehaviour;
|
1910
2213
|
});
|
1911
2214
|
|
1912
|
-
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/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) {
|
2215
|
+
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) {
|
1913
2216
|
"use strict";
|
1914
2217
|
|
1915
2218
|
var oop = require("../lib/oop");
|
@@ -1917,6 +2220,7 @@ var TextMode = require("./text").Mode;
|
|
1917
2220
|
var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
|
1918
2221
|
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
1919
2222
|
var WorkerClient = require("../worker/worker_client").WorkerClient;
|
2223
|
+
var CssCompletions = require("./css_completions").CssCompletions;
|
1920
2224
|
var CssBehaviour = require("./behaviour/css").CssBehaviour;
|
1921
2225
|
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
1922
2226
|
|
@@ -1924,6 +2228,7 @@ var Mode = function() {
|
|
1924
2228
|
this.HighlightRules = CssHighlightRules;
|
1925
2229
|
this.$outdent = new MatchingBraceOutdent();
|
1926
2230
|
this.$behaviour = new CssBehaviour();
|
2231
|
+
this.$completer = new CssCompletions();
|
1927
2232
|
this.foldingRules = new CStyleFoldMode();
|
1928
2233
|
};
|
1929
2234
|
oop.inherits(Mode, TextMode);
|
@@ -1956,6 +2261,10 @@ oop.inherits(Mode, TextMode);
|
|
1956
2261
|
this.$outdent.autoOutdent(doc, row);
|
1957
2262
|
};
|
1958
2263
|
|
2264
|
+
this.getCompletions = function(state, session, pos, prefix) {
|
2265
|
+
return this.$completer.getCompletions(state, session, pos, prefix);
|
2266
|
+
};
|
2267
|
+
|
1959
2268
|
this.createWorker = function(session) {
|
1960
2269
|
var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
|
1961
2270
|
worker.attachToDocument(session.getDocument());
|
@@ -2049,7 +2358,7 @@ var HtmlHighlightRules = function() {
|
|
2049
2358
|
});
|
2050
2359
|
|
2051
2360
|
this.embedTagRules(CssHighlightRules, "css-", "style");
|
2052
|
-
this.embedTagRules(JavaScriptHighlightRules, "js-", "script");
|
2361
|
+
this.embedTagRules(new JavaScriptHighlightRules({noJSX: true}).getRules(), "js-", "script");
|
2053
2362
|
|
2054
2363
|
if (this.constructor === HtmlHighlightRules)
|
2055
2364
|
this.normalizeRules();
|
@@ -2223,118 +2532,120 @@ var eventAttributes = [
|
|
2223
2532
|
var globalAttributes = commonAttributes.concat(eventAttributes);
|
2224
2533
|
|
2225
2534
|
var attributeMap = {
|
2226
|
-
"html":
|
2227
|
-
"head":
|
2228
|
-
"title":
|
2229
|
-
"base":
|
2230
|
-
"link":
|
2231
|
-
"meta":
|
2232
|
-
"style":
|
2233
|
-
"script":
|
2234
|
-
"noscript":
|
2235
|
-
"body":
|
2236
|
-
"section":
|
2237
|
-
"nav":
|
2238
|
-
"article":
|
2239
|
-
"aside":
|
2240
|
-
"h1":
|
2241
|
-
"h2":
|
2242
|
-
"h3":
|
2243
|
-
"h4":
|
2244
|
-
"h5":
|
2245
|
-
"h6":
|
2246
|
-
"header":
|
2247
|
-
"footer":
|
2248
|
-
"address":
|
2249
|
-
"main":
|
2250
|
-
"p":
|
2251
|
-
"hr":
|
2252
|
-
"pre":
|
2253
|
-
"blockquote":
|
2254
|
-
"ol":
|
2255
|
-
"ul":
|
2256
|
-
"li":
|
2257
|
-
"dl":
|
2258
|
-
"dt":
|
2259
|
-
"dd":
|
2260
|
-
"figure":
|
2261
|
-
"figcaption":
|
2262
|
-
"div":
|
2263
|
-
"a":
|
2264
|
-
"em":
|
2265
|
-
"strong":
|
2266
|
-
"small":
|
2267
|
-
"s":
|
2268
|
-
"cite":
|
2269
|
-
"q":
|
2270
|
-
"dfn":
|
2271
|
-
"abbr":
|
2272
|
-
"data":
|
2273
|
-
"time":
|
2274
|
-
"code":
|
2275
|
-
"var":
|
2276
|
-
"samp":
|
2277
|
-
"kbd":
|
2278
|
-
"sub":
|
2279
|
-
"sup":
|
2280
|
-
"i":
|
2281
|
-
"b":
|
2282
|
-
"u":
|
2283
|
-
"mark":
|
2284
|
-
"ruby":
|
2285
|
-
"rt":
|
2286
|
-
"rp":
|
2287
|
-
"bdi":
|
2288
|
-
"bdo":
|
2289
|
-
"span":
|
2290
|
-
"br":
|
2291
|
-
"wbr":
|
2292
|
-
"ins":
|
2293
|
-
"del":
|
2294
|
-
"img":
|
2295
|
-
"iframe":
|
2296
|
-
"embed":
|
2297
|
-
"object":
|
2298
|
-
"param":
|
2299
|
-
"video":
|
2300
|
-
"audio":
|
2301
|
-
"source":
|
2302
|
-
"track":
|
2303
|
-
"canvas":
|
2304
|
-
"map":
|
2305
|
-
"area":
|
2306
|
-
"svg":
|
2307
|
-
"math":
|
2308
|
-
"table":
|
2309
|
-
"caption":
|
2310
|
-
"colgroup":
|
2311
|
-
"col":
|
2312
|
-
"tbody":
|
2313
|
-
"thead":
|
2314
|
-
"tfoot":
|
2315
|
-
"tr":
|
2316
|
-
"td":
|
2317
|
-
"th":
|
2318
|
-
"form":
|
2319
|
-
"fieldset":
|
2320
|
-
"legend":
|
2321
|
-
"label":
|
2322
|
-
"input":
|
2323
|
-
|
2324
|
-
|
2325
|
-
"
|
2326
|
-
"
|
2327
|
-
"
|
2328
|
-
"
|
2329
|
-
"
|
2330
|
-
"
|
2331
|
-
"
|
2332
|
-
"
|
2333
|
-
"
|
2334
|
-
"
|
2335
|
-
"
|
2336
|
-
"
|
2337
|
-
"
|
2535
|
+
"html": {"manifest": 1},
|
2536
|
+
"head": {},
|
2537
|
+
"title": {},
|
2538
|
+
"base": {"href": 1, "target": 1},
|
2539
|
+
"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},
|
2540
|
+
"meta": {"http-equiv": {"content-type": 1}, "name": {"description": 1, "keywords": 1}, "content": {"text/html; charset=UTF-8": 1}, "charset": 1},
|
2541
|
+
"style": {"type": 1, "media": {"all": 1, "screen": 1, "print": 1}, "scoped": 1},
|
2542
|
+
"script": {"charset": 1, "type": {"text/javascript": 1}, "src": 1, "defer": 1, "async": 1},
|
2543
|
+
"noscript": {"href": 1},
|
2544
|
+
"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},
|
2545
|
+
"section": {},
|
2546
|
+
"nav": {},
|
2547
|
+
"article": {"pubdate": 1},
|
2548
|
+
"aside": {},
|
2549
|
+
"h1": {},
|
2550
|
+
"h2": {},
|
2551
|
+
"h3": {},
|
2552
|
+
"h4": {},
|
2553
|
+
"h5": {},
|
2554
|
+
"h6": {},
|
2555
|
+
"header": {},
|
2556
|
+
"footer": {},
|
2557
|
+
"address": {},
|
2558
|
+
"main": {},
|
2559
|
+
"p": {},
|
2560
|
+
"hr": {},
|
2561
|
+
"pre": {},
|
2562
|
+
"blockquote": {"cite": 1},
|
2563
|
+
"ol": {"start": 1, "reversed": 1},
|
2564
|
+
"ul": {},
|
2565
|
+
"li": {"value": 1},
|
2566
|
+
"dl": {},
|
2567
|
+
"dt": {},
|
2568
|
+
"dd": {},
|
2569
|
+
"figure": {},
|
2570
|
+
"figcaption": {},
|
2571
|
+
"div": {},
|
2572
|
+
"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},
|
2573
|
+
"em": {},
|
2574
|
+
"strong": {},
|
2575
|
+
"small": {},
|
2576
|
+
"s": {},
|
2577
|
+
"cite": {},
|
2578
|
+
"q": {"cite": 1},
|
2579
|
+
"dfn": {},
|
2580
|
+
"abbr": {},
|
2581
|
+
"data": {},
|
2582
|
+
"time": {"datetime": 1},
|
2583
|
+
"code": {},
|
2584
|
+
"var": {},
|
2585
|
+
"samp": {},
|
2586
|
+
"kbd": {},
|
2587
|
+
"sub": {},
|
2588
|
+
"sup": {},
|
2589
|
+
"i": {},
|
2590
|
+
"b": {},
|
2591
|
+
"u": {},
|
2592
|
+
"mark": {},
|
2593
|
+
"ruby": {},
|
2594
|
+
"rt": {},
|
2595
|
+
"rp": {},
|
2596
|
+
"bdi": {},
|
2597
|
+
"bdo": {},
|
2598
|
+
"span": {},
|
2599
|
+
"br": {},
|
2600
|
+
"wbr": {},
|
2601
|
+
"ins": {"cite": 1, "datetime": 1},
|
2602
|
+
"del": {"cite": 1, "datetime": 1},
|
2603
|
+
"img": {"alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1},
|
2604
|
+
"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}},
|
2605
|
+
"embed": {"src": 1, "height": 1, "width": 1, "type": 1},
|
2606
|
+
"object": {"param": 1, "data": 1, "type": 1, "height" : 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1},
|
2607
|
+
"param": {"name": 1, "value": 1},
|
2608
|
+
"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}},
|
2609
|
+
"audio": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1 }},
|
2610
|
+
"source": {"src": 1, "type": 1, "media": 1},
|
2611
|
+
"track": {"kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1},
|
2612
|
+
"canvas": {"width": 1, "height": 1},
|
2613
|
+
"map": {"name": 1},
|
2614
|
+
"area": {"shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1},
|
2615
|
+
"svg": {},
|
2616
|
+
"math": {},
|
2617
|
+
"table": {"summary": 1},
|
2618
|
+
"caption": {},
|
2619
|
+
"colgroup": {"span": 1},
|
2620
|
+
"col": {"span": 1},
|
2621
|
+
"tbody": {},
|
2622
|
+
"thead": {},
|
2623
|
+
"tfoot": {},
|
2624
|
+
"tr": {},
|
2625
|
+
"td": {"headers": 1, "rowspan": 1, "colspan": 1},
|
2626
|
+
"th": {"headers": 1, "rowspan": 1, "colspan": 1, "scope": 1},
|
2627
|
+
"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}},
|
2628
|
+
"fieldset": {"disabled": 1, "form": 1, "name": 1},
|
2629
|
+
"legend": {},
|
2630
|
+
"label": {"form": 1, "for": 1},
|
2631
|
+
"input": {
|
2632
|
+
"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},
|
2633
|
+
"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}, "pattern": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "size": 1, "src": 1, "step": 1, "width": 1, "files": 1, "value": 1},
|
2634
|
+
"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}},
|
2635
|
+
"select": {"autofocus": 1, "disabled": 1, "form": 1, "multiple": {"multiple": 1}, "name": 1, "size": 1, "readonly":{"readonly": 1}},
|
2636
|
+
"datalist": {},
|
2637
|
+
"optgroup": {"disabled": 1, "label": 1},
|
2638
|
+
"option": {"disabled": 1, "selected": 1, "label": 1, "value": 1},
|
2639
|
+
"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}},
|
2640
|
+
"keygen": {"autofocus": 1, "challenge": {"challenge": 1}, "disabled": {"disabled": 1}, "form": 1, "keytype": {"rsa": 1, "dsa": 1, "ec": 1}, "name": 1},
|
2641
|
+
"output": {"for": 1, "form": 1, "name": 1},
|
2642
|
+
"progress": {"value": 1, "max": 1},
|
2643
|
+
"meter": {"value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1},
|
2644
|
+
"details": {"open": 1},
|
2645
|
+
"summary": {},
|
2646
|
+
"command": {"type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1},
|
2647
|
+
"menu": {"type": 1, "label": 1},
|
2648
|
+
"dialog": {"open": 1}
|
2338
2649
|
};
|
2339
2650
|
|
2340
2651
|
var elements = Object.keys(attributeMap);
|
@@ -2353,6 +2664,16 @@ function findTagName(session, pos) {
|
|
2353
2664
|
return token.value;
|
2354
2665
|
}
|
2355
2666
|
|
2667
|
+
function findAttributeName(session, pos) {
|
2668
|
+
var iterator = new TokenIterator(session, pos.row, pos.column);
|
2669
|
+
var token = iterator.getCurrentToken();
|
2670
|
+
while (token && !is(token, "attribute-name")){
|
2671
|
+
token = iterator.stepBackward();
|
2672
|
+
}
|
2673
|
+
if (token)
|
2674
|
+
return token.value;
|
2675
|
+
}
|
2676
|
+
|
2356
2677
|
var HtmlCompletions = function() {
|
2357
2678
|
|
2358
2679
|
};
|
@@ -2367,7 +2688,12 @@ var HtmlCompletions = function() {
|
|
2367
2688
|
if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open"))
|
2368
2689
|
return this.getTagCompletions(state, session, pos, prefix);
|
2369
2690
|
if (is(token, "tag-whitespace") || is(token, "attribute-name"))
|
2370
|
-
return this.
|
2691
|
+
return this.getAttributeCompletions(state, session, pos, prefix);
|
2692
|
+
if (is(token, "attribute-value"))
|
2693
|
+
return this.getAttributeValueCompletions(state, session, pos, prefix);
|
2694
|
+
var line = session.getLine(pos.row).substr(0, pos.column);
|
2695
|
+
if (/&[A-z]*$/i.test(line))
|
2696
|
+
return this.getHTMLEntityCompletions(state, session, pos, prefix);
|
2371
2697
|
|
2372
2698
|
return [];
|
2373
2699
|
};
|
@@ -2382,13 +2708,13 @@ var HtmlCompletions = function() {
|
|
2382
2708
|
});
|
2383
2709
|
};
|
2384
2710
|
|
2385
|
-
this.
|
2711
|
+
this.getAttributeCompletions = function(state, session, pos, prefix) {
|
2386
2712
|
var tagName = findTagName(session, pos);
|
2387
2713
|
if (!tagName)
|
2388
2714
|
return [];
|
2389
2715
|
var attributes = globalAttributes;
|
2390
2716
|
if (tagName in attributeMap) {
|
2391
|
-
attributes = attributes.concat(attributeMap[tagName]);
|
2717
|
+
attributes = attributes.concat(Object.keys(attributeMap[tagName]));
|
2392
2718
|
}
|
2393
2719
|
return attributes.map(function(attribute){
|
2394
2720
|
return {
|
@@ -2400,6 +2726,39 @@ var HtmlCompletions = function() {
|
|
2400
2726
|
});
|
2401
2727
|
};
|
2402
2728
|
|
2729
|
+
this.getAttributeValueCompletions = function(state, session, pos, prefix) {
|
2730
|
+
var tagName = findTagName(session, pos);
|
2731
|
+
var attributeName = findAttributeName(session, pos);
|
2732
|
+
|
2733
|
+
if (!tagName)
|
2734
|
+
return [];
|
2735
|
+
var values = [];
|
2736
|
+
if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") {
|
2737
|
+
values = Object.keys(attributeMap[tagName][attributeName]);
|
2738
|
+
}
|
2739
|
+
return values.map(function(value){
|
2740
|
+
return {
|
2741
|
+
caption: value,
|
2742
|
+
snippet: value,
|
2743
|
+
meta: "attribute value",
|
2744
|
+
score: Number.MAX_VALUE
|
2745
|
+
};
|
2746
|
+
});
|
2747
|
+
};
|
2748
|
+
|
2749
|
+
this.getHTMLEntityCompletions = function(state, session, pos, prefix) {
|
2750
|
+
var values = ['Á', 'á', 'Â', 'â', '´', 'Æ', 'æ', 'À', 'à', 'ℵ', 'Α', 'α', '&', '∧', '∠', 'Å', 'å', '≈', 'Ã', 'ã', 'Ä', 'ä', '„', 'Β', 'β', '¦', '•', '∩', 'Ç', 'ç', '¸', '¢', 'Χ', 'χ', 'ˆ', '♣', '≅', '©', '↵', '∪', '¤', '‡', '†', '⇓', '↓', '°', 'Δ', 'δ', '♦', '÷', 'É', 'é', 'Ê', 'ê', 'È', 'è', '∅', ' ', ' ', 'Ε', 'ε', '≡', 'Η', 'η', 'Ð', 'ð', 'Ë', 'ë', '€', '∃', 'ƒ', '∀', '½', '¼', '¾', '⁄', 'Γ', 'γ', '≥', '>', '⇔', '↔', '♥', '…', 'Í', 'í', 'Î', 'î', '¡', 'Ì', 'ì', 'ℑ', '∞', '∫', 'Ι', 'ι', '¿', '∈', 'Ï', 'ï', 'Κ', 'κ', 'Λ', 'λ', '⟨', '«', '⇐', '←', '⌈', '“', '≤', '⌊', '∗', '◊', '‎', '‹', '‘', '<', '¯', '—', 'µ', '·', '−', 'Μ', 'μ', '∇', ' ', '–', '≠', '∋', '¬', '∉', '⊄', 'Ñ', 'ñ', 'Ν', 'ν', 'Ó', 'ó', 'Ô', 'ô', 'Œ', 'œ', 'Ò', 'ò', '‾', 'Ω', 'ω', 'Ο', 'ο', '⊕', '∨', 'ª', 'º', 'Ø', 'ø', 'Õ', 'õ', '⊗', 'Ö', 'ö', '¶', '∂', '‰', '⊥', 'Φ', 'φ', 'Π', 'π', 'ϖ', '±', '£', '″', '′', '∏', '∝', 'Ψ', 'ψ', '"', '√', '⟩', '»', '⇒', '→', '⌉', '”', 'ℜ', '®', '⌋', 'Ρ', 'ρ', '‏', '›', '’', '‚', 'Š', 'š', '⋅', '§', '­', 'Σ', 'σ', 'ς', '∼', '♠', '⊂', '⊆', '∑', '⊃', '¹', '²', '³', '⊇', 'ß', 'Τ', 'τ', '∴', 'Θ', 'θ', 'ϑ', ' ', 'Þ', 'þ', '˜', '×', '™', 'Ú', 'ú', '⇑', '↑', 'Û', 'û', 'Ù', 'ù', '¨', 'ϒ', 'Υ', 'υ', 'Ü', 'ü', '℘', 'Ξ', 'ξ', 'Ý', 'ý', '¥', 'Ÿ', 'ÿ', 'Ζ', 'ζ', '‍', '‌'];
|
2751
|
+
|
2752
|
+
return values.map(function(value){
|
2753
|
+
return {
|
2754
|
+
caption: value,
|
2755
|
+
snippet: value.substr(1),
|
2756
|
+
meta: "html entity",
|
2757
|
+
score: Number.MAX_VALUE
|
2758
|
+
};
|
2759
|
+
});
|
2760
|
+
};
|
2761
|
+
|
2403
2762
|
}).call(HtmlCompletions.prototype);
|
2404
2763
|
|
2405
2764
|
exports.HtmlCompletions = HtmlCompletions;
|
@@ -2584,6 +2943,7 @@ var MarkdownHighlightRules = function() {
|
|
2584
2943
|
}],
|
2585
2944
|
"allowBlock": [
|
2586
2945
|
{token : "support.function", regex : "^ {4}.+", next : "allowBlock"},
|
2946
|
+
{token : "empty_line", regex : '^$', next: "allowBlock"},
|
2587
2947
|
{token : "empty", regex : "", next : "start"}
|
2588
2948
|
],
|
2589
2949
|
|