ace-rails-ap 0.0.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ace/rails/version.rb +1 -1
- data/vendor/assets/javascripts/ace.js +15680 -1
- data/vendor/assets/javascripts/keybinding-emacs.js +367 -1
- data/vendor/assets/javascripts/keybinding-vim.js +1635 -1
- data/vendor/assets/javascripts/mode-c9search.js +275 -0
- data/vendor/assets/javascripts/mode-c_cpp.js +744 -1
- data/vendor/assets/javascripts/mode-clojure.js +364 -1
- data/vendor/assets/javascripts/mode-coffee.js +527 -1
- data/vendor/assets/javascripts/mode-coldfusion.js +1966 -1
- data/vendor/assets/javascripts/mode-csharp.js +633 -1
- data/vendor/assets/javascripts/mode-css.js +499 -1
- data/vendor/assets/javascripts/mode-diff.js +250 -0
- data/vendor/assets/javascripts/{mode-c_cpp-uncompressed.js → mode-glsl.js} +147 -244
- data/vendor/assets/javascripts/mode-golang.js +681 -1
- data/vendor/assets/javascripts/mode-groovy.js +1240 -1
- data/vendor/assets/javascripts/mode-haxe.js +633 -1
- data/vendor/assets/javascripts/mode-html.js +2064 -1
- data/vendor/assets/javascripts/mode-java.js +1202 -1
- data/vendor/assets/javascripts/mode-javascript.js +1069 -1
- data/vendor/assets/javascripts/mode-json.js +588 -1
- data/vendor/assets/javascripts/{mode-haxe-uncompressed.js → mode-jsx.js} +189 -312
- data/vendor/assets/javascripts/mode-latex.js +95 -1
- data/vendor/assets/javascripts/mode-less.js +512 -1
- data/vendor/assets/javascripts/mode-liquid.js +1125 -1
- data/vendor/assets/javascripts/mode-lua.js +551 -1
- data/vendor/assets/javascripts/{mode-html-uncompressed.js → mode-luahtml.js} +544 -604
- data/vendor/assets/javascripts/{mode-coldfusion-uncompressed.js → mode-luapage.js} +2326 -2180
- data/vendor/assets/javascripts/mode-markdown.js +2369 -1
- data/vendor/assets/javascripts/mode-ocaml.js +464 -1
- data/vendor/assets/javascripts/mode-perl.js +432 -1
- data/vendor/assets/javascripts/mode-pgsql.js +970 -1
- data/vendor/assets/javascripts/mode-php.js +1718 -1
- data/vendor/assets/javascripts/mode-powershell.js +610 -1
- data/vendor/assets/javascripts/mode-python.js +397 -1
- data/vendor/assets/javascripts/mode-ruby.js +318 -1
- data/vendor/assets/javascripts/mode-scad.js +732 -1
- data/vendor/assets/javascripts/mode-scala.js +1237 -1
- data/vendor/assets/javascripts/mode-scss.js +537 -1
- data/vendor/assets/javascripts/mode-sh.js +250 -1
- data/vendor/assets/javascripts/mode-sql.js +140 -1
- data/vendor/assets/javascripts/mode-svg.js +1681 -1
- data/vendor/assets/javascripts/mode-tcl.js +320 -0
- data/vendor/assets/javascripts/mode-textile.js +182 -1
- data/vendor/assets/javascripts/mode-xml.js +829 -1
- data/vendor/assets/javascripts/mode-xquery.js +605 -1
- data/vendor/assets/javascripts/mode-yaml.js +189 -0
- data/vendor/assets/javascripts/theme-chrome.js +213 -1
- data/vendor/assets/javascripts/theme-clouds.js +167 -1
- data/vendor/assets/javascripts/theme-clouds_midnight.js +168 -1
- data/vendor/assets/javascripts/theme-cobalt.js +194 -1
- data/vendor/assets/javascripts/theme-crimson_editor.js +200 -1
- data/vendor/assets/javascripts/theme-dawn.js +198 -1
- data/vendor/assets/javascripts/theme-dreamweaver.js +230 -1
- data/vendor/assets/javascripts/theme-eclipse.js +157 -1
- data/vendor/assets/javascripts/theme-github.js +182 -0
- data/vendor/assets/javascripts/theme-idle_fingers.js +186 -1
- data/vendor/assets/javascripts/theme-kr_theme.js +189 -1
- data/vendor/assets/javascripts/theme-merbivore.js +189 -1
- data/vendor/assets/javascripts/theme-merbivore_soft.js +195 -1
- data/vendor/assets/javascripts/theme-mono_industrial.js +197 -1
- data/vendor/assets/javascripts/theme-monokai.js +194 -1
- data/vendor/assets/javascripts/theme-pastel_on_dark.js +199 -1
- data/vendor/assets/javascripts/theme-solarized_dark.js +180 -1
- data/vendor/assets/javascripts/theme-solarized_light.js +179 -1
- data/vendor/assets/javascripts/theme-textmate.js +216 -0
- data/vendor/assets/javascripts/theme-tomorrow.js +213 -1
- data/vendor/assets/javascripts/theme-tomorrow_night.js +213 -1
- data/vendor/assets/javascripts/theme-tomorrow_night_blue.js +213 -1
- data/vendor/assets/javascripts/theme-tomorrow_night_bright.js +213 -1
- data/vendor/assets/javascripts/theme-tomorrow_night_eighties.js +209 -1
- data/vendor/assets/javascripts/theme-twilight.js +211 -1
- data/vendor/assets/javascripts/theme-vibrant_ink.js +190 -1
- data/vendor/assets/javascripts/worker-coffee.js +83 -893
- data/vendor/assets/javascripts/worker-css.js +88 -1402
- data/vendor/assets/javascripts/worker-javascript.js +97 -812
- data/vendor/assets/javascripts/worker-json.js +84 -761
- data/vendor/assets/javascripts/worker-xquery.js +66464 -0
- metadata +12 -195
- data/vendor/assets/javascripts/ace-compat-noconflict.js +0 -1
- data/vendor/assets/javascripts/ace-compat-uncompressed-noconflict.js +0 -480
- data/vendor/assets/javascripts/ace-compat-uncompressed.js +0 -480
- data/vendor/assets/javascripts/ace-compat.js +0 -1
- data/vendor/assets/javascripts/ace-noconflict.js +0 -10
- data/vendor/assets/javascripts/ace-uncompressed-noconflict.js +0 -19976
- data/vendor/assets/javascripts/ace-uncompressed.js +0 -19976
- data/vendor/assets/javascripts/keybinding-emacs-noconflict.js +0 -1
- data/vendor/assets/javascripts/keybinding-emacs-uncompressed-noconflict.js +0 -150
- data/vendor/assets/javascripts/keybinding-emacs-uncompressed.js +0 -150
- data/vendor/assets/javascripts/keybinding-vim-noconflict.js +0 -1
- data/vendor/assets/javascripts/keybinding-vim-uncompressed-noconflict.js +0 -138
- data/vendor/assets/javascripts/keybinding-vim-uncompressed.js +0 -138
- data/vendor/assets/javascripts/mode-c_cpp-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-c_cpp-uncompressed-noconflict.js +0 -919
- data/vendor/assets/javascripts/mode-clojure-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-clojure-uncompressed-noconflict.js +0 -422
- data/vendor/assets/javascripts/mode-clojure-uncompressed.js +0 -422
- data/vendor/assets/javascripts/mode-coffee-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-coffee-uncompressed-noconflict.js +0 -607
- data/vendor/assets/javascripts/mode-coffee-uncompressed.js +0 -607
- data/vendor/assets/javascripts/mode-coldfusion-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-coldfusion-uncompressed-noconflict.js +0 -2458
- data/vendor/assets/javascripts/mode-csharp-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-csharp-uncompressed-noconflict.js +0 -769
- data/vendor/assets/javascripts/mode-csharp-uncompressed.js +0 -769
- data/vendor/assets/javascripts/mode-css-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-css-uncompressed-noconflict.js +0 -641
- data/vendor/assets/javascripts/mode-css-uncompressed.js +0 -641
- data/vendor/assets/javascripts/mode-golang-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-golang-uncompressed-noconflict.js +0 -378
- data/vendor/assets/javascripts/mode-golang-uncompressed.js +0 -378
- data/vendor/assets/javascripts/mode-groovy-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-groovy-uncompressed-noconflict.js +0 -1393
- data/vendor/assets/javascripts/mode-groovy-uncompressed.js +0 -1393
- data/vendor/assets/javascripts/mode-haxe-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-haxe-uncompressed-noconflict.js +0 -769
- data/vendor/assets/javascripts/mode-html-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-html-uncompressed-noconflict.js +0 -2475
- data/vendor/assets/javascripts/mode-java-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-java-uncompressed-noconflict.js +0 -1395
- data/vendor/assets/javascripts/mode-java-uncompressed.js +0 -1395
- data/vendor/assets/javascripts/mode-javascript-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-javascript-uncompressed-noconflict.js +0 -1226
- data/vendor/assets/javascripts/mode-javascript-uncompressed.js +0 -1226
- data/vendor/assets/javascripts/mode-json-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-json-uncompressed-noconflict.js +0 -701
- data/vendor/assets/javascripts/mode-json-uncompressed.js +0 -701
- data/vendor/assets/javascripts/mode-latex-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-latex-uncompressed-noconflict.js +0 -95
- data/vendor/assets/javascripts/mode-latex-uncompressed.js +0 -95
- data/vendor/assets/javascripts/mode-less-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-less-uncompressed-noconflict.js +0 -655
- data/vendor/assets/javascripts/mode-less-uncompressed.js +0 -655
- data/vendor/assets/javascripts/mode-liquid-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-liquid-uncompressed-noconflict.js +0 -1353
- data/vendor/assets/javascripts/mode-liquid-uncompressed.js +0 -1353
- data/vendor/assets/javascripts/mode-lua-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-lua-uncompressed-noconflict.js +0 -523
- data/vendor/assets/javascripts/mode-lua-uncompressed.js +0 -523
- data/vendor/assets/javascripts/mode-markdown-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-markdown-uncompressed-noconflict.js +0 -2925
- data/vendor/assets/javascripts/mode-markdown-uncompressed.js +0 -2925
- data/vendor/assets/javascripts/mode-ocaml-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-ocaml-uncompressed-noconflict.js +0 -539
- data/vendor/assets/javascripts/mode-ocaml-uncompressed.js +0 -539
- data/vendor/assets/javascripts/mode-perl-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-perl-uncompressed-noconflict.js +0 -574
- data/vendor/assets/javascripts/mode-perl-uncompressed.js +0 -574
- data/vendor/assets/javascripts/mode-pgsql-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-pgsql-uncompressed-noconflict.js +0 -1104
- data/vendor/assets/javascripts/mode-pgsql-uncompressed.js +0 -1104
- data/vendor/assets/javascripts/mode-php-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-php-uncompressed-noconflict.js +0 -1885
- data/vendor/assets/javascripts/mode-php-uncompressed.js +0 -1885
- data/vendor/assets/javascripts/mode-powershell-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-powershell-uncompressed-noconflict.js +0 -710
- data/vendor/assets/javascripts/mode-powershell-uncompressed.js +0 -710
- data/vendor/assets/javascripts/mode-python-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-python-uncompressed-noconflict.js +0 -507
- data/vendor/assets/javascripts/mode-python-uncompressed.js +0 -507
- data/vendor/assets/javascripts/mode-ruby-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-ruby-uncompressed-noconflict.js +0 -391
- data/vendor/assets/javascripts/mode-ruby-uncompressed.js +0 -391
- data/vendor/assets/javascripts/mode-scad-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-scad-uncompressed-noconflict.js +0 -907
- data/vendor/assets/javascripts/mode-scad-uncompressed.js +0 -907
- data/vendor/assets/javascripts/mode-scala-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-scala-uncompressed-noconflict.js +0 -1395
- data/vendor/assets/javascripts/mode-scala-uncompressed.js +0 -1395
- data/vendor/assets/javascripts/mode-scss-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-scss-uncompressed-noconflict.js +0 -679
- data/vendor/assets/javascripts/mode-scss-uncompressed.js +0 -679
- data/vendor/assets/javascripts/mode-sh-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-sh-uncompressed-noconflict.js +0 -289
- data/vendor/assets/javascripts/mode-sh-uncompressed.js +0 -289
- data/vendor/assets/javascripts/mode-sql-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-sql-uncompressed-noconflict.js +0 -159
- data/vendor/assets/javascripts/mode-sql-uncompressed.js +0 -159
- data/vendor/assets/javascripts/mode-svg-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-svg-uncompressed-noconflict.js +0 -2137
- data/vendor/assets/javascripts/mode-svg-uncompressed.js +0 -2137
- data/vendor/assets/javascripts/mode-text-noconflict.js +0 -0
- data/vendor/assets/javascripts/mode-text-uncompressed-noconflict.js +0 -0
- data/vendor/assets/javascripts/mode-text-uncompressed.js +0 -0
- data/vendor/assets/javascripts/mode-textile-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-textile-uncompressed-noconflict.js +0 -254
- data/vendor/assets/javascripts/mode-textile-uncompressed.js +0 -254
- data/vendor/assets/javascripts/mode-xml-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-xml-uncompressed-noconflict.js +0 -1012
- data/vendor/assets/javascripts/mode-xml-uncompressed.js +0 -1012
- data/vendor/assets/javascripts/mode-xquery-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-xquery-uncompressed-noconflict.js +0 -540
- data/vendor/assets/javascripts/mode-xquery-uncompressed.js +0 -540
- data/vendor/assets/javascripts/theme-chrome-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-chrome-uncompressed-noconflict.js +0 -207
- data/vendor/assets/javascripts/theme-chrome-uncompressed.js +0 -207
- data/vendor/assets/javascripts/theme-clouds-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-clouds-uncompressed-noconflict.js +0 -160
- data/vendor/assets/javascripts/theme-clouds-uncompressed.js +0 -160
- data/vendor/assets/javascripts/theme-clouds_midnight-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-clouds_midnight-uncompressed-noconflict.js +0 -161
- data/vendor/assets/javascripts/theme-clouds_midnight-uncompressed.js +0 -161
- data/vendor/assets/javascripts/theme-cobalt-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-cobalt-uncompressed-noconflict.js +0 -187
- data/vendor/assets/javascripts/theme-cobalt-uncompressed.js +0 -187
- data/vendor/assets/javascripts/theme-crimson_editor-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-crimson_editor-uncompressed-noconflict.js +0 -198
- data/vendor/assets/javascripts/theme-crimson_editor-uncompressed.js +0 -198
- data/vendor/assets/javascripts/theme-dawn-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-dawn-uncompressed-noconflict.js +0 -191
- data/vendor/assets/javascripts/theme-dawn-uncompressed.js +0 -191
- data/vendor/assets/javascripts/theme-dreamweaver-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-dreamweaver-uncompressed-noconflict.js +0 -227
- data/vendor/assets/javascripts/theme-dreamweaver-uncompressed.js +0 -227
- data/vendor/assets/javascripts/theme-eclipse-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-eclipse-uncompressed-noconflict.js +0 -147
- data/vendor/assets/javascripts/theme-eclipse-uncompressed.js +0 -147
- data/vendor/assets/javascripts/theme-idle_fingers-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-idle_fingers-uncompressed-noconflict.js +0 -179
- data/vendor/assets/javascripts/theme-idle_fingers-uncompressed.js +0 -179
- data/vendor/assets/javascripts/theme-kr_theme-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-kr_theme-uncompressed-noconflict.js +0 -182
- data/vendor/assets/javascripts/theme-kr_theme-uncompressed.js +0 -182
- data/vendor/assets/javascripts/theme-merbivore-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-merbivore-uncompressed-noconflict.js +0 -182
- data/vendor/assets/javascripts/theme-merbivore-uncompressed.js +0 -182
- data/vendor/assets/javascripts/theme-merbivore_soft-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-merbivore_soft-uncompressed-noconflict.js +0 -188
- data/vendor/assets/javascripts/theme-merbivore_soft-uncompressed.js +0 -188
- data/vendor/assets/javascripts/theme-mono_industrial-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-mono_industrial-uncompressed-noconflict.js +0 -190
- data/vendor/assets/javascripts/theme-mono_industrial-uncompressed.js +0 -190
- data/vendor/assets/javascripts/theme-monokai-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-monokai-uncompressed-noconflict.js +0 -191
- data/vendor/assets/javascripts/theme-monokai-uncompressed.js +0 -191
- data/vendor/assets/javascripts/theme-pastel_on_dark-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-pastel_on_dark-uncompressed-noconflict.js +0 -192
- data/vendor/assets/javascripts/theme-pastel_on_dark-uncompressed.js +0 -192
- data/vendor/assets/javascripts/theme-solarized_dark-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-solarized_dark-uncompressed-noconflict.js +0 -176
- data/vendor/assets/javascripts/theme-solarized_dark-uncompressed.js +0 -176
- data/vendor/assets/javascripts/theme-solarized_light-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-solarized_light-uncompressed-noconflict.js +0 -172
- data/vendor/assets/javascripts/theme-solarized_light-uncompressed.js +0 -172
- data/vendor/assets/javascripts/theme-textmate-noconflict.js +0 -0
- data/vendor/assets/javascripts/theme-textmate-uncompressed-noconflict.js +0 -0
- data/vendor/assets/javascripts/theme-textmate-uncompressed.js +0 -0
- data/vendor/assets/javascripts/theme-tomorrow-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-tomorrow-uncompressed-noconflict.js +0 -206
- data/vendor/assets/javascripts/theme-tomorrow-uncompressed.js +0 -206
- data/vendor/assets/javascripts/theme-tomorrow_night-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-tomorrow_night-uncompressed-noconflict.js +0 -206
- data/vendor/assets/javascripts/theme-tomorrow_night-uncompressed.js +0 -206
- data/vendor/assets/javascripts/theme-tomorrow_night_blue-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-tomorrow_night_blue-uncompressed-noconflict.js +0 -209
- data/vendor/assets/javascripts/theme-tomorrow_night_blue-uncompressed.js +0 -209
- data/vendor/assets/javascripts/theme-tomorrow_night_bright-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-tomorrow_night_bright-uncompressed-noconflict.js +0 -206
- data/vendor/assets/javascripts/theme-tomorrow_night_bright-uncompressed.js +0 -206
- data/vendor/assets/javascripts/theme-tomorrow_night_eighties-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-tomorrow_night_eighties-uncompressed-noconflict.js +0 -202
- data/vendor/assets/javascripts/theme-tomorrow_night_eighties-uncompressed.js +0 -202
- data/vendor/assets/javascripts/theme-twilight-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-twilight-uncompressed-noconflict.js +0 -204
- data/vendor/assets/javascripts/theme-twilight-uncompressed.js +0 -204
- data/vendor/assets/javascripts/theme-vibrant_ink-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-vibrant_ink-uncompressed-noconflict.js +0 -183
- data/vendor/assets/javascripts/theme-vibrant_ink-uncompressed.js +0 -183
@@ -1 +1,2369 @@
|
|
1
|
-
define("ace/mode/markdown",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript","ace/mode/xml","ace/mode/html","ace/tokenizer","ace/mode/markdown_highlight_rules"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("./text").Mode,f=a("./javascript").Mode,g=a("./xml").Mode,h=a("./html").Mode,i=a("../tokenizer").Tokenizer,j=a("./markdown_highlight_rules").MarkdownHighlightRules,k=function(){var a=new j;this.$tokenizer=new i(a.getRules()),this.$embeds=a.getEmbeds(),this.createModeDelegates({"js-":f,"xml-":g,"html-":h})};d.inherits(k,e),function(){this.getNextLineIndent=function(a,b,c){if(a=="listblock"){var d=/^((?:.+)?)([-+*][ ]+)/.exec(b);return d?(new Array(d[1].length+1)).join(" ")+d[2]:""}return this.$getIndent(b)}}.call(k.prototype),b.Mode=k}),define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("./text").Mode,f=a("../tokenizer").Tokenizer,g=a("./javascript_highlight_rules").JavaScriptHighlightRules,h=a("./matching_brace_outdent").MatchingBraceOutdent,i=a("../range").Range,j=a("../worker/worker_client").WorkerClient,k=a("./behaviour/cstyle").CstyleBehaviour,l=a("./folding/cstyle").FoldMode,m=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h,this.$behaviour=new k,this.foldingRules=new l};d.inherits(m,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=/^(\s*)\/\//;for(var g=c;g<=d;g++)if(!f.test(b.getLine(g))){e=!1;break}if(e){var h=new i(0,0,0,0);for(var g=c;g<=d;g++){var j=b.getLine(g),k=j.match(f);h.start.row=g,h.end.row=g,h.end.column=k[0].length,b.replace(h,k[1])}}else b.indentRows(c,d,"//")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"||a=="regex_allowed"){var h=b.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);h&&(d+=c)}else if(a=="doc-start"){if(g=="start"||a=="regex_allowed")return"";var h=b.match(/^\s*(\/?)\*/);h&&(h[1]&&(d+=" "),d+="* ")}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)},this.createWorker=function(a){var b=new j(["ace"],"worker-javascript.js","ace/mode/javascript_worker","JavaScriptWorker");return b.attachToDocument(a.getDocument()),b.on("jslint",function(b){var c=[];for(var d=0;d<b.data.length;d++){var e=b.data[d];e&&c.push({row:e.line-1,column:e.character-1,text:e.reason,type:"warning",lint:e})}a.setAnnotations(c)}),b.on("narcissus",function(b){a.setAnnotations([b.data])}),b.on("terminate",function(){a.clearAnnotations()}),b}}.call(m.prototype),b.Mode=m}),define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/unicode","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("../lib/lang"),f=a("../unicode"),g=a("./doc_comment_highlight_rules").DocCommentHighlightRules,h=a("./text_highlight_rules").TextHighlightRules,i=function(){var a=e.arrayToMap("Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document".split("|")),b=e.arrayToMap("break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|const|yield|import|get|set".split("|")),c="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield",d=e.arrayToMap("__parent__|__count__|escape|unescape|with|__proto__".split("|")),h=e.arrayToMap("const|let|var|function".split("|")),i=e.arrayToMap("null|Infinity|NaN|undefined".split("|")),j=e.arrayToMap("class|enum|extends|super|export|implements|private|public|interface|package|protected|static".split("|")),k="["+f.packages.L+"\\$_]["+f.packages.L+f.packages.Mn+f.packages.Mc+f.packages.Nd+f.packages.Pc+"\\$_]*\\b",l="\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)";this.$rules={start:[{token:"comment",regex:/\/\/.*$/},g.getStartRule("doc-start"),{token:"comment",merge:!0,regex:/\/\*/,next:"comment"},{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0[xX][0-9a-fA-F]+\b/},{token:"constant.numeric",regex:/[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/},{token:["storage.type","punctuation.operator","support.function","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+k+")(\\.)(prototype)(\\.)("+k+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","punctuation.operator","support.function","punctuation.operator","entity.name.function","text","keyword.operator","text"],regex:"("+k+")(\\.)(prototype)(\\.)("+k+")(\\s*)(=)(\\s*)",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+k+")(\\.)("+k+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+k+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","entity.name.function","text","paren.lparen"],regex:"(function)(\\s+)("+k+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","paren.lparen"],regex:"("+k+")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:"constant.language.boolean",regex:/(?:true|false)\b/},{token:"keyword",regex:"(?:"+c+")\\b",next:"regex_allowed"},{token:["punctuation.operator","support.function"],regex:/(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|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(?=\()/},{token:["punctuation.operator","support.function.dom"],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)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:["punctuation.operator","support.constant"],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/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/},{token:function(c){return a.hasOwnProperty(c)?"variable.language":d.hasOwnProperty(c)?"invalid.deprecated":h.hasOwnProperty(c)?"storage.type":b.hasOwnProperty(c)?"keyword":i.hasOwnProperty(c)?"constant.language":j.hasOwnProperty(c)?"invalid.illegal":c=="debugger"?"invalid.deprecated":"identifier"},regex:k},{token:"keyword.operator",regex:/!|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=|\b(?:in|instanceof|new|delete|typeof|void)/,next:"regex_allowed"},{token:"punctuation.operator",regex:/\?|\:|\,|\;|\./,next:"regex_allowed"},{token:"paren.lparen",regex:/[\[({]/,next:"regex_allowed"},{token:"paren.rparen",regex:/[\])}]/},{token:"keyword.operator",regex:/\/=?/,next:"regex_allowed"},{token:"comment",regex:/^#!.*$/},{token:"text",regex:/\s+/}],regex_allowed:[g.getStartRule("doc-start"),{token:"comment",merge:!0,regex:"\\/\\*",next:"comment_regex_allowed"},{token:"comment",regex:"\\/\\/.*$"},{token:"string.regexp",regex:"\\/",next:"regex",merge:!0},{token:"text",regex:"\\s+"},{token:"empty",regex:"",next:"start"}],regex:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/\\w*",next:"start",merge:!0},{token:"string.regexp",regex:"[^\\\\/\\[]+",merge:!0},{token:"string.regexp.charachterclass",regex:"\\[",next:"regex_character_class",merge:!0},{token:"empty",regex:"",next:"start"}],regex_character_class:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp.charachterclass",regex:"]",next:"regex",merge:!0},{token:"string.regexp.charachterclass",regex:"[^\\\\\\]]+",merge:!0},{token:"empty",regex:"",next:"start"}],function_arguments:[{token:"variable.parameter",regex:k},{token:"punctuation.operator",regex:"[, ]+",merge:!0},{token:"punctuation.operator",regex:"$",merge:!0},{token:"empty",regex:"",next:"start"}],comment_regex_allowed:[{token:"comment",regex:".*?\\*\\/",merge:!0,next:"regex_allowed"},{token:"comment",merge:!0,regex:".+"}],comment:[{token:"comment",regex:".*?\\*\\/",merge:!0,next:"start"},{token:"comment",merge:!0,regex:".+"}],qqstring:[{token:"constant.language.escape",regex:l},{token:"string",regex:'[^"\\\\]+',merge:!0},{token:"string",regex:"\\\\$",next:"qqstring",merge:!0},{token:"string",regex:'"|$',next:"start",merge:!0}],qstring:[{token:"constant.language.escape",regex:l},{token:"string",regex:"[^'\\\\]+",merge:!0},{token:"string",regex:"\\\\$",next:"qstring",merge:!0},{token:"string",regex:"'|$",next:"start",merge:!0}]},this.embedRules(g,"doc-",[g.getEndRule("start")])};d.inherits(i,h),b.JavaScriptHighlightRules=i}),define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("./text_highlight_rules").TextHighlightRules,f=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc",merge:!0,regex:"\\s+"},{token:"comment.doc",merge:!0,regex:"TODO"},{token:"comment.doc",merge:!0,regex:"[^@\\*]+"},{token:"comment.doc",merge:!0,regex:"."}]}};d.inherits(f,e),f.getStartRule=function(a){return{token:"comment.doc",merge:!0,regex:"\\/\\*(?=\\*)",next:a}},f.getEndRule=function(a){return{token:"comment.doc",merge:!0,regex:"\\*\\/",next:a}},b.DocCommentHighlightRules=f}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(a,b,c){"use strict";var d=a("../range").Range,e=function(){};(function(){this.checkOutdent=function(a,b){return/^\s+$/.test(a)?/^\s*\}/.test(b):!1},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);return b?b[1]:""}}).call(e.prototype),b.MatchingBraceOutdent=e}),define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour"],function(a,b,c){"use strict";var d=a("../../lib/oop"),e=a("../behaviour").Behaviour,f=function(){this.add("braces","insertion",function(a,b,c,d,e){if(e=="{"){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);return g!==""?{text:"{"+g+"}",selection:!1}:{text:"{}",selection:[1,1]}}if(e=="}"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j=="}"){var k=d.$findOpeningBracket("}",{column:h.column+1,row:h.row});if(k!==null)return{text:"",selection:[1,1]}}}else if(e=="\n"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j=="}"){var l=d.findMatchingBracket({row:h.row,column:h.column+1});if(!l)return null;var m=this.getNextLineIndent(a,i.substring(0,i.length-1),d.getTabString()),n=this.$getIndent(d.doc.getLine(l.row));return{text:"\n"+m+"\n"+n,selection:[1,m.length,1,m.length]}}}}),this.add("braces","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=="{"){var g=d.doc.getLine(e.start.row),h=g.substring(e.end.column,e.end.column+1);if(h=="}")return e.end.column++,e}}),this.add("parens","insertion",function(a,b,c,d,e){if(e=="("){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);return g!==""?{text:"("+g+")",selection:!1}:{text:"()",selection:[1,1]}}if(e==")"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j==")"){var k=d.$findOpeningBracket(")",{column:h.column+1,row:h.row});if(k!==null)return{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=="("){var g=d.doc.getLine(e.start.row),h=g.substring(e.start.column+1,e.start.column+2);if(h==")")return e.end.column++,e}}),this.add("string_dquotes","insertion",function(a,b,c,d,e){if(e=='"'||e=="'"){var f=e,g=c.getSelectionRange(),h=d.doc.getTextRange(g);if(h!=="")return{text:f+h+f,selection:!1};var i=c.getCursorPosition(),j=d.doc.getLine(i.row),k=j.substring(i.column-1,i.column);if(k=="\\")return null;var l=d.getTokens(g.start.row,g.start.row)[0].tokens,m=0,n,o=-1;for(var p=0;p<l.length;p++){n=l[p],n.type=="string"?o=-1:o<0&&(o=n.value.indexOf(f));if(n.value.length+m>g.start.column)break;m+=l[p].value.length}if(!n||o<0&&n.type!=="comment"&&(n.type!=="string"||g.start.column!==n.value.length+m-1&&n.value.lastIndexOf(f)===n.value.length-1))return{text:f+f,selection:[1,1]};if(n&&n.type==="string"){var q=j.substring(i.column,i.column+1);if(q==f)return{text:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&(f=='"'||f=="'")){var g=d.doc.getLine(e.start.row),h=g.substring(e.start.column+1,e.start.column+2);if(h=='"')return e.end.column++,e}})};d.inherits(f,e),b.CstyleBehaviour=f}),define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(a,b,c){"use strict";var d=a("../../lib/oop"),e=a("../../range").Range,f=a("./fold_mode").FoldMode,g=b.FoldMode=function(){};d.inherits(g,f),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.getFoldWidgetRange=function(a,b,c){var d=a.getLine(c),f=d.match(this.foldingStartMarker);if(f){var g=f.index;if(f[1])return this.openingBracketBlock(a,f[1],c,g);var h=a.getCommentFoldRange(c,g+f[0].length);return h.end.column-=2,h}if(b!=="markbeginend")return;var f=d.match(this.foldingStopMarker);if(f){var g=f.index+f[0].length;if(f[2]){var h=a.getCommentFoldRange(c,g);return h.end.column-=2,h}var i={row:c,column:g},j=a.$findOpeningBracket(f[1],i);if(!j)return;return j.column++,i.column--,e.fromPoints(j,i)}}}.call(g.prototype)}),define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(a,b,c){"use strict";var d=a("../../range").Range,e=b.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(a,b,c){var d=a.getLine(c);return this.foldingStartMarker.test(d)?"start":b=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(d)?"end":""},this.getFoldWidgetRange=function(a,b,c){return null},this.indentationBlock=function(a,b,c){var e=/^\s*/,f=b,g=b,h=a.getLine(b),i=c||h.length,j=h.match(e)[0].length,k=a.getLength();while(++b<k){h=a.getLine(b);var l=h.match(e)[0].length;if(l==h.length)continue;if(l<=j)break;g=b}if(g>f){var m=a.getLine(g).length;return new d(f,i,g,m)}},this.openingBracketBlock=function(a,b,c,e){var f={row:c,column:e+1},g=a.$findClosingBracket(b,f);if(!g)return;var h=a.foldWidgets[g.row];return h==null&&(h=this.getFoldWidget(a,g.row)),h=="start"&&(g.row--,g.column=a.getLine(g.row).length),d.fromPoints(f,g)}}).call(e.prototype)}),define("ace/mode/xml",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/xml_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/xml"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("./text").Mode,f=a("../tokenizer").Tokenizer,g=a("./xml_highlight_rules").XmlHighlightRules,h=a("./behaviour/xml").XmlBehaviour,i=a("./folding/xml").FoldMode,j=function(){this.$tokenizer=new f((new g).getRules()),this.$behaviour=new h,this.foldingRules=new i};d.inherits(j,e),function(){this.getNextLineIndent=function(a,b,c){return this.$getIndent(b)}}.call(j.prototype),b.Mode=j}),define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/xml_util","ace/mode/text_highlight_rules"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("./xml_util"),f=a("./text_highlight_rules").TextHighlightRules,g=function(){this.$rules={start:[{token:"text",regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:"xml_pe",regex:"<\\?.*?\\?>"},{token:"comment",merge:!0,regex:"<\\!--",next:"comment"},{token:"xml_pe",regex:"<\\!.*?>"},{token:"meta.tag",regex:"<\\/?",next:"tag"},{token:"text",regex:"\\s+"},{token:"constant.character.entity",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"},{token:"text",regex:"[^<]+"}],cdata:[{token:"text",regex:"\\]\\]>",next:"start"},{token:"text",regex:"\\s+"},{token:"text",regex:"(?:[^\\]]|\\](?!\\]>))+"}],comment:[{token:"comment",regex:".*?-->",next:"start"},{token:"comment",merge:!0,regex:".+"}]},e.tag(this.$rules,"tag","start")};d.inherits(g,f),b.XmlHighlightRules=g}),define("ace/mode/xml_util",["require","exports","module","ace/lib/lang"],function(a,b,c){function g(a){return[{token:"string",regex:'".*?"'},{token:"string",merge:!0,regex:'["].*',next:a+"_qqstring"},{token:"string",regex:"'.*?'"},{token:"string",merge:!0,regex:"['].*",next:a+"_qstring"}]}function h(a,b){return[{token:"string",merge:!0,regex:".*?"+a,next:b},{token:"string",merge:!0,regex:".+"}]}"use strict";var d=a("../lib/lang"),e=d.arrayToMap("button|form|input|label|select|textarea".split("|")),f=d.arrayToMap("table|tbody|td|tfoot|th|tr".split("|"));b.tag=function(a,b,c){a[b]=[{token:"text",regex:"\\s+"},{token:function(a){return a==="a"?"meta.tag.anchor":a==="img"?"meta.tag.image":a==="script"?"meta.tag.script":a==="style"?"meta.tag.style":e.hasOwnProperty(a.toLowerCase())?"meta.tag.form":f.hasOwnProperty(a.toLowerCase())?"meta.tag.table":"meta.tag"},merge:!0,regex:"[-_a-zA-Z0-9:]+",next:b+"_embed_attribute_list"},{token:"empty",regex:"",next:b+"_embed_attribute_list"}],a[b+"_qstring"]=h("'",b+"_embed_attribute_list"),a[b+"_qqstring"]=h('"',b+"_embed_attribute_list"),a[b+"_embed_attribute_list"]=[{token:"meta.tag",merge:!0,regex:"/?>",next:c},{token:"keyword.operator",regex:"="},{token:"entity.other.attribute-name",regex:"[-_a-zA-Z0-9:]+"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"text",regex:"\\s+"}].concat(g(b))}}),define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle"],function(a,b,c){"use strict";var d=a("../../lib/oop"),e=a("../behaviour").Behaviour,f=a("./cstyle").CstyleBehaviour,g=function(){this.inherit(f,["string_dquotes"]),this.add("brackets","insertion",function(a,b,c,d,e){if(e=="<"){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);return g!==""?!1:{text:"<>",selection:[1,1]}}if(e==">"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j==">")return{text:"",selection:[1,1]}}else if(e=="\n"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),k=i.substring(h.column,h.column+2);if(k=="</"){var l=this.$getIndent(d.doc.getLine(h.row))+d.getTabString(),m=this.$getIndent(d.doc.getLine(h.row));return{text:"\n"+l+"\n"+m,selection:[1,l.length,1,l.length]}}}})};d.inherits(g,e),b.XmlBehaviour=g}),define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/range","ace/mode/folding/fold_mode","ace/token_iterator"],function(a,b,c){"use strict";var d=a("../../lib/oop"),e=a("../../lib/lang"),f=a("../../range").Range,g=a("./fold_mode").FoldMode,h=a("../../token_iterator").TokenIterator,i=b.FoldMode=function(a){g.call(this),this.voidElements=a||{}};d.inherits(i,g),function(){this.getFoldWidget=function(a,b,c){var d=this._getFirstTagInLine(a,c);return d.closing?b=="markbeginend"?"end":"":!d.tagName||this.voidElements[d.tagName.toLowerCase()]?"":d.selfClosing?"":d.value.indexOf("/"+d.tagName)!==-1?"":"start"},this._getFirstTagInLine=function(a,b){var c=a.getTokens(b,b)[0].tokens,d="";for(var f=0;f<c.length;f++){var g=c[f];g.type.indexOf("meta.tag")===0?d+=g.value:d+=e.stringRepeat(" ",g.value.length)}return this._parseTag(d)},this.tagRe=/^(\s*)(<?(\/?)([-_a-zA-Z0-9:!]*)\s*(\/?)>?)/,this._parseTag=function(a){var b=this.tagRe.exec(a),c=this.tagRe.lastIndex||0;return this.tagRe.lastIndex=0,{value:a,match:b?b[2]:"",closing:b?!!b[3]:!1,selfClosing:b?!!b[5]||b[2]=="/>":!1,tagName:b?b[4]:"",column:b[1]?c+b[1].length:c}},this._readTagForward=function(a){var b=a.getCurrentToken();if(!b)return null;var c="",d;do if(b.type.indexOf("meta.tag")===0){if(!d)var d={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()};c+=b.value;if(c.indexOf(">")!==-1){var e=this._parseTag(c);return e.start=d,e.end={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()+b.value.length},a.stepForward(),e}}while(b=a.stepForward());return null},this._readTagBackward=function(a){var b=a.getCurrentToken();if(!b)return null;var c="",d;do if(b.type.indexOf("meta.tag")===0){d||(d={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()+b.value.length}),c=b.value+c;if(c.indexOf("<")!==-1){var e=this._parseTag(c);return e.end=d,e.start={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()},a.stepBackward(),e}}while(b=a.stepBackward());return null},this._pop=function(a,b){while(a.length){var c=a[a.length-1];if(!b||c.tagName==b.tagName)return a.pop();if(this.voidElements[b.tagName])return;if(this.voidElements[c.tagName]){a.pop();continue}return null}},this.getFoldWidgetRange=function(a,b,c){var d=this._getFirstTagInLine(a,c);if(!d.match)return null;var e=d.closing||d.selfClosing,g=[],i;if(!e){var j=new h(a,c,d.column),k={row:c,column:d.column+d.tagName.length+2};while(i=this._readTagForward(j)){if(i.selfClosing){if(!g.length)return i.start.column+=i.tagName.length+2,i.end.column-=2,f.fromPoints(i.start,i.end);continue}if(i.closing){this._pop(g,i);if(g.length==0)return f.fromPoints(k,i.start)}else g.push(i)}}else{var j=new h(a,c,d.column+d.match.length),l={row:c,column:d.column};while(i=this._readTagBackward(j)){if(i.selfClosing){if(!g.length)return i.start.column+=i.tagName.length+2,i.end.column-=2,f.fromPoints(i.start,i.end);continue}if(!i.closing){this._pop(g,i);if(g.length==0)return i.start.column+=i.tagName.length+2,f.fromPoints(i.start,l)}else g.push(i)}}}}.call(i.prototype)}),define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/tokenizer","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("./text").Mode,f=a("./javascript").Mode,g=a("./css").Mode,h=a("../tokenizer").Tokenizer,i=a("./html_highlight_rules").HtmlHighlightRules,j=a("./behaviour/xml").XmlBehaviour,k=a("./folding/html").FoldMode,l=function(){var a=new i;this.$tokenizer=new h(a.getRules()),this.$behaviour=new j,this.$embeds=a.getEmbeds(),this.createModeDelegates({"js-":f,"css-":g}),this.foldingRules=new k};d.inherits(l,e),function(){this.toggleCommentLines=function(a,b,c,d){return 0},this.getNextLineIndent=function(a,b,c){return this.$getIndent(b)},this.checkOutdent=function(a,b,c){return!1}}.call(l.prototype),b.Mode=l}),define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/folding/cstyle"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("./text").Mode,f=a("../tokenizer").Tokenizer,g=a("./css_highlight_rules").CssHighlightRules,h=a("./matching_brace_outdent").MatchingBraceOutdent,i=a("../worker/worker_client").WorkerClient,j=a("./folding/cstyle").FoldMode,k=function(){this.$tokenizer=new f((new g).getRules(),"i"),this.$outdent=new h,this.foldingRules=new j};d.inherits(k,e),function(){this.foldingRules="cStyle",this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a).tokens;if(e.length&&e[e.length-1].type=="comment")return d;var f=b.match(/^.*\{\s*$/);return f&&(d+=c),d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)},this.createWorker=function(a){var b=new i(["ace"],"worker-css.js","ace/mode/css_worker","Worker");return b.attachToDocument(a.getDocument()),b.on("csslint",function(b){var c=[];b.data.forEach(function(a){c.push({row:a.line-1,column:a.col-1,text:a.message,type:a.type,lint:a})}),a.setAnnotations(c)}),b}}.call(k.prototype),b.Mode=k}),define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("../lib/lang"),f=a("./text_highlight_rules").TextHighlightRules,g=function(){var a=e.arrayToMap("animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|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|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|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|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index".split("|")),b=e.arrayToMap("rgb|rgba|url|attr|counter|counters".split("|")),c=e.arrayToMap("absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|font-size|font|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|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero".split("|")),d=e.arrayToMap("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow".split("|")),f=e.arrayToMap("arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace".split("|")),g="\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))",h="(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b",i="(:)\\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",j=[{token:"comment",merge:!0,regex:"\\/\\*",next:"ruleset_comment"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:["constant.numeric","keyword"],regex:"("+g+")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)"},{token:["constant.numeric"],regex:"([0-9]+)"},{token:"constant.numeric",regex:"#[a-f0-9]{6}"},{token:"constant.numeric",regex:"#[a-f0-9]{3}"},{token:["punctuation","entity.other.attribute-name.pseudo-element.css"],regex:h},{token:["punctuation","entity.other.attribute-name.pseudo-class.css"],regex:i},{token:function(e){return a.hasOwnProperty(e.toLowerCase())?"support.type":b.hasOwnProperty(e.toLowerCase())?"support.function":c.hasOwnProperty(e.toLowerCase())?"support.constant":d.hasOwnProperty(e.toLowerCase())?"support.constant.color":f.hasOwnProperty(e.toLowerCase())?"support.constant.fonts":"text"},regex:"\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"}],k=e.copyArray(j);k.unshift({token:"paren.rparen",regex:"\\}",next:"start"});var l=e.copyArray(j);l.unshift({token:"paren.rparen",regex:"\\}",next:"media"});var m=[{token:"comment",merge:!0,regex:".+"}],n=e.copyArray(m);n.unshift({token:"comment",regex:".*?\\*\\/",next:"start"});var o=e.copyArray(m);o.unshift({token:"comment",regex:".*?\\*\\/",next:"media"});var p=e.copyArray(m);p.unshift({token:"comment",regex:".*?\\*\\/",next:"ruleset"}),this.$rules={start:[{token:"comment",merge:!0,regex:"\\/\\*",next:"comment"},{token:"paren.lparen",regex:"\\{",next:"ruleset"},{token:"string",regex:"@.*?{",next:"media"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant",regex:"[a-z0-9-_]+"}],media:[{token:"comment",merge:!0,regex:"\\/\\*",next:"media_comment"},{token:"paren.lparen",regex:"\\{",next:"media_ruleset"},{token:"string",regex:"\\}",next:"start"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant",regex:"[a-z0-9-_]+"}],comment:n,ruleset:k,ruleset_comment:p,media_ruleset:l,media_comment:o}};d.inherits(g,f),b.CssHighlightRules=g}),define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_util","ace/mode/text_highlight_rules"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("./css_highlight_rules").CssHighlightRules,f=a("./javascript_highlight_rules").JavaScriptHighlightRules,g=a("./xml_util"),h=a("./text_highlight_rules").TextHighlightRules,i=function(){this.$rules={start:[{token:"text",merge:!0,regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:"xml_pe",regex:"<\\?.*?\\?>"},{token:"comment",merge:!0,regex:"<\\!--",next:"comment"},{token:"xml_pe",regex:"<\\!.*?>"},{token:"meta.tag",regex:"<(?=s*script\\b)",next:"script"},{token:"meta.tag",regex:"<(?=s*style\\b)",next:"style"},{token:"meta.tag",regex:"<\\/?",next:"tag"},{token:"text",regex:"\\s+"},{token:"constant.character.entity",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"},{token:"text",regex:"[^<]+"}],cdata:[{token:"text",regex:"\\]\\]>",next:"start"},{token:"text",merge:!0,regex:"\\s+"},{token:"text",merge:!0,regex:".+"}],comment:[{token:"comment",regex:".*?-->",next:"start"},{token:"comment",merge:!0,regex:".+"}]},g.tag(this.$rules,"tag","start"),g.tag(this.$rules,"style","css-start"),g.tag(this.$rules,"script","js-start"),this.embedRules(f,"js-",[{token:"comment",regex:"\\/\\/.*(?=<\\/script>)",next:"tag"},{token:"meta.tag",regex:"<\\/(?=script)",next:"tag"}]),this.embedRules(e,"css-",[{token:"meta.tag",regex:"<\\/(?=style)",next:"tag"}])};d.inherits(i,h),b.HtmlHighlightRules=i}),define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"],function(a,b,c){"use strict";var d=a("../../lib/oop"),e=a("./mixed").FoldMode,f=a("./xml").FoldMode,g=a("./cstyle").FoldMode,h=b.FoldMode=function(){e.call(this,new f({area:1,base:1,br:1,col:1,command:1,embed:1,hr:1,img:1,input:1,keygen:1,link:1,meta:1,param:1,source:1,track:1,wbr:1,li:1,dt:1,dd:1,p:1,rt:1,rp:1,optgroup:1,option:1,colgroup:1,td:1,th:1}),{"js-":new g,"css-":new g})};d.inherits(h,e)}),define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"],function(a,b,c){"use strict";var d=a("../../lib/oop"),e=a("./fold_mode").FoldMode,f=b.FoldMode=function(a,b){this.defaultMode=a,this.subModes=b};d.inherits(f,e),function(){this.$getMode=function(a){for(var b in this.subModes)if(a.indexOf(b)===0)return this.subModes[b];return null},this.$tryMode=function(a,b,c,d){var e=this.$getMode(a);return e?e.getFoldWidget(b,c,d):""},this.getFoldWidget=function(a,b,c){return this.$tryMode(a.getState(c-1),a,b,c)||this.$tryMode(a.getState(c),a,b,c)||this.defaultMode.getFoldWidget(a,b,c)},this.getFoldWidgetRange=function(a,b,c){var d=this.$getMode(a.getState(c-1));if(!d||!d.getFoldWidget(a,b,c))d=this.$getMode(a.getState(c));if(!d||!d.getFoldWidget(a,b,c))d=this.defaultMode;return d.getFoldWidgetRange(a,b,c)}}.call(f.prototype)}),define("ace/mode/markdown_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules","ace/mode/html_highlight_rules","ace/mode/css_highlight_rules"],function(a,b,c){function j(a,b){return{token:"support.function",regex:"^```"+a+"\\s*$",next:b+"start"}}"use strict";var d=a("../lib/oop"),e=a("./text_highlight_rules").TextHighlightRules,f=a("./javascript_highlight_rules").JavaScriptHighlightRules,g=a("./xml_highlight_rules").XmlHighlightRules,h=a("./html_highlight_rules").HtmlHighlightRules,i=a("./css_highlight_rules").CssHighlightRules,k=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{token:["support.function","support.function","support.function"],regex:"(`+)([^\\r]*?[^`])(\\1)"},{token:"support.function",regex:"^[ ]{4}.+"},{token:"markup.heading.1",regex:"^=+(?=\\s*$)"},{token:"markup.heading.1",regex:"^\\-+(?=\\s*$)"},{token:function(a){return"markup.heading."+a.length},regex:"^#{1,6}"},j("javascript","js-"),j("xml","xml-"),j("html","html-"),j("css","css-"),{token:"support.function",regex:"^```[a-zA-Z]+\\s*$",next:"githubblock"},{token:"string",regex:"^>[ ].+$",next:"blockquote"},{token:["text","constant","text","url","string","text"],regex:'^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:["][^"]+["])?(\\s*))$'},{token:["text","string","text","constant","text"],regex:"(\\[)((?:[[^\\]]*\\]|[^\\[\\]])*)(\\][ ]?(?:\\n[ ]*)?\\[)(.*?)(\\])"},{token:["text","string","text","markup.underline","string","text"],regex:'(\\[)(\\[[^\\]]*\\]|[^\\[\\]]*)(\\]\\([ \\t]*)(<?(?:(?:[^\\(]*?\\([^\\)]*?\\)\\S*?)|(?:.*?))>?)((?:[ ]*"(?:.*?)"[ \\t]*)?)(\\))'},{token:"constant",regex:"^[ ]{0,2}(?:[ ]?\\*[ ]?){3,}\\s*$"},{token:"constant",regex:"^[ ]{0,2}(?:[ ]?\\-[ ]?){3,}\\s*$"},{token:"constant",regex:"^[ ]{0,2}(?:[ ]?\\_[ ]?){3,}\\s*$"},{token:"markup.list",regex:"^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",next:"listblock"},{token:["string","string","string"],regex:"([*]{2}|[_]{2}(?=\\S))([^\\r]*?\\S[*_]*)(\\1)"},{token:["string","string","string"],regex:"([*]|[_](?=\\S))([^\\r]*?\\S[*_]*)(\\1)"},{token:["text","url","text"],regex:"(<)((?:https?|ftp|dict):[^'\">\\s]+|(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+)(>)"},{token:"text",regex:"[^\\*_%$`\\[#<>]+"}],listblock:[{token:"empty_line",regex:"^$",next:"start"},{token:"markup.list",regex:".+"}],blockquote:[{token:"empty_line",regex:"^\\s*$",next:"start"},{token:"string",regex:".+"}],githubblock:[{token:"support.function",regex:"^```",next:"start"},{token:"support.function",regex:".+"}]},this.embedRules(f,"js-",[{token:"support.function",regex:"^```",next:"start"}]),this.embedRules(h,"html-",[{token:"support.function",regex:"^```",next:"start"}]),this.embedRules(i,"css-",[{token:"support.function",regex:"^```",next:"start"}]),this.embedRules(g,"xml-",[{token:"support.function",regex:"^```",next:"start"}])};d.inherits(k,e),b.MarkdownHighlightRules=k})
|
1
|
+
/* vim:ts=4:sts=4:sw=4:
|
2
|
+
* ***** BEGIN LICENSE BLOCK *****
|
3
|
+
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
4
|
+
*
|
5
|
+
* The contents of this file are subject to the Mozilla Public License Version
|
6
|
+
* 1.1 (the "License"); you may not use this file except in compliance with
|
7
|
+
* the License. You may obtain a copy of the License at
|
8
|
+
* http://www.mozilla.org/MPL/
|
9
|
+
*
|
10
|
+
* Software distributed under the License is distributed on an "AS IS" basis,
|
11
|
+
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
12
|
+
* for the specific language governing rights and limitations under the
|
13
|
+
* License.
|
14
|
+
*
|
15
|
+
* The Original Code is Ajax.org Code Editor (ACE).
|
16
|
+
*
|
17
|
+
* The Initial Developer of the Original Code is
|
18
|
+
* Ajax.org B.V.
|
19
|
+
* Portions created by the Initial Developer are Copyright (C) 2010
|
20
|
+
* the Initial Developer. All Rights Reserved.
|
21
|
+
*
|
22
|
+
* Contributor(s):
|
23
|
+
* Fabian Jakobs <fabian AT ajax DOT org>
|
24
|
+
* Mihai Sucan <mihai DOT sucan AT gmail DOT com>
|
25
|
+
* Chris Spencer <chris.ag.spencer AT googlemail DOT com>
|
26
|
+
*
|
27
|
+
* Alternatively, the contents of this file may be used under the terms of
|
28
|
+
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
29
|
+
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
30
|
+
* in which case the provisions of the GPL or the LGPL are applicable instead
|
31
|
+
* of those above. If you wish to allow use of your version of this file only
|
32
|
+
* under the terms of either the GPL or the LGPL, and not to allow others to
|
33
|
+
* use your version of this file under the terms of the MPL, indicate your
|
34
|
+
* decision by deleting the provisions above and replace them with the notice
|
35
|
+
* and other provisions required by the GPL or the LGPL. If you do not delete
|
36
|
+
* the provisions above, a recipient may use your version of this file under
|
37
|
+
* the terms of any one of the MPL, the GPL or the LGPL.
|
38
|
+
*
|
39
|
+
* ***** END LICENSE BLOCK ***** */
|
40
|
+
|
41
|
+
define('ace/mode/markdown', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/mode/javascript', 'ace/mode/xml', 'ace/mode/html', 'ace/tokenizer', 'ace/mode/markdown_highlight_rules'], function(require, exports, module) {
|
42
|
+
|
43
|
+
|
44
|
+
var oop = require("../lib/oop");
|
45
|
+
var TextMode = require("./text").Mode;
|
46
|
+
var JavaScriptMode = require("./javascript").Mode;
|
47
|
+
var XmlMode = require("./xml").Mode;
|
48
|
+
var HtmlMode = require("./html").Mode;
|
49
|
+
var Tokenizer = require("../tokenizer").Tokenizer;
|
50
|
+
var MarkdownHighlightRules = require("./markdown_highlight_rules").MarkdownHighlightRules;
|
51
|
+
|
52
|
+
var Mode = function() {
|
53
|
+
var highlighter = new MarkdownHighlightRules();
|
54
|
+
|
55
|
+
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
56
|
+
this.$embeds = highlighter.getEmbeds();
|
57
|
+
this.createModeDelegates({
|
58
|
+
"js-": JavaScriptMode,
|
59
|
+
"xml-": XmlMode,
|
60
|
+
"html-": HtmlMode
|
61
|
+
});
|
62
|
+
};
|
63
|
+
oop.inherits(Mode, TextMode);
|
64
|
+
|
65
|
+
(function() {
|
66
|
+
this.getNextLineIndent = function(state, line, tab) {
|
67
|
+
if (state == "listblock") {
|
68
|
+
var match = /^((?:.+)?)([-+*][ ]+)/.exec(line);
|
69
|
+
if (match) {
|
70
|
+
return new Array(match[1].length + 1).join(" ") + match[2];
|
71
|
+
} else {
|
72
|
+
return "";
|
73
|
+
}
|
74
|
+
} else {
|
75
|
+
return this.$getIndent(line);
|
76
|
+
}
|
77
|
+
};
|
78
|
+
}).call(Mode.prototype);
|
79
|
+
|
80
|
+
exports.Mode = Mode;
|
81
|
+
});
|
82
|
+
|
83
|
+
define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) {
|
84
|
+
|
85
|
+
|
86
|
+
var oop = require("../lib/oop");
|
87
|
+
var TextMode = require("./text").Mode;
|
88
|
+
var Tokenizer = require("../tokenizer").Tokenizer;
|
89
|
+
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
|
90
|
+
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
91
|
+
var Range = require("../range").Range;
|
92
|
+
var WorkerClient = require("../worker/worker_client").WorkerClient;
|
93
|
+
var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
|
94
|
+
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
95
|
+
|
96
|
+
var Mode = function() {
|
97
|
+
this.$tokenizer = new Tokenizer(new JavaScriptHighlightRules().getRules());
|
98
|
+
this.$outdent = new MatchingBraceOutdent();
|
99
|
+
this.$behaviour = new CstyleBehaviour();
|
100
|
+
this.foldingRules = new CStyleFoldMode();
|
101
|
+
};
|
102
|
+
oop.inherits(Mode, TextMode);
|
103
|
+
|
104
|
+
(function() {
|
105
|
+
|
106
|
+
|
107
|
+
this.toggleCommentLines = function(state, doc, startRow, endRow) {
|
108
|
+
var outdent = true;
|
109
|
+
var re = /^(\s*)\/\//;
|
110
|
+
|
111
|
+
for (var i=startRow; i<= endRow; i++) {
|
112
|
+
if (!re.test(doc.getLine(i))) {
|
113
|
+
outdent = false;
|
114
|
+
break;
|
115
|
+
}
|
116
|
+
}
|
117
|
+
|
118
|
+
if (outdent) {
|
119
|
+
var deleteRange = new Range(0, 0, 0, 0);
|
120
|
+
for (var i=startRow; i<= endRow; i++)
|
121
|
+
{
|
122
|
+
var line = doc.getLine(i);
|
123
|
+
var m = line.match(re);
|
124
|
+
deleteRange.start.row = i;
|
125
|
+
deleteRange.end.row = i;
|
126
|
+
deleteRange.end.column = m[0].length;
|
127
|
+
doc.replace(deleteRange, m[1]);
|
128
|
+
}
|
129
|
+
}
|
130
|
+
else {
|
131
|
+
doc.indentRows(startRow, endRow, "//");
|
132
|
+
}
|
133
|
+
};
|
134
|
+
|
135
|
+
this.getNextLineIndent = function(state, line, tab) {
|
136
|
+
var indent = this.$getIndent(line);
|
137
|
+
|
138
|
+
var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
|
139
|
+
var tokens = tokenizedLine.tokens;
|
140
|
+
var endState = tokenizedLine.state;
|
141
|
+
|
142
|
+
if (tokens.length && tokens[tokens.length-1].type == "comment") {
|
143
|
+
return indent;
|
144
|
+
}
|
145
|
+
|
146
|
+
if (state == "start" || state == "regex_allowed") {
|
147
|
+
var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
|
148
|
+
if (match) {
|
149
|
+
indent += tab;
|
150
|
+
}
|
151
|
+
} else if (state == "doc-start") {
|
152
|
+
if (endState == "start" || state == "regex_allowed") {
|
153
|
+
return "";
|
154
|
+
}
|
155
|
+
var match = line.match(/^\s*(\/?)\*/);
|
156
|
+
if (match) {
|
157
|
+
if (match[1]) {
|
158
|
+
indent += " ";
|
159
|
+
}
|
160
|
+
indent += "* ";
|
161
|
+
}
|
162
|
+
}
|
163
|
+
|
164
|
+
return indent;
|
165
|
+
};
|
166
|
+
|
167
|
+
this.checkOutdent = function(state, line, input) {
|
168
|
+
return this.$outdent.checkOutdent(line, input);
|
169
|
+
};
|
170
|
+
|
171
|
+
this.autoOutdent = function(state, doc, row) {
|
172
|
+
this.$outdent.autoOutdent(doc, row);
|
173
|
+
};
|
174
|
+
|
175
|
+
this.createWorker = function(session) {
|
176
|
+
var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
|
177
|
+
worker.attachToDocument(session.getDocument());
|
178
|
+
|
179
|
+
worker.on("jslint", function(results) {
|
180
|
+
var errors = [];
|
181
|
+
for (var i=0; i<results.data.length; i++) {
|
182
|
+
var error = results.data[i];
|
183
|
+
if (error)
|
184
|
+
errors.push({
|
185
|
+
row: error.line-1,
|
186
|
+
column: error.character-1,
|
187
|
+
text: error.reason,
|
188
|
+
type: "warning",
|
189
|
+
lint: error
|
190
|
+
});
|
191
|
+
}
|
192
|
+
session.setAnnotations(errors);
|
193
|
+
});
|
194
|
+
|
195
|
+
worker.on("narcissus", function(e) {
|
196
|
+
session.setAnnotations([e.data]);
|
197
|
+
});
|
198
|
+
|
199
|
+
worker.on("terminate", function() {
|
200
|
+
session.clearAnnotations();
|
201
|
+
});
|
202
|
+
|
203
|
+
return worker;
|
204
|
+
};
|
205
|
+
|
206
|
+
}).call(Mode.prototype);
|
207
|
+
|
208
|
+
exports.Mode = Mode;
|
209
|
+
});
|
210
|
+
|
211
|
+
define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/unicode', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
|
212
|
+
|
213
|
+
|
214
|
+
var oop = require("../lib/oop");
|
215
|
+
var lang = require("../lib/lang");
|
216
|
+
var unicode = require("../unicode");
|
217
|
+
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
|
218
|
+
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
219
|
+
|
220
|
+
var JavaScriptHighlightRules = function() {
|
221
|
+
|
222
|
+
// see: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects
|
223
|
+
var globals = lang.arrayToMap(
|
224
|
+
// Constructors
|
225
|
+
("Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" +
|
226
|
+
// E4X
|
227
|
+
"Namespace|QName|XML|XMLList|" +
|
228
|
+
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
|
229
|
+
"Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
|
230
|
+
// Errors
|
231
|
+
"Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" +
|
232
|
+
"SyntaxError|TypeError|URIError|" +
|
233
|
+
// Non-constructor functions
|
234
|
+
"decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" +
|
235
|
+
"isNaN|parseFloat|parseInt|" +
|
236
|
+
// Other
|
237
|
+
"JSON|Math|" +
|
238
|
+
// Pseudo
|
239
|
+
"this|arguments|prototype|window|document"
|
240
|
+
).split("|")
|
241
|
+
);
|
242
|
+
|
243
|
+
var keywords = lang.arrayToMap(
|
244
|
+
("break|case|catch|continue|default|delete|do|else|finally|for|function|" +
|
245
|
+
"if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|" +
|
246
|
+
"const|yield|import|get|set").split("|")
|
247
|
+
);
|
248
|
+
|
249
|
+
// keywords which can be followed by regular expressions
|
250
|
+
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield";
|
251
|
+
|
252
|
+
var deprecated = lang.arrayToMap(
|
253
|
+
("__parent__|__count__|escape|unescape|with|__proto__").split("|")
|
254
|
+
);
|
255
|
+
|
256
|
+
var definitions = lang.arrayToMap(("const|let|var|function").split("|"));
|
257
|
+
|
258
|
+
var buildinConstants = lang.arrayToMap(
|
259
|
+
("null|Infinity|NaN|undefined").split("|")
|
260
|
+
);
|
261
|
+
|
262
|
+
var futureReserved = lang.arrayToMap(
|
263
|
+
("class|enum|extends|super|export|implements|private|" +
|
264
|
+
"public|interface|package|protected|static").split("|")
|
265
|
+
);
|
266
|
+
|
267
|
+
// TODO: Unicode escape sequences
|
268
|
+
var identifierRe = "[" + unicode.packages.L + "\\$_]["
|
269
|
+
+ unicode.packages.L
|
270
|
+
+ unicode.packages.Mn + unicode.packages.Mc
|
271
|
+
+ unicode.packages.Nd
|
272
|
+
+ unicode.packages.Pc + "\\$_]*\\b";
|
273
|
+
|
274
|
+
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
|
275
|
+
"u[0-9a-fA-F]{4}|" + // unicode
|
276
|
+
"[0-2][0-7]{0,2}|" + // oct
|
277
|
+
"3[0-6][0-7]?|" + // oct
|
278
|
+
"37[0-7]?|" + // oct
|
279
|
+
"[4-7][0-7]?|" + //oct
|
280
|
+
".)";
|
281
|
+
|
282
|
+
// regexp must not have capturing parentheses. Use (?:) instead.
|
283
|
+
// regexps are ordered -> the first match is used
|
284
|
+
|
285
|
+
this.$rules = {
|
286
|
+
"start" : [
|
287
|
+
{
|
288
|
+
token : "comment",
|
289
|
+
regex : /\/\/.*$/
|
290
|
+
},
|
291
|
+
DocCommentHighlightRules.getStartRule("doc-start"),
|
292
|
+
{
|
293
|
+
token : "comment", // multi line comment
|
294
|
+
merge : true,
|
295
|
+
regex : /\/\*/,
|
296
|
+
next : "comment"
|
297
|
+
}, {
|
298
|
+
token : "string",
|
299
|
+
regex : "'(?=.)",
|
300
|
+
next : "qstring"
|
301
|
+
}, {
|
302
|
+
token : "string",
|
303
|
+
regex : '"(?=.)',
|
304
|
+
next : "qqstring"
|
305
|
+
}, {
|
306
|
+
token : "constant.numeric", // hex
|
307
|
+
regex : /0[xX][0-9a-fA-F]+\b/
|
308
|
+
}, {
|
309
|
+
token : "constant.numeric", // float
|
310
|
+
regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
|
311
|
+
}, { // match stuff like: Sound.prototype.play = function() { }
|
312
|
+
token : [
|
313
|
+
"storage.type",
|
314
|
+
"punctuation.operator",
|
315
|
+
"support.function",
|
316
|
+
"punctuation.operator",
|
317
|
+
"entity.name.function",
|
318
|
+
"text",
|
319
|
+
"keyword.operator",
|
320
|
+
"text",
|
321
|
+
"storage.type",
|
322
|
+
"text",
|
323
|
+
"paren.lparen"
|
324
|
+
],
|
325
|
+
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
|
326
|
+
next: "function_arguments"
|
327
|
+
}, { // match stuff like: Sound.prototype.play = myfunc
|
328
|
+
token : [
|
329
|
+
"storage.type",
|
330
|
+
"punctuation.operator",
|
331
|
+
"support.function",
|
332
|
+
"punctuation.operator",
|
333
|
+
"entity.name.function",
|
334
|
+
"text",
|
335
|
+
"keyword.operator",
|
336
|
+
"text"
|
337
|
+
],
|
338
|
+
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
|
339
|
+
next: "function_arguments"
|
340
|
+
}, { // match stuff like: Sound.play = function() { }
|
341
|
+
token : [
|
342
|
+
"storage.type",
|
343
|
+
"punctuation.operator",
|
344
|
+
"entity.name.function",
|
345
|
+
"text",
|
346
|
+
"keyword.operator",
|
347
|
+
"text",
|
348
|
+
"storage.type",
|
349
|
+
"text",
|
350
|
+
"paren.lparen"
|
351
|
+
],
|
352
|
+
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
|
353
|
+
next: "function_arguments"
|
354
|
+
}, { // match stuff like: play = function() { }
|
355
|
+
token : [
|
356
|
+
"entity.name.function",
|
357
|
+
"text",
|
358
|
+
"keyword.operator",
|
359
|
+
"text",
|
360
|
+
"storage.type",
|
361
|
+
"text",
|
362
|
+
"paren.lparen"
|
363
|
+
],
|
364
|
+
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
|
365
|
+
next: "function_arguments"
|
366
|
+
}, { // match stuff like: Sound.play = function play() { }
|
367
|
+
token : [
|
368
|
+
"storage.type",
|
369
|
+
"punctuation.operator",
|
370
|
+
"entity.name.function",
|
371
|
+
"text",
|
372
|
+
"keyword.operator",
|
373
|
+
"text",
|
374
|
+
"storage.type",
|
375
|
+
"text",
|
376
|
+
"entity.name.function",
|
377
|
+
"text",
|
378
|
+
"paren.lparen"
|
379
|
+
],
|
380
|
+
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
|
381
|
+
next: "function_arguments"
|
382
|
+
}, { // match regular function like: function myFunc(arg) { }
|
383
|
+
token : [
|
384
|
+
"storage.type",
|
385
|
+
"text",
|
386
|
+
"entity.name.function",
|
387
|
+
"text",
|
388
|
+
"paren.lparen"
|
389
|
+
],
|
390
|
+
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
|
391
|
+
next: "function_arguments"
|
392
|
+
}, { // match stuff like: foobar: function() { }
|
393
|
+
token : [
|
394
|
+
"entity.name.function",
|
395
|
+
"text",
|
396
|
+
"punctuation.operator",
|
397
|
+
"text",
|
398
|
+
"storage.type",
|
399
|
+
"text",
|
400
|
+
"paren.lparen"
|
401
|
+
],
|
402
|
+
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
|
403
|
+
next: "function_arguments"
|
404
|
+
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
|
405
|
+
token : [
|
406
|
+
"text",
|
407
|
+
"text",
|
408
|
+
"storage.type",
|
409
|
+
"text",
|
410
|
+
"paren.lparen"
|
411
|
+
],
|
412
|
+
regex : "(:)(\\s*)(function)(\\s*)(\\()",
|
413
|
+
next: "function_arguments"
|
414
|
+
}, {
|
415
|
+
token : "constant.language.boolean",
|
416
|
+
regex : /(?:true|false)\b/
|
417
|
+
}, {
|
418
|
+
token : "keyword",
|
419
|
+
regex : "(?:" + kwBeforeRe + ")\\b",
|
420
|
+
next : "regex_allowed"
|
421
|
+
}, {
|
422
|
+
token : ["punctuation.operator", "support.function"],
|
423
|
+
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|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(?=\()/
|
424
|
+
}, {
|
425
|
+
token : ["punctuation.operator", "support.function.dom"],
|
426
|
+
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)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
|
427
|
+
}, {
|
428
|
+
token : ["punctuation.operator", "support.constant"],
|
429
|
+
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/
|
430
|
+
}, {
|
431
|
+
token : ["storage.type", "punctuation.operator", "support.function.firebug"],
|
432
|
+
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
|
433
|
+
}, {
|
434
|
+
token : function(value) {
|
435
|
+
if (globals.hasOwnProperty(value))
|
436
|
+
return "variable.language";
|
437
|
+
else if (deprecated.hasOwnProperty(value))
|
438
|
+
return "invalid.deprecated";
|
439
|
+
else if (definitions.hasOwnProperty(value))
|
440
|
+
return "storage.type";
|
441
|
+
else if (keywords.hasOwnProperty(value))
|
442
|
+
return "keyword";
|
443
|
+
else if (buildinConstants.hasOwnProperty(value))
|
444
|
+
return "constant.language";
|
445
|
+
else if (futureReserved.hasOwnProperty(value))
|
446
|
+
return "invalid.illegal";
|
447
|
+
else if (value == "debugger")
|
448
|
+
return "invalid.deprecated";
|
449
|
+
else
|
450
|
+
return "identifier";
|
451
|
+
},
|
452
|
+
regex : identifierRe
|
453
|
+
}, {
|
454
|
+
token : "keyword.operator",
|
455
|
+
regex : /!|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=|\b(?:in|instanceof|new|delete|typeof|void)/,
|
456
|
+
next : "regex_allowed"
|
457
|
+
}, {
|
458
|
+
token : "punctuation.operator",
|
459
|
+
regex : /\?|\:|\,|\;|\./,
|
460
|
+
next : "regex_allowed"
|
461
|
+
}, {
|
462
|
+
token : "paren.lparen",
|
463
|
+
regex : /[\[({]/,
|
464
|
+
next : "regex_allowed"
|
465
|
+
}, {
|
466
|
+
token : "paren.rparen",
|
467
|
+
regex : /[\])}]/
|
468
|
+
}, {
|
469
|
+
token : "keyword.operator",
|
470
|
+
regex : /\/=?/,
|
471
|
+
next : "regex_allowed"
|
472
|
+
}, {
|
473
|
+
token: "comment",
|
474
|
+
regex: /^#!.*$/
|
475
|
+
}, {
|
476
|
+
token : "text",
|
477
|
+
regex : /\s+/
|
478
|
+
}
|
479
|
+
],
|
480
|
+
// regular expressions are only allowed after certain tokens. This
|
481
|
+
// makes sure we don't mix up regexps with the divison operator
|
482
|
+
"regex_allowed": [
|
483
|
+
DocCommentHighlightRules.getStartRule("doc-start"),
|
484
|
+
{
|
485
|
+
token : "comment", // multi line comment
|
486
|
+
merge : true,
|
487
|
+
regex : "\\/\\*",
|
488
|
+
next : "comment_regex_allowed"
|
489
|
+
}, {
|
490
|
+
token : "comment",
|
491
|
+
regex : "\\/\\/.*$"
|
492
|
+
}, {
|
493
|
+
token: "string.regexp",
|
494
|
+
regex: "\\/",
|
495
|
+
next: "regex",
|
496
|
+
merge: true
|
497
|
+
}, {
|
498
|
+
token : "text",
|
499
|
+
regex : "\\s+"
|
500
|
+
}, {
|
501
|
+
// immediately return to the start mode without matching
|
502
|
+
// anything
|
503
|
+
token: "empty",
|
504
|
+
regex: "",
|
505
|
+
next: "start"
|
506
|
+
}
|
507
|
+
],
|
508
|
+
"regex": [
|
509
|
+
{
|
510
|
+
token: "regexp.keyword.operator",
|
511
|
+
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
|
512
|
+
}, {
|
513
|
+
// flag
|
514
|
+
token: "string.regexp",
|
515
|
+
regex: "/\\w*",
|
516
|
+
next: "start",
|
517
|
+
merge: true
|
518
|
+
}, {
|
519
|
+
token: "string.regexp",
|
520
|
+
regex: "[^\\\\/\\[]+",
|
521
|
+
merge: true
|
522
|
+
}, {
|
523
|
+
token: "string.regexp.charachterclass",
|
524
|
+
regex: "\\[",
|
525
|
+
next: "regex_character_class",
|
526
|
+
merge: true
|
527
|
+
}, {
|
528
|
+
token: "empty",
|
529
|
+
regex: "",
|
530
|
+
next: "start"
|
531
|
+
}
|
532
|
+
],
|
533
|
+
"regex_character_class": [
|
534
|
+
{
|
535
|
+
token: "regexp.keyword.operator",
|
536
|
+
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
|
537
|
+
}, {
|
538
|
+
token: "string.regexp.charachterclass",
|
539
|
+
regex: "]",
|
540
|
+
next: "regex",
|
541
|
+
merge: true
|
542
|
+
}, {
|
543
|
+
token: "string.regexp.charachterclass",
|
544
|
+
regex: "[^\\\\\\]]+",
|
545
|
+
merge: true
|
546
|
+
}, {
|
547
|
+
token: "empty",
|
548
|
+
regex: "",
|
549
|
+
next: "start"
|
550
|
+
}
|
551
|
+
],
|
552
|
+
"function_arguments": [
|
553
|
+
{
|
554
|
+
token: "variable.parameter",
|
555
|
+
regex: identifierRe
|
556
|
+
}, {
|
557
|
+
token: "punctuation.operator",
|
558
|
+
regex: "[, ]+",
|
559
|
+
merge: true
|
560
|
+
}, {
|
561
|
+
token: "punctuation.operator",
|
562
|
+
regex: "$",
|
563
|
+
merge: true
|
564
|
+
}, {
|
565
|
+
token: "empty",
|
566
|
+
regex: "",
|
567
|
+
next: "start"
|
568
|
+
}
|
569
|
+
],
|
570
|
+
"comment_regex_allowed" : [
|
571
|
+
{
|
572
|
+
token : "comment", // closing comment
|
573
|
+
regex : ".*?\\*\\/",
|
574
|
+
merge : true,
|
575
|
+
next : "regex_allowed"
|
576
|
+
}, {
|
577
|
+
token : "comment", // comment spanning whole line
|
578
|
+
merge : true,
|
579
|
+
regex : ".+"
|
580
|
+
}
|
581
|
+
],
|
582
|
+
"comment" : [
|
583
|
+
{
|
584
|
+
token : "comment", // closing comment
|
585
|
+
regex : ".*?\\*\\/",
|
586
|
+
merge : true,
|
587
|
+
next : "start"
|
588
|
+
}, {
|
589
|
+
token : "comment", // comment spanning whole line
|
590
|
+
merge : true,
|
591
|
+
regex : ".+"
|
592
|
+
}
|
593
|
+
],
|
594
|
+
"qqstring" : [
|
595
|
+
{
|
596
|
+
token : "constant.language.escape",
|
597
|
+
regex : escapedRe
|
598
|
+
}, {
|
599
|
+
token : "string",
|
600
|
+
regex : '[^"\\\\]+',
|
601
|
+
merge : true
|
602
|
+
}, {
|
603
|
+
token : "string",
|
604
|
+
regex : "\\\\$",
|
605
|
+
next : "qqstring",
|
606
|
+
merge : true
|
607
|
+
}, {
|
608
|
+
token : "string",
|
609
|
+
regex : '"|$',
|
610
|
+
next : "start",
|
611
|
+
merge : true
|
612
|
+
}
|
613
|
+
],
|
614
|
+
"qstring" : [
|
615
|
+
{
|
616
|
+
token : "constant.language.escape",
|
617
|
+
regex : escapedRe
|
618
|
+
}, {
|
619
|
+
token : "string",
|
620
|
+
regex : "[^'\\\\]+",
|
621
|
+
merge : true
|
622
|
+
}, {
|
623
|
+
token : "string",
|
624
|
+
regex : "\\\\$",
|
625
|
+
next : "qstring",
|
626
|
+
merge : true
|
627
|
+
}, {
|
628
|
+
token : "string",
|
629
|
+
regex : "'|$",
|
630
|
+
next : "start",
|
631
|
+
merge : true
|
632
|
+
}
|
633
|
+
]
|
634
|
+
};
|
635
|
+
|
636
|
+
this.embedRules(DocCommentHighlightRules, "doc-",
|
637
|
+
[ DocCommentHighlightRules.getEndRule("start") ]);
|
638
|
+
};
|
639
|
+
|
640
|
+
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
|
641
|
+
|
642
|
+
exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
|
643
|
+
});
|
644
|
+
|
645
|
+
define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
|
646
|
+
|
647
|
+
|
648
|
+
var oop = require("../lib/oop");
|
649
|
+
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
650
|
+
|
651
|
+
var DocCommentHighlightRules = function() {
|
652
|
+
|
653
|
+
this.$rules = {
|
654
|
+
"start" : [ {
|
655
|
+
token : "comment.doc.tag",
|
656
|
+
regex : "@[\\w\\d_]+" // TODO: fix email addresses
|
657
|
+
}, {
|
658
|
+
token : "comment.doc",
|
659
|
+
merge : true,
|
660
|
+
regex : "\\s+"
|
661
|
+
}, {
|
662
|
+
token : "comment.doc",
|
663
|
+
merge : true,
|
664
|
+
regex : "TODO"
|
665
|
+
}, {
|
666
|
+
token : "comment.doc",
|
667
|
+
merge : true,
|
668
|
+
regex : "[^@\\*]+"
|
669
|
+
}, {
|
670
|
+
token : "comment.doc",
|
671
|
+
merge : true,
|
672
|
+
regex : "."
|
673
|
+
}]
|
674
|
+
};
|
675
|
+
};
|
676
|
+
|
677
|
+
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
|
678
|
+
|
679
|
+
DocCommentHighlightRules.getStartRule = function(start) {
|
680
|
+
return {
|
681
|
+
token : "comment.doc", // doc comment
|
682
|
+
merge : true,
|
683
|
+
regex : "\\/\\*(?=\\*)",
|
684
|
+
next : start
|
685
|
+
};
|
686
|
+
};
|
687
|
+
|
688
|
+
DocCommentHighlightRules.getEndRule = function (start) {
|
689
|
+
return {
|
690
|
+
token : "comment.doc", // closing comment
|
691
|
+
merge : true,
|
692
|
+
regex : "\\*\\/",
|
693
|
+
next : start
|
694
|
+
};
|
695
|
+
};
|
696
|
+
|
697
|
+
|
698
|
+
exports.DocCommentHighlightRules = DocCommentHighlightRules;
|
699
|
+
|
700
|
+
});
|
701
|
+
|
702
|
+
define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
|
703
|
+
|
704
|
+
|
705
|
+
var Range = require("../range").Range;
|
706
|
+
|
707
|
+
var MatchingBraceOutdent = function() {};
|
708
|
+
|
709
|
+
(function() {
|
710
|
+
|
711
|
+
this.checkOutdent = function(line, input) {
|
712
|
+
if (! /^\s+$/.test(line))
|
713
|
+
return false;
|
714
|
+
|
715
|
+
return /^\s*\}/.test(input);
|
716
|
+
};
|
717
|
+
|
718
|
+
this.autoOutdent = function(doc, row) {
|
719
|
+
var line = doc.getLine(row);
|
720
|
+
var match = line.match(/^(\s*\})/);
|
721
|
+
|
722
|
+
if (!match) return 0;
|
723
|
+
|
724
|
+
var column = match[1].length;
|
725
|
+
var openBracePos = doc.findMatchingBracket({row: row, column: column});
|
726
|
+
|
727
|
+
if (!openBracePos || openBracePos.row == row) return 0;
|
728
|
+
|
729
|
+
var indent = this.$getIndent(doc.getLine(openBracePos.row));
|
730
|
+
doc.replace(new Range(row, 0, row, column-1), indent);
|
731
|
+
};
|
732
|
+
|
733
|
+
this.$getIndent = function(line) {
|
734
|
+
var match = line.match(/^(\s+)/);
|
735
|
+
if (match) {
|
736
|
+
return match[1];
|
737
|
+
}
|
738
|
+
|
739
|
+
return "";
|
740
|
+
};
|
741
|
+
|
742
|
+
}).call(MatchingBraceOutdent.prototype);
|
743
|
+
|
744
|
+
exports.MatchingBraceOutdent = MatchingBraceOutdent;
|
745
|
+
});
|
746
|
+
|
747
|
+
define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
|
748
|
+
|
749
|
+
|
750
|
+
var oop = require("../../lib/oop");
|
751
|
+
var Behaviour = require("../behaviour").Behaviour;
|
752
|
+
|
753
|
+
var CstyleBehaviour = function () {
|
754
|
+
|
755
|
+
this.add("braces", "insertion", function (state, action, editor, session, text) {
|
756
|
+
if (text == '{') {
|
757
|
+
var selection = editor.getSelectionRange();
|
758
|
+
var selected = session.doc.getTextRange(selection);
|
759
|
+
if (selected !== "") {
|
760
|
+
return {
|
761
|
+
text: '{' + selected + '}',
|
762
|
+
selection: false
|
763
|
+
};
|
764
|
+
} else {
|
765
|
+
return {
|
766
|
+
text: '{}',
|
767
|
+
selection: [1, 1]
|
768
|
+
};
|
769
|
+
}
|
770
|
+
} else if (text == '}') {
|
771
|
+
var cursor = editor.getCursorPosition();
|
772
|
+
var line = session.doc.getLine(cursor.row);
|
773
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
774
|
+
if (rightChar == '}') {
|
775
|
+
var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
|
776
|
+
if (matching !== null) {
|
777
|
+
return {
|
778
|
+
text: '',
|
779
|
+
selection: [1, 1]
|
780
|
+
};
|
781
|
+
}
|
782
|
+
}
|
783
|
+
} else if (text == "\n") {
|
784
|
+
var cursor = editor.getCursorPosition();
|
785
|
+
var line = session.doc.getLine(cursor.row);
|
786
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
787
|
+
if (rightChar == '}') {
|
788
|
+
var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
|
789
|
+
if (!openBracePos)
|
790
|
+
return null;
|
791
|
+
|
792
|
+
var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
|
793
|
+
var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
|
794
|
+
|
795
|
+
return {
|
796
|
+
text: '\n' + indent + '\n' + next_indent,
|
797
|
+
selection: [1, indent.length, 1, indent.length]
|
798
|
+
};
|
799
|
+
}
|
800
|
+
}
|
801
|
+
});
|
802
|
+
|
803
|
+
this.add("braces", "deletion", function (state, action, editor, session, range) {
|
804
|
+
var selected = session.doc.getTextRange(range);
|
805
|
+
if (!range.isMultiLine() && selected == '{') {
|
806
|
+
var line = session.doc.getLine(range.start.row);
|
807
|
+
var rightChar = line.substring(range.end.column, range.end.column + 1);
|
808
|
+
if (rightChar == '}') {
|
809
|
+
range.end.column++;
|
810
|
+
return range;
|
811
|
+
}
|
812
|
+
}
|
813
|
+
});
|
814
|
+
|
815
|
+
this.add("parens", "insertion", function (state, action, editor, session, text) {
|
816
|
+
if (text == '(') {
|
817
|
+
var selection = editor.getSelectionRange();
|
818
|
+
var selected = session.doc.getTextRange(selection);
|
819
|
+
if (selected !== "") {
|
820
|
+
return {
|
821
|
+
text: '(' + selected + ')',
|
822
|
+
selection: false
|
823
|
+
};
|
824
|
+
} else {
|
825
|
+
return {
|
826
|
+
text: '()',
|
827
|
+
selection: [1, 1]
|
828
|
+
};
|
829
|
+
}
|
830
|
+
} else if (text == ')') {
|
831
|
+
var cursor = editor.getCursorPosition();
|
832
|
+
var line = session.doc.getLine(cursor.row);
|
833
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
834
|
+
if (rightChar == ')') {
|
835
|
+
var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
|
836
|
+
if (matching !== null) {
|
837
|
+
return {
|
838
|
+
text: '',
|
839
|
+
selection: [1, 1]
|
840
|
+
};
|
841
|
+
}
|
842
|
+
}
|
843
|
+
}
|
844
|
+
});
|
845
|
+
|
846
|
+
this.add("parens", "deletion", function (state, action, editor, session, range) {
|
847
|
+
var selected = session.doc.getTextRange(range);
|
848
|
+
if (!range.isMultiLine() && selected == '(') {
|
849
|
+
var line = session.doc.getLine(range.start.row);
|
850
|
+
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
|
851
|
+
if (rightChar == ')') {
|
852
|
+
range.end.column++;
|
853
|
+
return range;
|
854
|
+
}
|
855
|
+
}
|
856
|
+
});
|
857
|
+
|
858
|
+
this.add("brackets", "insertion", function (state, action, editor, session, text) {
|
859
|
+
if (text == '[') {
|
860
|
+
var selection = editor.getSelectionRange();
|
861
|
+
var selected = session.doc.getTextRange(selection);
|
862
|
+
if (selected !== "") {
|
863
|
+
return {
|
864
|
+
text: '[' + selected + ']',
|
865
|
+
selection: false
|
866
|
+
};
|
867
|
+
} else {
|
868
|
+
return {
|
869
|
+
text: '[]',
|
870
|
+
selection: [1, 1]
|
871
|
+
};
|
872
|
+
}
|
873
|
+
} else if (text == ']') {
|
874
|
+
var cursor = editor.getCursorPosition();
|
875
|
+
var line = session.doc.getLine(cursor.row);
|
876
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
877
|
+
if (rightChar == ']') {
|
878
|
+
var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row});
|
879
|
+
if (matching !== null) {
|
880
|
+
return {
|
881
|
+
text: '',
|
882
|
+
selection: [1, 1]
|
883
|
+
};
|
884
|
+
}
|
885
|
+
}
|
886
|
+
}
|
887
|
+
});
|
888
|
+
|
889
|
+
this.add("brackets", "deletion", function (state, action, editor, session, range) {
|
890
|
+
var selected = session.doc.getTextRange(range);
|
891
|
+
if (!range.isMultiLine() && selected == '[') {
|
892
|
+
var line = session.doc.getLine(range.start.row);
|
893
|
+
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
|
894
|
+
if (rightChar == ']') {
|
895
|
+
range.end.column++;
|
896
|
+
return range;
|
897
|
+
}
|
898
|
+
}
|
899
|
+
});
|
900
|
+
|
901
|
+
this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
|
902
|
+
if (text == '"' || text == "'") {
|
903
|
+
var quote = text;
|
904
|
+
var selection = editor.getSelectionRange();
|
905
|
+
var selected = session.doc.getTextRange(selection);
|
906
|
+
if (selected !== "") {
|
907
|
+
return {
|
908
|
+
text: quote + selected + quote,
|
909
|
+
selection: false
|
910
|
+
};
|
911
|
+
} else {
|
912
|
+
var cursor = editor.getCursorPosition();
|
913
|
+
var line = session.doc.getLine(cursor.row);
|
914
|
+
var leftChar = line.substring(cursor.column-1, cursor.column);
|
915
|
+
|
916
|
+
// We're escaped.
|
917
|
+
if (leftChar == '\\') {
|
918
|
+
return null;
|
919
|
+
}
|
920
|
+
|
921
|
+
// Find what token we're inside.
|
922
|
+
var tokens = session.getTokens(selection.start.row);
|
923
|
+
var col = 0, token;
|
924
|
+
var quotepos = -1; // Track whether we're inside an open quote.
|
925
|
+
|
926
|
+
for (var x = 0; x < tokens.length; x++) {
|
927
|
+
token = tokens[x];
|
928
|
+
if (token.type == "string") {
|
929
|
+
quotepos = -1;
|
930
|
+
} else if (quotepos < 0) {
|
931
|
+
quotepos = token.value.indexOf(quote);
|
932
|
+
}
|
933
|
+
if ((token.value.length + col) > selection.start.column) {
|
934
|
+
break;
|
935
|
+
}
|
936
|
+
col += tokens[x].value.length;
|
937
|
+
}
|
938
|
+
|
939
|
+
// Try and be smart about when we auto insert.
|
940
|
+
if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) {
|
941
|
+
return {
|
942
|
+
text: quote + quote,
|
943
|
+
selection: [1,1]
|
944
|
+
};
|
945
|
+
} else if (token && token.type === "string") {
|
946
|
+
// Ignore input and move right one if we're typing over the closing quote.
|
947
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
948
|
+
if (rightChar == quote) {
|
949
|
+
return {
|
950
|
+
text: '',
|
951
|
+
selection: [1, 1]
|
952
|
+
};
|
953
|
+
}
|
954
|
+
}
|
955
|
+
}
|
956
|
+
}
|
957
|
+
});
|
958
|
+
|
959
|
+
this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
|
960
|
+
var selected = session.doc.getTextRange(range);
|
961
|
+
if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
|
962
|
+
var line = session.doc.getLine(range.start.row);
|
963
|
+
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
|
964
|
+
if (rightChar == '"') {
|
965
|
+
range.end.column++;
|
966
|
+
return range;
|
967
|
+
}
|
968
|
+
}
|
969
|
+
});
|
970
|
+
|
971
|
+
};
|
972
|
+
|
973
|
+
oop.inherits(CstyleBehaviour, Behaviour);
|
974
|
+
|
975
|
+
exports.CstyleBehaviour = CstyleBehaviour;
|
976
|
+
});
|
977
|
+
|
978
|
+
define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
|
979
|
+
|
980
|
+
|
981
|
+
var oop = require("../../lib/oop");
|
982
|
+
var Range = require("../../range").Range;
|
983
|
+
var BaseFoldMode = require("./fold_mode").FoldMode;
|
984
|
+
|
985
|
+
var FoldMode = exports.FoldMode = function() {};
|
986
|
+
oop.inherits(FoldMode, BaseFoldMode);
|
987
|
+
|
988
|
+
(function() {
|
989
|
+
|
990
|
+
this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
|
991
|
+
this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
|
992
|
+
|
993
|
+
this.getFoldWidgetRange = function(session, foldStyle, row) {
|
994
|
+
var line = session.getLine(row);
|
995
|
+
var match = line.match(this.foldingStartMarker);
|
996
|
+
if (match) {
|
997
|
+
var i = match.index;
|
998
|
+
|
999
|
+
if (match[1])
|
1000
|
+
return this.openingBracketBlock(session, match[1], row, i);
|
1001
|
+
|
1002
|
+
var range = session.getCommentFoldRange(row, i + match[0].length);
|
1003
|
+
range.end.column -= 2;
|
1004
|
+
return range;
|
1005
|
+
}
|
1006
|
+
|
1007
|
+
if (foldStyle !== "markbeginend")
|
1008
|
+
return;
|
1009
|
+
|
1010
|
+
var match = line.match(this.foldingStopMarker);
|
1011
|
+
if (match) {
|
1012
|
+
var i = match.index + match[0].length;
|
1013
|
+
|
1014
|
+
if (match[2]) {
|
1015
|
+
var range = session.getCommentFoldRange(row, i);
|
1016
|
+
range.end.column -= 2;
|
1017
|
+
return range;
|
1018
|
+
}
|
1019
|
+
|
1020
|
+
var end = {row: row, column: i};
|
1021
|
+
var start = session.$findOpeningBracket(match[1], end);
|
1022
|
+
|
1023
|
+
if (!start)
|
1024
|
+
return;
|
1025
|
+
|
1026
|
+
start.column++;
|
1027
|
+
end.column--;
|
1028
|
+
|
1029
|
+
return Range.fromPoints(start, end);
|
1030
|
+
}
|
1031
|
+
};
|
1032
|
+
|
1033
|
+
}).call(FoldMode.prototype);
|
1034
|
+
|
1035
|
+
});
|
1036
|
+
|
1037
|
+
define('ace/mode/folding/fold_mode', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
|
1038
|
+
|
1039
|
+
|
1040
|
+
var Range = require("../../range").Range;
|
1041
|
+
|
1042
|
+
var FoldMode = exports.FoldMode = function() {};
|
1043
|
+
|
1044
|
+
(function() {
|
1045
|
+
|
1046
|
+
this.foldingStartMarker = null;
|
1047
|
+
this.foldingStopMarker = null;
|
1048
|
+
|
1049
|
+
// must return "" if there's no fold, to enable caching
|
1050
|
+
this.getFoldWidget = function(session, foldStyle, row) {
|
1051
|
+
var line = session.getLine(row);
|
1052
|
+
if (this.foldingStartMarker.test(line))
|
1053
|
+
return "start";
|
1054
|
+
if (foldStyle == "markbeginend"
|
1055
|
+
&& this.foldingStopMarker
|
1056
|
+
&& this.foldingStopMarker.test(line))
|
1057
|
+
return "end";
|
1058
|
+
return "";
|
1059
|
+
};
|
1060
|
+
|
1061
|
+
this.getFoldWidgetRange = function(session, foldStyle, row) {
|
1062
|
+
return null;
|
1063
|
+
};
|
1064
|
+
|
1065
|
+
this.indentationBlock = function(session, row, column) {
|
1066
|
+
var re = /\S/;
|
1067
|
+
var line = session.getLine(row);
|
1068
|
+
var startLevel = line.search(re);
|
1069
|
+
if (startLevel == -1)
|
1070
|
+
return;
|
1071
|
+
|
1072
|
+
var startColumn = column || line.length;
|
1073
|
+
var maxRow = session.getLength();
|
1074
|
+
var startRow = row;
|
1075
|
+
var endRow = row;
|
1076
|
+
|
1077
|
+
while (++row < maxRow) {
|
1078
|
+
var level = session.getLine(row).search(re);
|
1079
|
+
|
1080
|
+
if (level == -1)
|
1081
|
+
continue;
|
1082
|
+
|
1083
|
+
if (level <= startLevel)
|
1084
|
+
break;
|
1085
|
+
|
1086
|
+
endRow = row;
|
1087
|
+
}
|
1088
|
+
|
1089
|
+
if (endRow > startRow) {
|
1090
|
+
var endColumn = session.getLine(endRow).length;
|
1091
|
+
return new Range(startRow, startColumn, endRow, endColumn);
|
1092
|
+
}
|
1093
|
+
};
|
1094
|
+
|
1095
|
+
this.openingBracketBlock = function(session, bracket, row, column, typeRe) {
|
1096
|
+
var start = {row: row, column: column + 1};
|
1097
|
+
var end = session.$findClosingBracket(bracket, start, typeRe);
|
1098
|
+
if (!end)
|
1099
|
+
return;
|
1100
|
+
|
1101
|
+
var fw = session.foldWidgets[end.row];
|
1102
|
+
if (fw == null)
|
1103
|
+
fw = this.getFoldWidget(session, end.row);
|
1104
|
+
|
1105
|
+
if (fw == "start" && end.row > start.row) {
|
1106
|
+
end.row --;
|
1107
|
+
end.column = session.getLine(end.row).length;
|
1108
|
+
}
|
1109
|
+
return Range.fromPoints(start, end);
|
1110
|
+
};
|
1111
|
+
|
1112
|
+
}).call(FoldMode.prototype);
|
1113
|
+
|
1114
|
+
});
|
1115
|
+
|
1116
|
+
define('ace/mode/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/xml_highlight_rules', 'ace/mode/behaviour/xml', 'ace/mode/folding/xml'], function(require, exports, module) {
|
1117
|
+
|
1118
|
+
|
1119
|
+
var oop = require("../lib/oop");
|
1120
|
+
var TextMode = require("./text").Mode;
|
1121
|
+
var Tokenizer = require("../tokenizer").Tokenizer;
|
1122
|
+
var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
|
1123
|
+
var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
|
1124
|
+
var XmlFoldMode = require("./folding/xml").FoldMode;
|
1125
|
+
|
1126
|
+
var Mode = function() {
|
1127
|
+
this.$tokenizer = new Tokenizer(new XmlHighlightRules().getRules());
|
1128
|
+
this.$behaviour = new XmlBehaviour();
|
1129
|
+
this.foldingRules = new XmlFoldMode();
|
1130
|
+
};
|
1131
|
+
|
1132
|
+
oop.inherits(Mode, TextMode);
|
1133
|
+
|
1134
|
+
(function() {
|
1135
|
+
|
1136
|
+
this.getNextLineIndent = function(state, line, tab) {
|
1137
|
+
return this.$getIndent(line);
|
1138
|
+
};
|
1139
|
+
|
1140
|
+
}).call(Mode.prototype);
|
1141
|
+
|
1142
|
+
exports.Mode = Mode;
|
1143
|
+
});
|
1144
|
+
|
1145
|
+
define('ace/mode/xml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
|
1146
|
+
|
1147
|
+
|
1148
|
+
var oop = require("../lib/oop");
|
1149
|
+
var xmlUtil = require("./xml_util");
|
1150
|
+
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
1151
|
+
|
1152
|
+
var XmlHighlightRules = function() {
|
1153
|
+
|
1154
|
+
// regexp must not have capturing parentheses
|
1155
|
+
// regexps are ordered -> the first match is used
|
1156
|
+
this.$rules = {
|
1157
|
+
start : [{
|
1158
|
+
token : "text",
|
1159
|
+
regex : "<\\!\\[CDATA\\[",
|
1160
|
+
next : "cdata"
|
1161
|
+
}, {
|
1162
|
+
token : "xml_pe",
|
1163
|
+
regex : "<\\?.*?\\?>"
|
1164
|
+
}, {
|
1165
|
+
token : "comment",
|
1166
|
+
merge : true,
|
1167
|
+
regex : "<\\!--",
|
1168
|
+
next : "comment"
|
1169
|
+
}, {
|
1170
|
+
token : "xml_pe",
|
1171
|
+
regex : "<\\!.*?>"
|
1172
|
+
}, {
|
1173
|
+
token : "meta.tag", // opening tag
|
1174
|
+
regex : "<\\/?",
|
1175
|
+
next : "tag"
|
1176
|
+
}, {
|
1177
|
+
token : "text",
|
1178
|
+
regex : "\\s+"
|
1179
|
+
}, {
|
1180
|
+
token : "constant.character.entity",
|
1181
|
+
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
|
1182
|
+
}, {
|
1183
|
+
token : "text",
|
1184
|
+
regex : "[^<]+"
|
1185
|
+
}],
|
1186
|
+
|
1187
|
+
cdata : [{
|
1188
|
+
token : "text",
|
1189
|
+
regex : "\\]\\]>",
|
1190
|
+
next : "start"
|
1191
|
+
}, {
|
1192
|
+
token : "text",
|
1193
|
+
regex : "\\s+"
|
1194
|
+
}, {
|
1195
|
+
token : "text",
|
1196
|
+
regex : "(?:[^\\]]|\\](?!\\]>))+"
|
1197
|
+
}],
|
1198
|
+
|
1199
|
+
comment : [{
|
1200
|
+
token : "comment",
|
1201
|
+
regex : ".*?-->",
|
1202
|
+
next : "start"
|
1203
|
+
}, {
|
1204
|
+
token : "comment",
|
1205
|
+
merge : true,
|
1206
|
+
regex : ".+"
|
1207
|
+
}]
|
1208
|
+
};
|
1209
|
+
|
1210
|
+
xmlUtil.tag(this.$rules, "tag", "start");
|
1211
|
+
};
|
1212
|
+
|
1213
|
+
oop.inherits(XmlHighlightRules, TextHighlightRules);
|
1214
|
+
|
1215
|
+
exports.XmlHighlightRules = XmlHighlightRules;
|
1216
|
+
});
|
1217
|
+
|
1218
|
+
define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) {
|
1219
|
+
|
1220
|
+
|
1221
|
+
function string(state) {
|
1222
|
+
return [{
|
1223
|
+
token : "string",
|
1224
|
+
regex : '".*?"'
|
1225
|
+
}, {
|
1226
|
+
token : "string", // multi line string start
|
1227
|
+
merge : true,
|
1228
|
+
regex : '["].*',
|
1229
|
+
next : state + "_qqstring"
|
1230
|
+
}, {
|
1231
|
+
token : "string",
|
1232
|
+
regex : "'.*?'"
|
1233
|
+
}, {
|
1234
|
+
token : "string", // multi line string start
|
1235
|
+
merge : true,
|
1236
|
+
regex : "['].*",
|
1237
|
+
next : state + "_qstring"
|
1238
|
+
}];
|
1239
|
+
}
|
1240
|
+
|
1241
|
+
function multiLineString(quote, state) {
|
1242
|
+
return [{
|
1243
|
+
token : "string",
|
1244
|
+
merge : true,
|
1245
|
+
regex : ".*?" + quote,
|
1246
|
+
next : state
|
1247
|
+
}, {
|
1248
|
+
token : "string",
|
1249
|
+
merge : true,
|
1250
|
+
regex : '.+'
|
1251
|
+
}];
|
1252
|
+
}
|
1253
|
+
|
1254
|
+
exports.tag = function(states, name, nextState, tagMap) {
|
1255
|
+
states[name] = [{
|
1256
|
+
token : "text",
|
1257
|
+
regex : "\\s+"
|
1258
|
+
}, {
|
1259
|
+
//token : "meta.tag",
|
1260
|
+
|
1261
|
+
token : !tagMap ? "meta.tag.tag-name" : function(value) {
|
1262
|
+
if (tagMap[value])
|
1263
|
+
return "meta.tag.tag-name." + tagMap[value];
|
1264
|
+
else
|
1265
|
+
return "meta.tag.tag-name";
|
1266
|
+
},
|
1267
|
+
merge : true,
|
1268
|
+
regex : "[-_a-zA-Z0-9:]+",
|
1269
|
+
next : name + "_embed_attribute_list"
|
1270
|
+
}, {
|
1271
|
+
token: "empty",
|
1272
|
+
regex: "",
|
1273
|
+
next : name + "_embed_attribute_list"
|
1274
|
+
}];
|
1275
|
+
|
1276
|
+
states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list");
|
1277
|
+
states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list");
|
1278
|
+
|
1279
|
+
states[name + "_embed_attribute_list"] = [{
|
1280
|
+
token : "meta.tag",
|
1281
|
+
merge : true,
|
1282
|
+
regex : "\/?>",
|
1283
|
+
next : nextState
|
1284
|
+
}, {
|
1285
|
+
token : "keyword.operator",
|
1286
|
+
regex : "="
|
1287
|
+
}, {
|
1288
|
+
token : "entity.other.attribute-name",
|
1289
|
+
regex : "[-_a-zA-Z0-9:]+"
|
1290
|
+
}, {
|
1291
|
+
token : "constant.numeric", // float
|
1292
|
+
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
|
1293
|
+
}, {
|
1294
|
+
token : "text",
|
1295
|
+
regex : "\\s+"
|
1296
|
+
}].concat(string(name));
|
1297
|
+
};
|
1298
|
+
|
1299
|
+
});
|
1300
|
+
|
1301
|
+
define('ace/mode/behaviour/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) {
|
1302
|
+
|
1303
|
+
|
1304
|
+
var oop = require("../../lib/oop");
|
1305
|
+
var Behaviour = require("../behaviour").Behaviour;
|
1306
|
+
var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
|
1307
|
+
var TokenIterator = require("../../token_iterator").TokenIterator;
|
1308
|
+
|
1309
|
+
function hasType(token, type) {
|
1310
|
+
var hasType = true;
|
1311
|
+
var typeList = token.type.split('.');
|
1312
|
+
var needleList = type.split('.');
|
1313
|
+
needleList.forEach(function(needle){
|
1314
|
+
if (typeList.indexOf(needle) == -1) {
|
1315
|
+
hasType = false;
|
1316
|
+
return false;
|
1317
|
+
}
|
1318
|
+
});
|
1319
|
+
return hasType;
|
1320
|
+
}
|
1321
|
+
|
1322
|
+
var XmlBehaviour = function () {
|
1323
|
+
|
1324
|
+
this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour
|
1325
|
+
|
1326
|
+
this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
|
1327
|
+
if (text == '>') {
|
1328
|
+
var position = editor.getCursorPosition();
|
1329
|
+
var iterator = new TokenIterator(session, position.row, position.column);
|
1330
|
+
var token = iterator.getCurrentToken();
|
1331
|
+
var atCursor = false;
|
1332
|
+
if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){
|
1333
|
+
do {
|
1334
|
+
token = iterator.stepBackward();
|
1335
|
+
} while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text')));
|
1336
|
+
} else {
|
1337
|
+
atCursor = true;
|
1338
|
+
}
|
1339
|
+
if (!token || !hasType(token, 'meta.tag-name') || iterator.stepBackward().value.match('/')) {
|
1340
|
+
return
|
1341
|
+
}
|
1342
|
+
var tag = token.value;
|
1343
|
+
if (atCursor){
|
1344
|
+
var tag = tag.substring(0, position.column - token.start);
|
1345
|
+
}
|
1346
|
+
|
1347
|
+
return {
|
1348
|
+
text: '>' + '</' + tag + '>',
|
1349
|
+
selection: [1, 1]
|
1350
|
+
}
|
1351
|
+
}
|
1352
|
+
});
|
1353
|
+
|
1354
|
+
this.add('autoindent', 'insertion', function (state, action, editor, session, text) {
|
1355
|
+
if (text == "\n") {
|
1356
|
+
var cursor = editor.getCursorPosition();
|
1357
|
+
var line = session.doc.getLine(cursor.row);
|
1358
|
+
var rightChars = line.substring(cursor.column, cursor.column + 2);
|
1359
|
+
if (rightChars == '</') {
|
1360
|
+
var indent = this.$getIndent(session.doc.getLine(cursor.row)) + session.getTabString();
|
1361
|
+
var next_indent = this.$getIndent(session.doc.getLine(cursor.row));
|
1362
|
+
|
1363
|
+
return {
|
1364
|
+
text: '\n' + indent + '\n' + next_indent,
|
1365
|
+
selection: [1, indent.length, 1, indent.length]
|
1366
|
+
}
|
1367
|
+
}
|
1368
|
+
}
|
1369
|
+
});
|
1370
|
+
|
1371
|
+
}
|
1372
|
+
oop.inherits(XmlBehaviour, Behaviour);
|
1373
|
+
|
1374
|
+
exports.XmlBehaviour = XmlBehaviour;
|
1375
|
+
});
|
1376
|
+
|
1377
|
+
define('ace/mode/folding/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/range', 'ace/mode/folding/fold_mode', 'ace/token_iterator'], function(require, exports, module) {
|
1378
|
+
|
1379
|
+
|
1380
|
+
var oop = require("../../lib/oop");
|
1381
|
+
var lang = require("../../lib/lang");
|
1382
|
+
var Range = require("../../range").Range;
|
1383
|
+
var BaseFoldMode = require("./fold_mode").FoldMode;
|
1384
|
+
var TokenIterator = require("../../token_iterator").TokenIterator;
|
1385
|
+
|
1386
|
+
var FoldMode = exports.FoldMode = function(voidElements) {
|
1387
|
+
BaseFoldMode.call(this);
|
1388
|
+
this.voidElements = voidElements || {};
|
1389
|
+
};
|
1390
|
+
oop.inherits(FoldMode, BaseFoldMode);
|
1391
|
+
|
1392
|
+
(function() {
|
1393
|
+
|
1394
|
+
this.getFoldWidget = function(session, foldStyle, row) {
|
1395
|
+
var tag = this._getFirstTagInLine(session, row);
|
1396
|
+
|
1397
|
+
if (tag.closing)
|
1398
|
+
return foldStyle == "markbeginend" ? "end" : "";
|
1399
|
+
|
1400
|
+
if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()])
|
1401
|
+
return "";
|
1402
|
+
|
1403
|
+
if (tag.selfClosing)
|
1404
|
+
return "";
|
1405
|
+
|
1406
|
+
if (tag.value.indexOf("/" + tag.tagName) !== -1)
|
1407
|
+
return "";
|
1408
|
+
|
1409
|
+
return "start";
|
1410
|
+
};
|
1411
|
+
|
1412
|
+
this._getFirstTagInLine = function(session, row) {
|
1413
|
+
var tokens = session.getTokens(row);
|
1414
|
+
var value = "";
|
1415
|
+
for (var i = 0; i < tokens.length; i++) {
|
1416
|
+
var token = tokens[i];
|
1417
|
+
if (token.type.indexOf("meta.tag") === 0)
|
1418
|
+
value += token.value;
|
1419
|
+
else
|
1420
|
+
value += lang.stringRepeat(" ", token.value.length);
|
1421
|
+
}
|
1422
|
+
|
1423
|
+
return this._parseTag(value);
|
1424
|
+
};
|
1425
|
+
|
1426
|
+
this.tagRe = /^(\s*)(<?(\/?)([-_a-zA-Z0-9:!]*)\s*(\/?)>?)/;
|
1427
|
+
this._parseTag = function(tag) {
|
1428
|
+
|
1429
|
+
var match = this.tagRe.exec(tag);
|
1430
|
+
var column = this.tagRe.lastIndex || 0;
|
1431
|
+
this.tagRe.lastIndex = 0;
|
1432
|
+
|
1433
|
+
return {
|
1434
|
+
value: tag,
|
1435
|
+
match: match ? match[2] : "",
|
1436
|
+
closing: match ? !!match[3] : false,
|
1437
|
+
selfClosing: match ? !!match[5] || match[2] == "/>" : false,
|
1438
|
+
tagName: match ? match[4] : "",
|
1439
|
+
column: match[1] ? column + match[1].length : column
|
1440
|
+
};
|
1441
|
+
};
|
1442
|
+
this._readTagForward = function(iterator) {
|
1443
|
+
var token = iterator.getCurrentToken();
|
1444
|
+
if (!token)
|
1445
|
+
return null;
|
1446
|
+
|
1447
|
+
var value = "";
|
1448
|
+
var start;
|
1449
|
+
|
1450
|
+
do {
|
1451
|
+
if (token.type.indexOf("meta.tag") === 0) {
|
1452
|
+
if (!start) {
|
1453
|
+
var start = {
|
1454
|
+
row: iterator.getCurrentTokenRow(),
|
1455
|
+
column: iterator.getCurrentTokenColumn()
|
1456
|
+
};
|
1457
|
+
}
|
1458
|
+
value += token.value;
|
1459
|
+
if (value.indexOf(">") !== -1) {
|
1460
|
+
var tag = this._parseTag(value);
|
1461
|
+
tag.start = start;
|
1462
|
+
tag.end = {
|
1463
|
+
row: iterator.getCurrentTokenRow(),
|
1464
|
+
column: iterator.getCurrentTokenColumn() + token.value.length
|
1465
|
+
};
|
1466
|
+
iterator.stepForward();
|
1467
|
+
return tag;
|
1468
|
+
}
|
1469
|
+
}
|
1470
|
+
} while(token = iterator.stepForward());
|
1471
|
+
|
1472
|
+
return null;
|
1473
|
+
};
|
1474
|
+
|
1475
|
+
this._readTagBackward = function(iterator) {
|
1476
|
+
var token = iterator.getCurrentToken();
|
1477
|
+
if (!token)
|
1478
|
+
return null;
|
1479
|
+
|
1480
|
+
var value = "";
|
1481
|
+
var end;
|
1482
|
+
|
1483
|
+
do {
|
1484
|
+
if (token.type.indexOf("meta.tag") === 0) {
|
1485
|
+
if (!end) {
|
1486
|
+
end = {
|
1487
|
+
row: iterator.getCurrentTokenRow(),
|
1488
|
+
column: iterator.getCurrentTokenColumn() + token.value.length
|
1489
|
+
};
|
1490
|
+
}
|
1491
|
+
value = token.value + value;
|
1492
|
+
if (value.indexOf("<") !== -1) {
|
1493
|
+
var tag = this._parseTag(value);
|
1494
|
+
tag.end = end;
|
1495
|
+
tag.start = {
|
1496
|
+
row: iterator.getCurrentTokenRow(),
|
1497
|
+
column: iterator.getCurrentTokenColumn()
|
1498
|
+
};
|
1499
|
+
iterator.stepBackward();
|
1500
|
+
return tag;
|
1501
|
+
}
|
1502
|
+
}
|
1503
|
+
} while(token = iterator.stepBackward());
|
1504
|
+
|
1505
|
+
return null;
|
1506
|
+
};
|
1507
|
+
|
1508
|
+
this._pop = function(stack, tag) {
|
1509
|
+
while (stack.length) {
|
1510
|
+
|
1511
|
+
var top = stack[stack.length-1];
|
1512
|
+
if (!tag || top.tagName == tag.tagName) {
|
1513
|
+
return stack.pop();
|
1514
|
+
}
|
1515
|
+
else if (this.voidElements[tag.tagName]) {
|
1516
|
+
return;
|
1517
|
+
}
|
1518
|
+
else if (this.voidElements[top.tagName]) {
|
1519
|
+
stack.pop();
|
1520
|
+
continue;
|
1521
|
+
} else {
|
1522
|
+
return null;
|
1523
|
+
}
|
1524
|
+
}
|
1525
|
+
};
|
1526
|
+
|
1527
|
+
this.getFoldWidgetRange = function(session, foldStyle, row) {
|
1528
|
+
var firstTag = this._getFirstTagInLine(session, row);
|
1529
|
+
|
1530
|
+
if (!firstTag.match)
|
1531
|
+
return null;
|
1532
|
+
|
1533
|
+
var isBackward = firstTag.closing || firstTag.selfClosing;
|
1534
|
+
var stack = [];
|
1535
|
+
var tag;
|
1536
|
+
|
1537
|
+
if (!isBackward) {
|
1538
|
+
var iterator = new TokenIterator(session, row, firstTag.column);
|
1539
|
+
var start = {
|
1540
|
+
row: row,
|
1541
|
+
column: firstTag.column + firstTag.tagName.length + 2
|
1542
|
+
};
|
1543
|
+
while (tag = this._readTagForward(iterator)) {
|
1544
|
+
if (tag.selfClosing) {
|
1545
|
+
if (!stack.length) {
|
1546
|
+
tag.start.column += tag.tagName.length + 2;
|
1547
|
+
tag.end.column -= 2;
|
1548
|
+
return Range.fromPoints(tag.start, tag.end);
|
1549
|
+
} else
|
1550
|
+
continue;
|
1551
|
+
}
|
1552
|
+
|
1553
|
+
if (tag.closing) {
|
1554
|
+
this._pop(stack, tag);
|
1555
|
+
if (stack.length == 0)
|
1556
|
+
return Range.fromPoints(start, tag.start);
|
1557
|
+
}
|
1558
|
+
else {
|
1559
|
+
stack.push(tag)
|
1560
|
+
}
|
1561
|
+
}
|
1562
|
+
}
|
1563
|
+
else {
|
1564
|
+
var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length);
|
1565
|
+
var end = {
|
1566
|
+
row: row,
|
1567
|
+
column: firstTag.column
|
1568
|
+
};
|
1569
|
+
|
1570
|
+
while (tag = this._readTagBackward(iterator)) {
|
1571
|
+
if (tag.selfClosing) {
|
1572
|
+
if (!stack.length) {
|
1573
|
+
tag.start.column += tag.tagName.length + 2;
|
1574
|
+
tag.end.column -= 2;
|
1575
|
+
return Range.fromPoints(tag.start, tag.end);
|
1576
|
+
} else
|
1577
|
+
continue;
|
1578
|
+
}
|
1579
|
+
|
1580
|
+
if (!tag.closing) {
|
1581
|
+
this._pop(stack, tag);
|
1582
|
+
if (stack.length == 0) {
|
1583
|
+
tag.start.column += tag.tagName.length + 2;
|
1584
|
+
return Range.fromPoints(tag.start, end);
|
1585
|
+
}
|
1586
|
+
}
|
1587
|
+
else {
|
1588
|
+
stack.push(tag)
|
1589
|
+
}
|
1590
|
+
}
|
1591
|
+
}
|
1592
|
+
|
1593
|
+
};
|
1594
|
+
|
1595
|
+
}).call(FoldMode.prototype);
|
1596
|
+
|
1597
|
+
});
|
1598
|
+
|
1599
|
+
define('ace/mode/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/mode/javascript', 'ace/mode/css', 'ace/tokenizer', 'ace/mode/html_highlight_rules', 'ace/mode/behaviour/html', 'ace/mode/folding/html'], function(require, exports, module) {
|
1600
|
+
|
1601
|
+
|
1602
|
+
var oop = require("../lib/oop");
|
1603
|
+
var TextMode = require("./text").Mode;
|
1604
|
+
var JavaScriptMode = require("./javascript").Mode;
|
1605
|
+
var CssMode = require("./css").Mode;
|
1606
|
+
var Tokenizer = require("../tokenizer").Tokenizer;
|
1607
|
+
var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
|
1608
|
+
var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour;
|
1609
|
+
var HtmlFoldMode = require("./folding/html").FoldMode;
|
1610
|
+
|
1611
|
+
var Mode = function() {
|
1612
|
+
var highlighter = new HtmlHighlightRules();
|
1613
|
+
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
1614
|
+
this.$behaviour = new HtmlBehaviour();
|
1615
|
+
|
1616
|
+
this.$embeds = highlighter.getEmbeds();
|
1617
|
+
this.createModeDelegates({
|
1618
|
+
"js-": JavaScriptMode,
|
1619
|
+
"css-": CssMode
|
1620
|
+
});
|
1621
|
+
|
1622
|
+
this.foldingRules = new HtmlFoldMode();
|
1623
|
+
};
|
1624
|
+
oop.inherits(Mode, TextMode);
|
1625
|
+
|
1626
|
+
(function() {
|
1627
|
+
|
1628
|
+
|
1629
|
+
this.toggleCommentLines = function(state, doc, startRow, endRow) {
|
1630
|
+
return 0;
|
1631
|
+
};
|
1632
|
+
|
1633
|
+
this.getNextLineIndent = function(state, line, tab) {
|
1634
|
+
return this.$getIndent(line);
|
1635
|
+
};
|
1636
|
+
|
1637
|
+
this.checkOutdent = function(state, line, input) {
|
1638
|
+
return false;
|
1639
|
+
};
|
1640
|
+
|
1641
|
+
}).call(Mode.prototype);
|
1642
|
+
|
1643
|
+
exports.Mode = Mode;
|
1644
|
+
});
|
1645
|
+
|
1646
|
+
define('ace/mode/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/css_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/worker/worker_client', 'ace/mode/folding/cstyle'], function(require, exports, module) {
|
1647
|
+
|
1648
|
+
|
1649
|
+
var oop = require("../lib/oop");
|
1650
|
+
var TextMode = require("./text").Mode;
|
1651
|
+
var Tokenizer = require("../tokenizer").Tokenizer;
|
1652
|
+
var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
|
1653
|
+
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
1654
|
+
var WorkerClient = require("../worker/worker_client").WorkerClient;
|
1655
|
+
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
1656
|
+
|
1657
|
+
var Mode = function() {
|
1658
|
+
this.$tokenizer = new Tokenizer(new CssHighlightRules().getRules(), "i");
|
1659
|
+
this.$outdent = new MatchingBraceOutdent();
|
1660
|
+
this.foldingRules = new CStyleFoldMode();
|
1661
|
+
};
|
1662
|
+
oop.inherits(Mode, TextMode);
|
1663
|
+
|
1664
|
+
(function() {
|
1665
|
+
|
1666
|
+
this.foldingRules = "cStyle";
|
1667
|
+
|
1668
|
+
this.getNextLineIndent = function(state, line, tab) {
|
1669
|
+
var indent = this.$getIndent(line);
|
1670
|
+
|
1671
|
+
// ignore braces in comments
|
1672
|
+
var tokens = this.$tokenizer.getLineTokens(line, state).tokens;
|
1673
|
+
if (tokens.length && tokens[tokens.length-1].type == "comment") {
|
1674
|
+
return indent;
|
1675
|
+
}
|
1676
|
+
|
1677
|
+
var match = line.match(/^.*\{\s*$/);
|
1678
|
+
if (match) {
|
1679
|
+
indent += tab;
|
1680
|
+
}
|
1681
|
+
|
1682
|
+
return indent;
|
1683
|
+
};
|
1684
|
+
|
1685
|
+
this.checkOutdent = function(state, line, input) {
|
1686
|
+
return this.$outdent.checkOutdent(line, input);
|
1687
|
+
};
|
1688
|
+
|
1689
|
+
this.autoOutdent = function(state, doc, row) {
|
1690
|
+
this.$outdent.autoOutdent(doc, row);
|
1691
|
+
};
|
1692
|
+
|
1693
|
+
this.createWorker = function(session) {
|
1694
|
+
var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
|
1695
|
+
worker.attachToDocument(session.getDocument());
|
1696
|
+
|
1697
|
+
worker.on("csslint", function(e) {
|
1698
|
+
var errors = [];
|
1699
|
+
e.data.forEach(function(message) {
|
1700
|
+
errors.push({
|
1701
|
+
row: message.line - 1,
|
1702
|
+
column: message.col - 1,
|
1703
|
+
text: message.message,
|
1704
|
+
type: message.type,
|
1705
|
+
lint: message
|
1706
|
+
});
|
1707
|
+
});
|
1708
|
+
|
1709
|
+
session.setAnnotations(errors);
|
1710
|
+
});
|
1711
|
+
return worker;
|
1712
|
+
};
|
1713
|
+
|
1714
|
+
}).call(Mode.prototype);
|
1715
|
+
|
1716
|
+
exports.Mode = Mode;
|
1717
|
+
|
1718
|
+
});
|
1719
|
+
|
1720
|
+
define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
|
1721
|
+
|
1722
|
+
|
1723
|
+
var oop = require("../lib/oop");
|
1724
|
+
var lang = require("../lib/lang");
|
1725
|
+
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
1726
|
+
|
1727
|
+
var CssHighlightRules = function() {
|
1728
|
+
|
1729
|
+
var properties = lang.arrayToMap(
|
1730
|
+
("animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|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|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|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|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index").split("|")
|
1731
|
+
);
|
1732
|
+
|
1733
|
+
var functions = lang.arrayToMap(
|
1734
|
+
("rgb|rgba|url|attr|counter|counters").split("|")
|
1735
|
+
);
|
1736
|
+
|
1737
|
+
var constants = lang.arrayToMap(
|
1738
|
+
("absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|font-size|font|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|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero").split("|")
|
1739
|
+
);
|
1740
|
+
|
1741
|
+
var colors = lang.arrayToMap(
|
1742
|
+
("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|" +
|
1743
|
+
"purple|red|silver|teal|white|yellow").split("|")
|
1744
|
+
);
|
1745
|
+
|
1746
|
+
var fonts = lang.arrayToMap(
|
1747
|
+
("arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|" +
|
1748
|
+
"symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|" +
|
1749
|
+
"serif|monospace").split("|")
|
1750
|
+
);
|
1751
|
+
|
1752
|
+
// regexp must not have capturing parentheses. Use (?:) instead.
|
1753
|
+
// regexps are ordered -> the first match is used
|
1754
|
+
|
1755
|
+
var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
|
1756
|
+
var pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
|
1757
|
+
var 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";
|
1758
|
+
|
1759
|
+
var base_ruleset = [
|
1760
|
+
{
|
1761
|
+
token : "comment", // multi line comment
|
1762
|
+
merge : true,
|
1763
|
+
regex : "\\/\\*",
|
1764
|
+
next : "ruleset_comment"
|
1765
|
+
}, {
|
1766
|
+
token : "string", // single line
|
1767
|
+
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
|
1768
|
+
}, {
|
1769
|
+
token : "string", // single line
|
1770
|
+
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
|
1771
|
+
}, {
|
1772
|
+
token : ["constant.numeric", "keyword"],
|
1773
|
+
regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)"
|
1774
|
+
}, {
|
1775
|
+
token : ["constant.numeric"],
|
1776
|
+
regex : "([0-9]+)"
|
1777
|
+
}, {
|
1778
|
+
token : "constant.numeric", // hex6 color
|
1779
|
+
regex : "#[a-f0-9]{6}"
|
1780
|
+
}, {
|
1781
|
+
token : "constant.numeric", // hex3 color
|
1782
|
+
regex : "#[a-f0-9]{3}"
|
1783
|
+
}, {
|
1784
|
+
token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
|
1785
|
+
regex : pseudoElements
|
1786
|
+
}, {
|
1787
|
+
token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
|
1788
|
+
regex : pseudoClasses
|
1789
|
+
}, {
|
1790
|
+
token : function(value) {
|
1791
|
+
if (properties.hasOwnProperty(value.toLowerCase())) {
|
1792
|
+
return "support.type";
|
1793
|
+
}
|
1794
|
+
else if (functions.hasOwnProperty(value.toLowerCase())) {
|
1795
|
+
return "support.function";
|
1796
|
+
}
|
1797
|
+
else if (constants.hasOwnProperty(value.toLowerCase())) {
|
1798
|
+
return "support.constant";
|
1799
|
+
}
|
1800
|
+
else if (colors.hasOwnProperty(value.toLowerCase())) {
|
1801
|
+
return "support.constant.color";
|
1802
|
+
}
|
1803
|
+
else if (fonts.hasOwnProperty(value.toLowerCase())) {
|
1804
|
+
return "support.constant.fonts";
|
1805
|
+
}
|
1806
|
+
else {
|
1807
|
+
return "text";
|
1808
|
+
}
|
1809
|
+
},
|
1810
|
+
regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
|
1811
|
+
}
|
1812
|
+
];
|
1813
|
+
|
1814
|
+
var ruleset = lang.copyArray(base_ruleset);
|
1815
|
+
ruleset.unshift({
|
1816
|
+
token : "paren.rparen",
|
1817
|
+
regex : "\\}",
|
1818
|
+
next: "start"
|
1819
|
+
});
|
1820
|
+
|
1821
|
+
var media_ruleset = lang.copyArray( base_ruleset );
|
1822
|
+
media_ruleset.unshift({
|
1823
|
+
token : "paren.rparen",
|
1824
|
+
regex : "\\}",
|
1825
|
+
next: "media"
|
1826
|
+
});
|
1827
|
+
|
1828
|
+
var base_comment = [{
|
1829
|
+
token : "comment", // comment spanning whole line
|
1830
|
+
merge : true,
|
1831
|
+
regex : ".+"
|
1832
|
+
}];
|
1833
|
+
|
1834
|
+
var comment = lang.copyArray(base_comment);
|
1835
|
+
comment.unshift({
|
1836
|
+
token : "comment", // closing comment
|
1837
|
+
regex : ".*?\\*\\/",
|
1838
|
+
next : "start"
|
1839
|
+
});
|
1840
|
+
|
1841
|
+
var media_comment = lang.copyArray(base_comment);
|
1842
|
+
media_comment.unshift({
|
1843
|
+
token : "comment", // closing comment
|
1844
|
+
regex : ".*?\\*\\/",
|
1845
|
+
next : "media"
|
1846
|
+
});
|
1847
|
+
|
1848
|
+
var ruleset_comment = lang.copyArray(base_comment);
|
1849
|
+
ruleset_comment.unshift({
|
1850
|
+
token : "comment", // closing comment
|
1851
|
+
regex : ".*?\\*\\/",
|
1852
|
+
next : "ruleset"
|
1853
|
+
});
|
1854
|
+
|
1855
|
+
this.$rules = {
|
1856
|
+
"start" : [{
|
1857
|
+
token : "comment", // multi line comment
|
1858
|
+
merge : true,
|
1859
|
+
regex : "\\/\\*",
|
1860
|
+
next : "comment"
|
1861
|
+
}, {
|
1862
|
+
token: "paren.lparen",
|
1863
|
+
regex: "\\{",
|
1864
|
+
next: "ruleset"
|
1865
|
+
}, {
|
1866
|
+
token: "string",
|
1867
|
+
regex: "@.*?{",
|
1868
|
+
next: "media"
|
1869
|
+
},{
|
1870
|
+
token: "keyword",
|
1871
|
+
regex: "#[a-z0-9-_]+"
|
1872
|
+
},{
|
1873
|
+
token: "variable",
|
1874
|
+
regex: "\\.[a-z0-9-_]+"
|
1875
|
+
},{
|
1876
|
+
token: "string",
|
1877
|
+
regex: ":[a-z0-9-_]+"
|
1878
|
+
},{
|
1879
|
+
token: "constant",
|
1880
|
+
regex: "[a-z0-9-_]+"
|
1881
|
+
}],
|
1882
|
+
|
1883
|
+
"media" : [ {
|
1884
|
+
token : "comment", // multi line comment
|
1885
|
+
merge : true,
|
1886
|
+
regex : "\\/\\*",
|
1887
|
+
next : "media_comment"
|
1888
|
+
}, {
|
1889
|
+
token: "paren.lparen",
|
1890
|
+
regex: "\\{",
|
1891
|
+
next: "media_ruleset"
|
1892
|
+
},{
|
1893
|
+
token: "string",
|
1894
|
+
regex: "\\}",
|
1895
|
+
next: "start"
|
1896
|
+
},{
|
1897
|
+
token: "keyword",
|
1898
|
+
regex: "#[a-z0-9-_]+"
|
1899
|
+
},{
|
1900
|
+
token: "variable",
|
1901
|
+
regex: "\\.[a-z0-9-_]+"
|
1902
|
+
},{
|
1903
|
+
token: "string",
|
1904
|
+
regex: ":[a-z0-9-_]+"
|
1905
|
+
},{
|
1906
|
+
token: "constant",
|
1907
|
+
regex: "[a-z0-9-_]+"
|
1908
|
+
}],
|
1909
|
+
|
1910
|
+
"comment" : comment,
|
1911
|
+
|
1912
|
+
"ruleset" : ruleset,
|
1913
|
+
"ruleset_comment" : ruleset_comment,
|
1914
|
+
|
1915
|
+
"media_ruleset" : media_ruleset,
|
1916
|
+
"media_comment" : media_comment
|
1917
|
+
};
|
1918
|
+
};
|
1919
|
+
|
1920
|
+
oop.inherits(CssHighlightRules, TextHighlightRules);
|
1921
|
+
|
1922
|
+
exports.CssHighlightRules = CssHighlightRules;
|
1923
|
+
|
1924
|
+
});
|
1925
|
+
|
1926
|
+
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_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
|
1927
|
+
|
1928
|
+
|
1929
|
+
var oop = require("../lib/oop");
|
1930
|
+
var lang = require("../lib/lang");
|
1931
|
+
var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
|
1932
|
+
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
|
1933
|
+
var xmlUtil = require("./xml_util");
|
1934
|
+
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
1935
|
+
|
1936
|
+
var tagMap = lang.createMap({
|
1937
|
+
a : 'anchor',
|
1938
|
+
button : 'form',
|
1939
|
+
form : 'form',
|
1940
|
+
img : 'image',
|
1941
|
+
input : 'form',
|
1942
|
+
label : 'form',
|
1943
|
+
script : 'script',
|
1944
|
+
select : 'form',
|
1945
|
+
textarea : 'form',
|
1946
|
+
style : 'style',
|
1947
|
+
table : 'table',
|
1948
|
+
tbody : 'table',
|
1949
|
+
td : 'table',
|
1950
|
+
tfoot : 'table',
|
1951
|
+
th : 'table',
|
1952
|
+
tr : 'table'
|
1953
|
+
});
|
1954
|
+
|
1955
|
+
var HtmlHighlightRules = function() {
|
1956
|
+
|
1957
|
+
// regexp must not have capturing parentheses
|
1958
|
+
// regexps are ordered -> the first match is used
|
1959
|
+
this.$rules = {
|
1960
|
+
start : [{
|
1961
|
+
token : "text",
|
1962
|
+
merge : true,
|
1963
|
+
regex : "<\\!\\[CDATA\\[",
|
1964
|
+
next : "cdata"
|
1965
|
+
}, {
|
1966
|
+
token : "xml_pe",
|
1967
|
+
regex : "<\\?.*?\\?>"
|
1968
|
+
}, {
|
1969
|
+
token : "comment",
|
1970
|
+
merge : true,
|
1971
|
+
regex : "<\\!--",
|
1972
|
+
next : "comment"
|
1973
|
+
}, {
|
1974
|
+
token : "xml_pe",
|
1975
|
+
regex : "<\\!.*?>"
|
1976
|
+
}, {
|
1977
|
+
token : "meta.tag",
|
1978
|
+
regex : "<(?=\s*script\\b)",
|
1979
|
+
next : "script"
|
1980
|
+
}, {
|
1981
|
+
token : "meta.tag",
|
1982
|
+
regex : "<(?=\s*style\\b)",
|
1983
|
+
next : "style"
|
1984
|
+
}, {
|
1985
|
+
token : "meta.tag", // opening tag
|
1986
|
+
regex : "<\\/?",
|
1987
|
+
next : "tag"
|
1988
|
+
}, {
|
1989
|
+
token : "text",
|
1990
|
+
regex : "\\s+"
|
1991
|
+
}, {
|
1992
|
+
token : "constant.character.entity",
|
1993
|
+
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
|
1994
|
+
}, {
|
1995
|
+
token : "text",
|
1996
|
+
regex : "[^<]+"
|
1997
|
+
} ],
|
1998
|
+
|
1999
|
+
cdata : [ {
|
2000
|
+
token : "text",
|
2001
|
+
regex : "\\]\\]>",
|
2002
|
+
next : "start"
|
2003
|
+
}, {
|
2004
|
+
token : "text",
|
2005
|
+
merge : true,
|
2006
|
+
regex : "\\s+"
|
2007
|
+
}, {
|
2008
|
+
token : "text",
|
2009
|
+
merge : true,
|
2010
|
+
regex : ".+"
|
2011
|
+
} ],
|
2012
|
+
|
2013
|
+
comment : [ {
|
2014
|
+
token : "comment",
|
2015
|
+
regex : ".*?-->",
|
2016
|
+
next : "start"
|
2017
|
+
}, {
|
2018
|
+
token : "comment",
|
2019
|
+
merge : true,
|
2020
|
+
regex : ".+"
|
2021
|
+
} ]
|
2022
|
+
};
|
2023
|
+
|
2024
|
+
xmlUtil.tag(this.$rules, "tag", "start", tagMap);
|
2025
|
+
xmlUtil.tag(this.$rules, "style", "css-start", tagMap);
|
2026
|
+
xmlUtil.tag(this.$rules, "script", "js-start", tagMap);
|
2027
|
+
|
2028
|
+
this.embedRules(JavaScriptHighlightRules, "js-", [{
|
2029
|
+
token: "comment",
|
2030
|
+
regex: "\\/\\/.*(?=<\\/script>)",
|
2031
|
+
next: "tag"
|
2032
|
+
}, {
|
2033
|
+
token: "meta.tag",
|
2034
|
+
regex: "<\\/(?=script)",
|
2035
|
+
next: "tag"
|
2036
|
+
}]);
|
2037
|
+
|
2038
|
+
this.embedRules(CssHighlightRules, "css-", [{
|
2039
|
+
token: "meta.tag",
|
2040
|
+
regex: "<\\/(?=style)",
|
2041
|
+
next: "tag"
|
2042
|
+
}]);
|
2043
|
+
};
|
2044
|
+
|
2045
|
+
oop.inherits(HtmlHighlightRules, TextHighlightRules);
|
2046
|
+
|
2047
|
+
exports.HtmlHighlightRules = HtmlHighlightRules;
|
2048
|
+
});
|
2049
|
+
|
2050
|
+
define('ace/mode/behaviour/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour/xml', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) {
|
2051
|
+
|
2052
|
+
|
2053
|
+
var oop = require("../../lib/oop");
|
2054
|
+
var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
|
2055
|
+
var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
|
2056
|
+
var TokenIterator = require("../../token_iterator").TokenIterator;
|
2057
|
+
var voidElements = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr'];
|
2058
|
+
|
2059
|
+
function hasType(token, type) {
|
2060
|
+
var hasType = true;
|
2061
|
+
var typeList = token.type.split('.');
|
2062
|
+
var needleList = type.split('.');
|
2063
|
+
needleList.forEach(function(needle){
|
2064
|
+
if (typeList.indexOf(needle) == -1) {
|
2065
|
+
hasType = false;
|
2066
|
+
return false;
|
2067
|
+
}
|
2068
|
+
});
|
2069
|
+
return hasType;
|
2070
|
+
}
|
2071
|
+
|
2072
|
+
var HtmlBehaviour = function () {
|
2073
|
+
|
2074
|
+
this.inherit(XmlBehaviour); // Get xml behaviour
|
2075
|
+
|
2076
|
+
this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
|
2077
|
+
if (text == '>') {
|
2078
|
+
var position = editor.getCursorPosition();
|
2079
|
+
var iterator = new TokenIterator(session, position.row, position.column);
|
2080
|
+
var token = iterator.getCurrentToken();
|
2081
|
+
var atCursor = false;
|
2082
|
+
if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){
|
2083
|
+
do {
|
2084
|
+
token = iterator.stepBackward();
|
2085
|
+
} while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text')));
|
2086
|
+
} else {
|
2087
|
+
atCursor = true;
|
2088
|
+
}
|
2089
|
+
if (!token || !hasType(token, 'meta.tag-name') || iterator.stepBackward().value.match('/')) {
|
2090
|
+
return
|
2091
|
+
}
|
2092
|
+
var element = token.value;
|
2093
|
+
if (atCursor){
|
2094
|
+
var element = element.substring(0, position.column - token.start);
|
2095
|
+
}
|
2096
|
+
if (voidElements.indexOf(element) !== -1){
|
2097
|
+
return;
|
2098
|
+
}
|
2099
|
+
return {
|
2100
|
+
text: '>' + '</' + element + '>',
|
2101
|
+
selection: [1, 1]
|
2102
|
+
}
|
2103
|
+
}
|
2104
|
+
});
|
2105
|
+
}
|
2106
|
+
oop.inherits(HtmlBehaviour, XmlBehaviour);
|
2107
|
+
|
2108
|
+
exports.HtmlBehaviour = HtmlBehaviour;
|
2109
|
+
});
|
2110
|
+
|
2111
|
+
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) {
|
2112
|
+
|
2113
|
+
|
2114
|
+
var oop = require("../../lib/oop");
|
2115
|
+
var MixedFoldMode = require("./mixed").FoldMode;
|
2116
|
+
var XmlFoldMode = require("./xml").FoldMode;
|
2117
|
+
var CStyleFoldMode = require("./cstyle").FoldMode;
|
2118
|
+
|
2119
|
+
var FoldMode = exports.FoldMode = function() {
|
2120
|
+
MixedFoldMode.call(this, new XmlFoldMode({
|
2121
|
+
// void elements
|
2122
|
+
"area": 1,
|
2123
|
+
"base": 1,
|
2124
|
+
"br": 1,
|
2125
|
+
"col": 1,
|
2126
|
+
"command": 1,
|
2127
|
+
"embed": 1,
|
2128
|
+
"hr": 1,
|
2129
|
+
"img": 1,
|
2130
|
+
"input": 1,
|
2131
|
+
"keygen": 1,
|
2132
|
+
"link": 1,
|
2133
|
+
"meta": 1,
|
2134
|
+
"param": 1,
|
2135
|
+
"source": 1,
|
2136
|
+
"track": 1,
|
2137
|
+
"wbr": 1,
|
2138
|
+
|
2139
|
+
// optional tags
|
2140
|
+
"li": 1,
|
2141
|
+
"dt": 1,
|
2142
|
+
"dd": 1,
|
2143
|
+
"p": 1,
|
2144
|
+
"rt": 1,
|
2145
|
+
"rp": 1,
|
2146
|
+
"optgroup": 1,
|
2147
|
+
"option": 1,
|
2148
|
+
"colgroup": 1,
|
2149
|
+
"td": 1,
|
2150
|
+
"th": 1
|
2151
|
+
}), {
|
2152
|
+
"js-": new CStyleFoldMode(),
|
2153
|
+
"css-": new CStyleFoldMode()
|
2154
|
+
});
|
2155
|
+
};
|
2156
|
+
|
2157
|
+
oop.inherits(FoldMode, MixedFoldMode);
|
2158
|
+
|
2159
|
+
});
|
2160
|
+
|
2161
|
+
define('ace/mode/folding/mixed', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
|
2162
|
+
|
2163
|
+
|
2164
|
+
var oop = require("../../lib/oop");
|
2165
|
+
var BaseFoldMode = require("./fold_mode").FoldMode;
|
2166
|
+
|
2167
|
+
var FoldMode = exports.FoldMode = function(defaultMode, subModes) {
|
2168
|
+
this.defaultMode = defaultMode;
|
2169
|
+
this.subModes = subModes;
|
2170
|
+
};
|
2171
|
+
oop.inherits(FoldMode, BaseFoldMode);
|
2172
|
+
|
2173
|
+
(function() {
|
2174
|
+
|
2175
|
+
|
2176
|
+
this.$getMode = function(state) {
|
2177
|
+
for (var key in this.subModes) {
|
2178
|
+
if (state.indexOf(key) === 0)
|
2179
|
+
return this.subModes[key];
|
2180
|
+
}
|
2181
|
+
return null;
|
2182
|
+
};
|
2183
|
+
|
2184
|
+
this.$tryMode = function(state, session, foldStyle, row) {
|
2185
|
+
var mode = this.$getMode(state);
|
2186
|
+
return (mode ? mode.getFoldWidget(session, foldStyle, row) : "");
|
2187
|
+
};
|
2188
|
+
|
2189
|
+
this.getFoldWidget = function(session, foldStyle, row) {
|
2190
|
+
return (
|
2191
|
+
this.$tryMode(session.getState(row-1), session, foldStyle, row) ||
|
2192
|
+
this.$tryMode(session.getState(row), session, foldStyle, row) ||
|
2193
|
+
this.defaultMode.getFoldWidget(session, foldStyle, row)
|
2194
|
+
);
|
2195
|
+
};
|
2196
|
+
|
2197
|
+
this.getFoldWidgetRange = function(session, foldStyle, row) {
|
2198
|
+
var mode = this.$getMode(session.getState(row-1));
|
2199
|
+
|
2200
|
+
if (!mode || !mode.getFoldWidget(session, foldStyle, row))
|
2201
|
+
mode = this.$getMode(session.getState(row));
|
2202
|
+
|
2203
|
+
if (!mode || !mode.getFoldWidget(session, foldStyle, row))
|
2204
|
+
mode = this.defaultMode;
|
2205
|
+
|
2206
|
+
return mode.getFoldWidgetRange(session, foldStyle, row);
|
2207
|
+
};
|
2208
|
+
|
2209
|
+
}).call(FoldMode.prototype);
|
2210
|
+
|
2211
|
+
});
|
2212
|
+
|
2213
|
+
define('ace/mode/markdown_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_highlight_rules', 'ace/mode/html_highlight_rules', 'ace/mode/css_highlight_rules'], function(require, exports, module) {
|
2214
|
+
|
2215
|
+
|
2216
|
+
var oop = require("../lib/oop");
|
2217
|
+
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
2218
|
+
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
|
2219
|
+
var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
|
2220
|
+
var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
|
2221
|
+
var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
|
2222
|
+
|
2223
|
+
function github_embed(tag, prefix) {
|
2224
|
+
return { // Github style block
|
2225
|
+
token : "support.function",
|
2226
|
+
regex : "^```" + tag + "\\s*$",
|
2227
|
+
next : prefix + "start"
|
2228
|
+
};
|
2229
|
+
}
|
2230
|
+
|
2231
|
+
var MarkdownHighlightRules = function() {
|
2232
|
+
|
2233
|
+
// regexp must not have capturing parentheses
|
2234
|
+
// regexps are ordered -> the first match is used
|
2235
|
+
|
2236
|
+
this.$rules = {
|
2237
|
+
"start" : [ {
|
2238
|
+
token : "empty_line",
|
2239
|
+
regex : '^$'
|
2240
|
+
}, { // code span `
|
2241
|
+
token : ["support.function", "support.function", "support.function"],
|
2242
|
+
regex : "(`+)([^\\r]*?[^`])(\\1)"
|
2243
|
+
}, { // code block
|
2244
|
+
token : "support.function",
|
2245
|
+
regex : "^[ ]{4}.+"
|
2246
|
+
}, { // h1
|
2247
|
+
token: "markup.heading.1",
|
2248
|
+
regex: "^=+(?=\\s*$)"
|
2249
|
+
}, { // h2
|
2250
|
+
token: "markup.heading.1",
|
2251
|
+
regex: "^\\-+(?=\\s*$)"
|
2252
|
+
}, { // header
|
2253
|
+
token : function(value) {
|
2254
|
+
return "markup.heading." + value.length;
|
2255
|
+
},
|
2256
|
+
regex : "^#{1,6}"
|
2257
|
+
}, github_embed("(?:javascript|js)", "js-"),
|
2258
|
+
github_embed("xml", "xml-"),
|
2259
|
+
github_embed("html", "html-"),
|
2260
|
+
github_embed("css", "css-"),
|
2261
|
+
{ // Github style block
|
2262
|
+
token : "support.function",
|
2263
|
+
regex : "^```[a-zA-Z]+\\s*$",
|
2264
|
+
next : "githubblock"
|
2265
|
+
}, { // block quote
|
2266
|
+
token : "string",
|
2267
|
+
regex : "^>[ ].+$",
|
2268
|
+
next : "blockquote"
|
2269
|
+
}, { // reference
|
2270
|
+
token : ["text", "constant", "text", "url", "string", "text"],
|
2271
|
+
regex : "^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:[\"][^\"]+[\"])?(\\s*))$"
|
2272
|
+
}, { // link by reference
|
2273
|
+
token : ["text", "string", "text", "constant", "text"],
|
2274
|
+
regex : "(\\[)((?:[[^\\]]*\\]|[^\\[\\]])*)(\\][ ]?(?:\\n[ ]*)?\\[)(.*?)(\\])"
|
2275
|
+
}, { // link by url
|
2276
|
+
token : ["text", "string", "text", "markup.underline", "string", "text"],
|
2277
|
+
regex : "(\\[)"+
|
2278
|
+
"(\\[[^\\]]*\\]|[^\\[\\]]*)"+
|
2279
|
+
"(\\]\\([ \\t]*)"+
|
2280
|
+
"(<?(?:(?:[^\\(]*?\\([^\\)]*?\\)\\S*?)|(?:.*?))>?)"+
|
2281
|
+
"((?:[ \t]*\"(?:.*?)\"[ \\t]*)?)"+
|
2282
|
+
"(\\))"
|
2283
|
+
}, { // HR *
|
2284
|
+
token : "constant",
|
2285
|
+
regex : "^[ ]{0,2}(?:[ ]?\\*[ ]?){3,}\\s*$"
|
2286
|
+
}, { // HR -
|
2287
|
+
token : "constant",
|
2288
|
+
regex : "^[ ]{0,2}(?:[ ]?\\-[ ]?){3,}\\s*$"
|
2289
|
+
}, { // HR _
|
2290
|
+
token : "constant",
|
2291
|
+
regex : "^[ ]{0,2}(?:[ ]?\\_[ ]?){3,}\\s*$"
|
2292
|
+
}, { // list
|
2293
|
+
token : "markup.list",
|
2294
|
+
regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",
|
2295
|
+
next : "listblock"
|
2296
|
+
}, { // strong ** __
|
2297
|
+
token : ["string", "string", "string"],
|
2298
|
+
regex : "([*]{2}|[_]{2}(?=\\S))([^\\r]*?\\S[*_]*)(\\1)"
|
2299
|
+
}, { // emphasis * _
|
2300
|
+
token : ["string", "string", "string"],
|
2301
|
+
regex : "([*]|[_](?=\\S))([^\\r]*?\\S[*_]*)(\\1)"
|
2302
|
+
}, { //
|
2303
|
+
token : ["text", "url", "text"],
|
2304
|
+
regex : "(<)("+
|
2305
|
+
"(?:https?|ftp|dict):[^'\">\\s]+"+
|
2306
|
+
"|"+
|
2307
|
+
"(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+"+
|
2308
|
+
")(>)"
|
2309
|
+
}, {
|
2310
|
+
token : "text",
|
2311
|
+
regex : "[^\\*_%$`\\[#<>]+"
|
2312
|
+
} ],
|
2313
|
+
|
2314
|
+
"listblock" : [ { // Lists only escape on completely blank lines.
|
2315
|
+
token : "empty_line",
|
2316
|
+
regex : "^$",
|
2317
|
+
next : "start"
|
2318
|
+
}, {
|
2319
|
+
token : "markup.list",
|
2320
|
+
regex : ".+"
|
2321
|
+
} ],
|
2322
|
+
|
2323
|
+
"blockquote" : [ { // BLockquotes only escape on blank lines.
|
2324
|
+
token : "empty_line",
|
2325
|
+
regex : "^\\s*$",
|
2326
|
+
next : "start"
|
2327
|
+
}, {
|
2328
|
+
token : "string",
|
2329
|
+
regex : ".+"
|
2330
|
+
} ],
|
2331
|
+
|
2332
|
+
"githubblock" : [ {
|
2333
|
+
token : "support.function",
|
2334
|
+
regex : "^```",
|
2335
|
+
next : "start"
|
2336
|
+
}, {
|
2337
|
+
token : "support.function",
|
2338
|
+
regex : ".+"
|
2339
|
+
} ]
|
2340
|
+
};
|
2341
|
+
|
2342
|
+
this.embedRules(JavaScriptHighlightRules, "js-", [{
|
2343
|
+
token : "support.function",
|
2344
|
+
regex : "^```",
|
2345
|
+
next : "start"
|
2346
|
+
}]);
|
2347
|
+
|
2348
|
+
this.embedRules(HtmlHighlightRules, "html-", [{
|
2349
|
+
token : "support.function",
|
2350
|
+
regex : "^```",
|
2351
|
+
next : "start"
|
2352
|
+
}]);
|
2353
|
+
|
2354
|
+
this.embedRules(CssHighlightRules, "css-", [{
|
2355
|
+
token : "support.function",
|
2356
|
+
regex : "^```",
|
2357
|
+
next : "start"
|
2358
|
+
}]);
|
2359
|
+
|
2360
|
+
this.embedRules(XmlHighlightRules, "xml-", [{
|
2361
|
+
token : "support.function",
|
2362
|
+
regex : "^```",
|
2363
|
+
next : "start"
|
2364
|
+
}]);
|
2365
|
+
};
|
2366
|
+
oop.inherits(MarkdownHighlightRules, TextHighlightRules);
|
2367
|
+
|
2368
|
+
exports.MarkdownHighlightRules = MarkdownHighlightRules;
|
2369
|
+
});
|