aced_rails 0.0.1

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