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