ace-rails-ap 2.0.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (301) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -4
  3. data/lib/ace/rails/version.rb +1 -1
  4. data/vendor/assets/javascripts/ace/ace.js +14194 -13349
  5. data/vendor/assets/javascripts/ace/ext-beautify.js +335 -0
  6. data/vendor/assets/javascripts/ace/ext-chromevox.js +6 -1
  7. data/vendor/assets/javascripts/ace/ext-elastic_tabstops_lite.js +8 -33
  8. data/vendor/assets/javascripts/ace/ext-emmet.js +487 -424
  9. data/vendor/assets/javascripts/ace/ext-error_marker.js +6 -0
  10. data/vendor/assets/javascripts/ace/ext-keybinding_menu.js +45 -72
  11. data/vendor/assets/javascripts/ace/ext-language_tools.js +734 -578
  12. data/vendor/assets/javascripts/ace/ext-linking.js +53 -0
  13. data/vendor/assets/javascripts/ace/ext-modelist.js +25 -10
  14. data/vendor/assets/javascripts/ace/ext-old_ie.js +93 -120
  15. data/vendor/assets/javascripts/ace/ext-searchbox.js +8 -41
  16. data/vendor/assets/javascripts/ace/ext-settings_menu.js +229 -234
  17. data/vendor/assets/javascripts/ace/ext-spellcheck.js +7 -3
  18. data/vendor/assets/javascripts/ace/ext-split.js +13 -37
  19. data/vendor/assets/javascripts/ace/ext-static_highlight.js +16 -39
  20. data/vendor/assets/javascripts/ace/ext-statusbar.js +8 -2
  21. data/vendor/assets/javascripts/ace/ext-textarea.js +254 -99
  22. data/vendor/assets/javascripts/ace/ext-themelist.js +13 -40
  23. data/vendor/assets/javascripts/ace/ext-whitespace.js +17 -41
  24. data/vendor/assets/javascripts/ace/keybinding-emacs.js +803 -788
  25. data/vendor/assets/javascripts/ace/keybinding-vim.js +1559 -1560
  26. data/vendor/assets/javascripts/ace/mode-abap.js +52 -83
  27. data/vendor/assets/javascripts/ace/mode-actionscript.js +27 -63
  28. data/vendor/assets/javascripts/ace/mode-ada.js +27 -58
  29. data/vendor/assets/javascripts/ace/mode-apache_conf.js +310 -0
  30. data/vendor/assets/javascripts/ace/mode-applescript.js +226 -0
  31. data/vendor/assets/javascripts/ace/mode-asciidoc.js +39 -70
  32. data/vendor/assets/javascripts/ace/mode-assembly_x86.js +26 -58
  33. data/vendor/assets/javascripts/ace/mode-autohotkey.js +27 -63
  34. data/vendor/assets/javascripts/ace/mode-batchfile.js +27 -63
  35. data/vendor/assets/javascripts/ace/mode-c9search.js +92 -112
  36. data/vendor/assets/javascripts/ace/mode-c_cpp.js +224 -223
  37. data/vendor/assets/javascripts/ace/mode-cirru.js +202 -0
  38. data/vendor/assets/javascripts/ace/mode-clojure.js +98 -92
  39. data/vendor/assets/javascripts/ace/mode-cobol.js +27 -58
  40. data/vendor/assets/javascripts/ace/mode-coffee.js +90 -122
  41. data/vendor/assets/javascripts/ace/mode-coldfusion.js +1908 -1464
  42. data/vendor/assets/javascripts/ace/mode-csharp.js +291 -264
  43. data/vendor/assets/javascripts/ace/mode-css.js +266 -267
  44. data/vendor/assets/javascripts/ace/mode-curly.js +796 -815
  45. data/vendor/assets/javascripts/ace/mode-d.js +64 -95
  46. data/vendor/assets/javascripts/ace/mode-dart.js +254 -256
  47. data/vendor/assets/javascripts/ace/mode-diff.js +27 -58
  48. data/vendor/assets/javascripts/ace/mode-django.js +856 -866
  49. data/vendor/assets/javascripts/ace/mode-dockerfile.js +759 -0
  50. data/vendor/assets/javascripts/ace/mode-dot.js +106 -106
  51. data/vendor/assets/javascripts/ace/mode-eiffel.js +135 -0
  52. data/vendor/assets/javascripts/ace/mode-ejs.js +931 -938
  53. data/vendor/assets/javascripts/ace/mode-erlang.js +27 -58
  54. data/vendor/assets/javascripts/ace/mode-forth.js +27 -63
  55. data/vendor/assets/javascripts/ace/mode-ftl.js +457 -508
  56. data/vendor/assets/javascripts/ace/mode-gcode.js +85 -0
  57. data/vendor/assets/javascripts/ace/mode-gherkin.js +129 -0
  58. data/vendor/assets/javascripts/ace/mode-gitignore.js +50 -0
  59. data/vendor/assets/javascripts/ace/mode-glsl.js +252 -248
  60. data/vendor/assets/javascripts/ace/mode-golang.js +206 -179
  61. data/vendor/assets/javascripts/ace/mode-groovy.js +310 -242
  62. data/vendor/assets/javascripts/ace/mode-haml.js +156 -190
  63. data/vendor/assets/javascripts/ace/mode-handlebars.js +815 -784
  64. data/vendor/assets/javascripts/ace/mode-haskell.js +27 -63
  65. data/vendor/assets/javascripts/ace/mode-haxe.js +206 -176
  66. data/vendor/assets/javascripts/ace/mode-html.js +779 -792
  67. data/vendor/assets/javascripts/ace/mode-html_ruby.js +916 -923
  68. data/vendor/assets/javascripts/ace/mode-ini.js +27 -58
  69. data/vendor/assets/javascripts/ace/mode-io.js +201 -0
  70. data/vendor/assets/javascripts/ace/mode-jack.js +169 -170
  71. data/vendor/assets/javascripts/ace/mode-jade.js +722 -774
  72. data/vendor/assets/javascripts/ace/mode-java.js +310 -245
  73. data/vendor/assets/javascripts/ace/mode-javascript.js +285 -247
  74. data/vendor/assets/javascripts/ace/mode-json.js +183 -184
  75. data/vendor/assets/javascripts/ace/mode-jsoniq.js +3211 -1274
  76. data/vendor/assets/javascripts/ace/mode-jsp.js +481 -504
  77. data/vendor/assets/javascripts/ace/mode-jsx.js +206 -176
  78. data/vendor/assets/javascripts/ace/mode-julia.js +33 -69
  79. data/vendor/assets/javascripts/ace/mode-latex.js +74 -41
  80. data/vendor/assets/javascripts/ace/mode-less.js +250 -251
  81. data/vendor/assets/javascripts/ace/mode-liquid.js +424 -475
  82. data/vendor/assets/javascripts/ace/mode-lisp.js +24 -57
  83. data/vendor/assets/javascripts/ace/mode-livescript.js +42 -41
  84. data/vendor/assets/javascripts/ace/mode-logiql.js +229 -230
  85. data/vendor/assets/javascripts/ace/mode-lsl.js +200 -441
  86. data/vendor/assets/javascripts/ace/mode-lua.js +136 -167
  87. data/vendor/assets/javascripts/ace/mode-luapage.js +904 -884
  88. data/vendor/assets/javascripts/ace/mode-lucene.js +22 -17
  89. data/vendor/assets/javascripts/ace/mode-makefile.js +162 -137
  90. data/vendor/assets/javascripts/ace/mode-markdown.js +846 -854
  91. data/vendor/assets/javascripts/ace/mode-matlab.js +98 -72
  92. data/vendor/assets/javascripts/ace/mode-mel.js +569 -0
  93. data/vendor/assets/javascripts/ace/mode-mushcode.js +84 -115
  94. data/vendor/assets/javascripts/ace/mode-mysql.js +49 -80
  95. data/vendor/assets/javascripts/ace/mode-nix.js +252 -256
  96. data/vendor/assets/javascripts/ace/mode-objectivec.js +242 -274
  97. data/vendor/assets/javascripts/ace/mode-ocaml.js +71 -102
  98. data/vendor/assets/javascripts/ace/mode-pascal.js +32 -68
  99. data/vendor/assets/javascripts/ace/mode-perl.js +67 -98
  100. data/vendor/assets/javascripts/ace/mode-pgsql.js +990 -982
  101. data/vendor/assets/javascripts/ace/mode-php.js +1878 -1900
  102. data/vendor/assets/javascripts/ace/mode-plain_text.js +3 -34
  103. data/vendor/assets/javascripts/ace/mode-powershell.js +181 -151
  104. data/vendor/assets/javascripts/ace/mode-praat.js +418 -0
  105. data/vendor/assets/javascripts/ace/mode-prolog.js +27 -63
  106. data/vendor/assets/javascripts/ace/mode-properties.js +20 -48
  107. data/vendor/assets/javascripts/ace/mode-protobuf.js +252 -259
  108. data/vendor/assets/javascripts/ace/mode-python.js +84 -115
  109. data/vendor/assets/javascripts/ace/mode-r.js +105 -140
  110. data/vendor/assets/javascripts/ace/mode-rdoc.js +84 -89
  111. data/vendor/assets/javascripts/ace/mode-rhtml.js +892 -908
  112. data/vendor/assets/javascripts/ace/mode-ruby.js +434 -98
  113. data/vendor/assets/javascripts/ace/mode-rust.js +27 -63
  114. data/vendor/assets/javascripts/ace/mode-sass.js +75 -106
  115. data/vendor/assets/javascripts/ace/mode-scad.js +219 -220
  116. data/vendor/assets/javascripts/ace/mode-scala.js +311 -243
  117. data/vendor/assets/javascripts/ace/mode-scheme.js +24 -60
  118. data/vendor/assets/javascripts/ace/mode-scss.js +250 -251
  119. data/vendor/assets/javascripts/ace/mode-sh.js +506 -118
  120. data/vendor/assets/javascripts/ace/mode-sjs.js +314 -280
  121. data/vendor/assets/javascripts/ace/mode-smarty.js +2474 -0
  122. data/vendor/assets/javascripts/ace/mode-snippets.js +89 -89
  123. data/vendor/assets/javascripts/ace/mode-soy_template.js +792 -811
  124. data/vendor/assets/javascripts/ace/mode-space.js +22 -23
  125. data/vendor/assets/javascripts/ace/mode-sql.js +31 -58
  126. data/vendor/assets/javascripts/ace/mode-stylus.js +161 -197
  127. data/vendor/assets/javascripts/ace/mode-svg.js +906 -836
  128. data/vendor/assets/javascripts/ace/mode-tcl.js +61 -92
  129. data/vendor/assets/javascripts/ace/mode-tex.js +36 -73
  130. data/vendor/assets/javascripts/ace/mode-text.js +1 -0
  131. data/vendor/assets/javascripts/ace/mode-textile.js +41 -72
  132. data/vendor/assets/javascripts/ace/mode-toml.js +26 -62
  133. data/vendor/assets/javascripts/ace/mode-twig.js +1196 -892
  134. data/vendor/assets/javascripts/ace/mode-typescript.js +313 -277
  135. data/vendor/assets/javascripts/ace/mode-vala.js +982 -0
  136. data/vendor/assets/javascripts/ace/mode-vbscript.js +25 -62
  137. data/vendor/assets/javascripts/ace/mode-velocity.js +2251 -1242
  138. data/vendor/assets/javascripts/ace/mode-verilog.js +27 -59
  139. data/vendor/assets/javascripts/ace/mode-vhdl.js +26 -55
  140. data/vendor/assets/javascripts/ace/mode-xml.js +319 -644
  141. data/vendor/assets/javascripts/ace/mode-xquery.js +2503 -588
  142. data/vendor/assets/javascripts/ace/mode-yaml.js +56 -90
  143. data/vendor/assets/javascripts/ace/snippets/abap.js +7 -0
  144. data/vendor/assets/javascripts/ace/snippets/actionscript.js +159 -0
  145. data/vendor/assets/javascripts/ace/snippets/ada.js +7 -0
  146. data/vendor/assets/javascripts/ace/snippets/apache_conf.js +7 -0
  147. data/vendor/assets/javascripts/ace/snippets/applescript.js +7 -0
  148. data/vendor/assets/javascripts/ace/snippets/asciidoc.js +7 -0
  149. data/vendor/assets/javascripts/ace/snippets/assembly_x86.js +7 -0
  150. data/vendor/assets/javascripts/ace/snippets/autohotkey.js +7 -0
  151. data/vendor/assets/javascripts/ace/snippets/batchfile.js +7 -0
  152. data/vendor/assets/javascripts/ace/snippets/c9search.js +7 -0
  153. data/vendor/assets/javascripts/ace/snippets/c_cpp.js +138 -0
  154. data/vendor/assets/javascripts/ace/snippets/cirru.js +7 -0
  155. data/vendor/assets/javascripts/ace/snippets/clojure.js +97 -0
  156. data/vendor/assets/javascripts/ace/snippets/cobol.js +7 -0
  157. data/vendor/assets/javascripts/ace/snippets/coffee.js +102 -0
  158. data/vendor/assets/javascripts/ace/snippets/coldfusion.js +7 -0
  159. data/vendor/assets/javascripts/ace/snippets/csharp.js +7 -0
  160. data/vendor/assets/javascripts/ace/snippets/css.js +974 -0
  161. data/vendor/assets/javascripts/ace/snippets/curly.js +7 -0
  162. data/vendor/assets/javascripts/ace/snippets/d.js +7 -0
  163. data/vendor/assets/javascripts/ace/snippets/dart.js +90 -0
  164. data/vendor/assets/javascripts/ace/snippets/diff.js +18 -0
  165. data/vendor/assets/javascripts/ace/snippets/django.js +115 -0
  166. data/vendor/assets/javascripts/ace/snippets/dockerfile.js +7 -0
  167. data/vendor/assets/javascripts/ace/snippets/dot.js +7 -0
  168. data/vendor/assets/javascripts/ace/snippets/eiffel.js +7 -0
  169. data/vendor/assets/javascripts/ace/snippets/ejs.js +7 -0
  170. data/vendor/assets/javascripts/ace/snippets/erlang.js +167 -0
  171. data/vendor/assets/javascripts/ace/snippets/forth.js +7 -0
  172. data/vendor/assets/javascripts/ace/snippets/ftl.js +7 -0
  173. data/vendor/assets/javascripts/ace/snippets/gcode.js +7 -0
  174. data/vendor/assets/javascripts/ace/snippets/gherkin.js +7 -0
  175. data/vendor/assets/javascripts/ace/snippets/gitignore.js +7 -0
  176. data/vendor/assets/javascripts/ace/snippets/glsl.js +7 -0
  177. data/vendor/assets/javascripts/ace/snippets/golang.js +7 -0
  178. data/vendor/assets/javascripts/ace/snippets/groovy.js +7 -0
  179. data/vendor/assets/javascripts/ace/snippets/haml.js +27 -0
  180. data/vendor/assets/javascripts/ace/snippets/handlebars.js +7 -0
  181. data/vendor/assets/javascripts/ace/snippets/haskell.js +89 -0
  182. data/vendor/assets/javascripts/ace/snippets/haxe.js +7 -0
  183. data/vendor/assets/javascripts/ace/snippets/html.js +835 -0
  184. data/vendor/assets/javascripts/ace/snippets/html_ruby.js +7 -0
  185. data/vendor/assets/javascripts/ace/snippets/ini.js +7 -0
  186. data/vendor/assets/javascripts/ace/snippets/io.js +69 -0
  187. data/vendor/assets/javascripts/ace/snippets/jack.js +7 -0
  188. data/vendor/assets/javascripts/ace/snippets/jade.js +7 -0
  189. data/vendor/assets/javascripts/ace/snippets/java.js +241 -0
  190. data/vendor/assets/javascripts/ace/snippets/javascript.js +189 -0
  191. data/vendor/assets/javascripts/ace/snippets/json.js +7 -0
  192. data/vendor/assets/javascripts/ace/snippets/jsoniq.js +68 -0
  193. data/vendor/assets/javascripts/ace/snippets/jsp.js +106 -0
  194. data/vendor/assets/javascripts/ace/snippets/jsx.js +7 -0
  195. data/vendor/assets/javascripts/ace/snippets/julia.js +7 -0
  196. data/vendor/assets/javascripts/ace/snippets/latex.js +7 -0
  197. data/vendor/assets/javascripts/ace/snippets/less.js +7 -0
  198. data/vendor/assets/javascripts/ace/snippets/liquid.js +7 -0
  199. data/vendor/assets/javascripts/ace/snippets/lisp.js +7 -0
  200. data/vendor/assets/javascripts/ace/snippets/livescript.js +7 -0
  201. data/vendor/assets/javascripts/ace/snippets/logiql.js +7 -0
  202. data/vendor/assets/javascripts/ace/snippets/lsl.js +1073 -0
  203. data/vendor/assets/javascripts/ace/snippets/lua.js +28 -0
  204. data/vendor/assets/javascripts/ace/snippets/luapage.js +7 -0
  205. data/vendor/assets/javascripts/ace/snippets/lucene.js +7 -0
  206. data/vendor/assets/javascripts/ace/snippets/makefile.js +11 -0
  207. data/vendor/assets/javascripts/ace/snippets/markdown.js +95 -0
  208. data/vendor/assets/javascripts/ace/snippets/matlab.js +7 -0
  209. data/vendor/assets/javascripts/ace/snippets/mel.js +7 -0
  210. data/vendor/assets/javascripts/ace/snippets/mushcode.js +7 -0
  211. data/vendor/assets/javascripts/ace/snippets/mysql.js +7 -0
  212. data/vendor/assets/javascripts/ace/snippets/nix.js +7 -0
  213. data/vendor/assets/javascripts/ace/snippets/objectivec.js +7 -0
  214. data/vendor/assets/javascripts/ace/snippets/ocaml.js +7 -0
  215. data/vendor/assets/javascripts/ace/snippets/pascal.js +7 -0
  216. data/vendor/assets/javascripts/ace/snippets/perl.js +354 -0
  217. data/vendor/assets/javascripts/ace/snippets/pgsql.js +7 -0
  218. data/vendor/assets/javascripts/ace/snippets/php.js +283 -0
  219. data/vendor/assets/javascripts/ace/snippets/plain_text.js +7 -0
  220. data/vendor/assets/javascripts/ace/snippets/powershell.js +7 -0
  221. data/vendor/assets/javascripts/ace/snippets/praat.js +7 -0
  222. data/vendor/assets/javascripts/ace/snippets/prolog.js +7 -0
  223. data/vendor/assets/javascripts/ace/snippets/properties.js +7 -0
  224. data/vendor/assets/javascripts/ace/snippets/protobuf.js +7 -0
  225. data/vendor/assets/javascripts/ace/snippets/python.js +165 -0
  226. data/vendor/assets/javascripts/ace/snippets/r.js +128 -0
  227. data/vendor/assets/javascripts/ace/snippets/rdoc.js +7 -0
  228. data/vendor/assets/javascripts/ace/snippets/rhtml.js +7 -0
  229. data/vendor/assets/javascripts/ace/snippets/ruby.js +935 -0
  230. data/vendor/assets/javascripts/ace/snippets/rust.js +7 -0
  231. data/vendor/assets/javascripts/ace/snippets/sass.js +7 -0
  232. data/vendor/assets/javascripts/ace/snippets/scad.js +7 -0
  233. data/vendor/assets/javascripts/ace/snippets/scala.js +7 -0
  234. data/vendor/assets/javascripts/ace/snippets/scheme.js +7 -0
  235. data/vendor/assets/javascripts/ace/snippets/scss.js +7 -0
  236. data/vendor/assets/javascripts/ace/snippets/sh.js +90 -0
  237. data/vendor/assets/javascripts/ace/snippets/sjs.js +7 -0
  238. data/vendor/assets/javascripts/ace/snippets/smarty.js +7 -0
  239. data/vendor/assets/javascripts/ace/snippets/snippets.js +16 -0
  240. data/vendor/assets/javascripts/ace/snippets/soy_template.js +7 -0
  241. data/vendor/assets/javascripts/ace/snippets/space.js +7 -0
  242. data/vendor/assets/javascripts/ace/snippets/sql.js +33 -0
  243. data/vendor/assets/javascripts/ace/snippets/stylus.js +7 -0
  244. data/vendor/assets/javascripts/ace/snippets/svg.js +7 -0
  245. data/vendor/assets/javascripts/ace/snippets/tcl.js +99 -0
  246. data/vendor/assets/javascripts/ace/snippets/tex.js +197 -0
  247. data/vendor/assets/javascripts/ace/snippets/text.js +7 -0
  248. data/vendor/assets/javascripts/ace/snippets/textile.js +37 -0
  249. data/vendor/assets/javascripts/ace/snippets/toml.js +7 -0
  250. data/vendor/assets/javascripts/ace/snippets/twig.js +7 -0
  251. data/vendor/assets/javascripts/ace/snippets/typescript.js +7 -0
  252. data/vendor/assets/javascripts/ace/snippets/vala.js +193 -0
  253. data/vendor/assets/javascripts/ace/snippets/vbscript.js +7 -0
  254. data/vendor/assets/javascripts/ace/snippets/velocity.js +36 -0
  255. data/vendor/assets/javascripts/ace/snippets/verilog.js +7 -0
  256. data/vendor/assets/javascripts/ace/snippets/vhdl.js +7 -0
  257. data/vendor/assets/javascripts/ace/snippets/xml.js +7 -0
  258. data/vendor/assets/javascripts/ace/snippets/xquery.js +68 -0
  259. data/vendor/assets/javascripts/ace/snippets/yaml.js +7 -0
  260. data/vendor/assets/javascripts/ace/theme-ambiance.js +4 -24
  261. data/vendor/assets/javascripts/ace/theme-chaos.js +2 -25
  262. data/vendor/assets/javascripts/ace/theme-chrome.js +2 -31
  263. data/vendor/assets/javascripts/ace/theme-clouds.js +1 -31
  264. data/vendor/assets/javascripts/ace/theme-clouds_midnight.js +1 -31
  265. data/vendor/assets/javascripts/ace/theme-cobalt.js +1 -31
  266. data/vendor/assets/javascripts/ace/theme-crimson_editor.js +1 -31
  267. data/vendor/assets/javascripts/ace/theme-dawn.js +1 -31
  268. data/vendor/assets/javascripts/ace/theme-dreamweaver.js +5 -31
  269. data/vendor/assets/javascripts/ace/theme-eclipse.js +7 -33
  270. data/vendor/assets/javascripts/ace/theme-github.js +2 -35
  271. data/vendor/assets/javascripts/ace/theme-idle_fingers.js +1 -31
  272. data/vendor/assets/javascripts/ace/theme-katzenmilch.js +119 -0
  273. data/vendor/assets/javascripts/ace/theme-kr.js +1 -31
  274. data/vendor/assets/javascripts/ace/theme-kr_theme.js +57 -141
  275. data/vendor/assets/javascripts/ace/theme-kuroir.js +59 -0
  276. data/vendor/assets/javascripts/ace/theme-merbivore.js +1 -31
  277. data/vendor/assets/javascripts/ace/theme-merbivore_soft.js +1 -31
  278. data/vendor/assets/javascripts/ace/theme-mono_industrial.js +1 -31
  279. data/vendor/assets/javascripts/ace/theme-monokai.js +1 -31
  280. data/vendor/assets/javascripts/ace/theme-pastel_on_dark.js +1 -31
  281. data/vendor/assets/javascripts/ace/theme-solarized_dark.js +1 -31
  282. data/vendor/assets/javascripts/ace/theme-solarized_light.js +1 -31
  283. data/vendor/assets/javascripts/ace/theme-terminal.js +1 -31
  284. data/vendor/assets/javascripts/ace/theme-textmate.js +3 -32
  285. data/vendor/assets/javascripts/ace/theme-tomorrow.js +1 -31
  286. data/vendor/assets/javascripts/ace/theme-tomorrow_night.js +1 -31
  287. data/vendor/assets/javascripts/ace/theme-tomorrow_night_blue.js +1 -31
  288. data/vendor/assets/javascripts/ace/theme-tomorrow_night_bright.js +1 -31
  289. data/vendor/assets/javascripts/ace/theme-tomorrow_night_eighties.js +1 -31
  290. data/vendor/assets/javascripts/ace/theme-twilight.js +1 -31
  291. data/vendor/assets/javascripts/ace/theme-vibrant_ink.js +1 -31
  292. data/vendor/assets/javascripts/ace/theme-xcode.js +2 -33
  293. data/vendor/assets/javascripts/ace/worker-coffee.js +5026 -5008
  294. data/vendor/assets/javascripts/ace/worker-css.js +5489 -5134
  295. data/vendor/assets/javascripts/ace/worker-html.js +11517 -0
  296. data/vendor/assets/javascripts/ace/worker-javascript.js +9810 -9501
  297. data/vendor/assets/javascripts/ace/worker-json.js +1583 -1564
  298. data/vendor/assets/javascripts/ace/worker-lua.js +2631 -2612
  299. data/vendor/assets/javascripts/ace/worker-php.js +2385 -2341
  300. data/vendor/assets/javascripts/ace/worker-xquery.js +31643 -3993
  301. metadata +147 -11
@@ -0,0 +1,2474 @@
1
+ define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
2
+ "use strict";
3
+
4
+ var oop = require("../lib/oop");
5
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
6
+
7
+ var DocCommentHighlightRules = function() {
8
+
9
+ this.$rules = {
10
+ "start" : [ {
11
+ token : "comment.doc.tag",
12
+ regex : "@[\\w\\d_]+" // TODO: fix email addresses
13
+ }, {
14
+ token : "comment.doc.tag",
15
+ regex : "\\bTODO\\b"
16
+ }, {
17
+ defaultToken : "comment.doc"
18
+ }]
19
+ };
20
+ };
21
+
22
+ oop.inherits(DocCommentHighlightRules, TextHighlightRules);
23
+
24
+ DocCommentHighlightRules.getStartRule = function(start) {
25
+ return {
26
+ token : "comment.doc", // doc comment
27
+ regex : "\\/\\*(?=\\*)",
28
+ next : start
29
+ };
30
+ };
31
+
32
+ DocCommentHighlightRules.getEndRule = function (start) {
33
+ return {
34
+ token : "comment.doc", // closing comment
35
+ regex : "\\*\\/",
36
+ next : start
37
+ };
38
+ };
39
+
40
+
41
+ exports.DocCommentHighlightRules = DocCommentHighlightRules;
42
+
43
+ });
44
+
45
+ define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) {
46
+ "use strict";
47
+
48
+ var oop = require("../lib/oop");
49
+ var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
50
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
51
+
52
+ var JavaScriptHighlightRules = function(options) {
53
+ var keywordMapper = this.createKeywordMapper({
54
+ "variable.language":
55
+ "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
56
+ "Namespace|QName|XML|XMLList|" + // E4X
57
+ "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
58
+ "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
59
+ "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
60
+ "SyntaxError|TypeError|URIError|" +
61
+ "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
62
+ "isNaN|parseFloat|parseInt|" +
63
+ "JSON|Math|" + // Other
64
+ "this|arguments|prototype|window|document" , // Pseudo
65
+ "keyword":
66
+ "const|yield|import|get|set|" +
67
+ "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
68
+ "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
69
+ "__parent__|__count__|escape|unescape|with|__proto__|" +
70
+ "class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
71
+ "storage.type":
72
+ "const|let|var|function",
73
+ "constant.language":
74
+ "null|Infinity|NaN|undefined",
75
+ "support.function":
76
+ "alert",
77
+ "constant.language.boolean": "true|false"
78
+ }, "identifier");
79
+ var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
80
+ var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
81
+
82
+ var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
83
+ "u[0-9a-fA-F]{4}|" + // unicode
84
+ "[0-2][0-7]{0,2}|" + // oct
85
+ "3[0-6][0-7]?|" + // oct
86
+ "37[0-7]?|" + // oct
87
+ "[4-7][0-7]?|" + //oct
88
+ ".)";
89
+
90
+ this.$rules = {
91
+ "no_regex" : [
92
+ {
93
+ token : "comment",
94
+ regex : "\\/\\/",
95
+ next : "line_comment"
96
+ },
97
+ DocCommentHighlightRules.getStartRule("doc-start"),
98
+ {
99
+ token : "comment", // multi line comment
100
+ regex : /\/\*/,
101
+ next : "comment"
102
+ }, {
103
+ token : "string",
104
+ regex : "'(?=.)",
105
+ next : "qstring"
106
+ }, {
107
+ token : "string",
108
+ regex : '"(?=.)',
109
+ next : "qqstring"
110
+ }, {
111
+ token : "constant.numeric", // hex
112
+ regex : /0[xX][0-9a-fA-F]+\b/
113
+ }, {
114
+ token : "constant.numeric", // float
115
+ regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
116
+ }, {
117
+ token : [
118
+ "storage.type", "punctuation.operator", "support.function",
119
+ "punctuation.operator", "entity.name.function", "text","keyword.operator"
120
+ ],
121
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
122
+ next: "function_arguments"
123
+ }, {
124
+ token : [
125
+ "storage.type", "punctuation.operator", "entity.name.function", "text",
126
+ "keyword.operator", "text", "storage.type", "text", "paren.lparen"
127
+ ],
128
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
129
+ next: "function_arguments"
130
+ }, {
131
+ token : [
132
+ "entity.name.function", "text", "keyword.operator", "text", "storage.type",
133
+ "text", "paren.lparen"
134
+ ],
135
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
136
+ next: "function_arguments"
137
+ }, {
138
+ token : [
139
+ "storage.type", "punctuation.operator", "entity.name.function", "text",
140
+ "keyword.operator", "text",
141
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
142
+ ],
143
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
144
+ next: "function_arguments"
145
+ }, {
146
+ token : [
147
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
148
+ ],
149
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
150
+ next: "function_arguments"
151
+ }, {
152
+ token : [
153
+ "entity.name.function", "text", "punctuation.operator",
154
+ "text", "storage.type", "text", "paren.lparen"
155
+ ],
156
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
157
+ next: "function_arguments"
158
+ }, {
159
+ token : [
160
+ "text", "text", "storage.type", "text", "paren.lparen"
161
+ ],
162
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
163
+ next: "function_arguments"
164
+ }, {
165
+ token : "keyword",
166
+ regex : "(?:" + kwBeforeRe + ")\\b",
167
+ next : "start"
168
+ }, {
169
+ token : ["punctuation.operator", "support.function"],
170
+ regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
171
+ }, {
172
+ token : ["punctuation.operator", "support.function.dom"],
173
+ regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
174
+ }, {
175
+ token : ["punctuation.operator", "support.constant"],
176
+ regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
177
+ }, {
178
+ token : ["support.constant"],
179
+ regex : /that\b/
180
+ }, {
181
+ token : ["storage.type", "punctuation.operator", "support.function.firebug"],
182
+ regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/
183
+ }, {
184
+ token : keywordMapper,
185
+ regex : identifierRe
186
+ }, {
187
+ token : "keyword.operator",
188
+ regex : /--|\+\+|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,
189
+ next : "start"
190
+ }, {
191
+ token : "punctuation.operator",
192
+ regex : /[?:,;.]/,
193
+ next : "start"
194
+ }, {
195
+ token : "paren.lparen",
196
+ regex : /[\[({]/,
197
+ next : "start"
198
+ }, {
199
+ token : "paren.rparen",
200
+ regex : /[\])}]/
201
+ }, {
202
+ token: "comment",
203
+ regex: /^#!.*$/
204
+ }
205
+ ],
206
+ "start": [
207
+ DocCommentHighlightRules.getStartRule("doc-start"),
208
+ {
209
+ token : "comment", // multi line comment
210
+ regex : "\\/\\*",
211
+ next : "comment_regex_allowed"
212
+ }, {
213
+ token : "comment",
214
+ regex : "\\/\\/",
215
+ next : "line_comment_regex_allowed"
216
+ }, {
217
+ token: "string.regexp",
218
+ regex: "\\/",
219
+ next: "regex"
220
+ }, {
221
+ token : "text",
222
+ regex : "\\s+|^$",
223
+ next : "start"
224
+ }, {
225
+ token: "empty",
226
+ regex: "",
227
+ next: "no_regex"
228
+ }
229
+ ],
230
+ "regex": [
231
+ {
232
+ token: "regexp.keyword.operator",
233
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
234
+ }, {
235
+ token: "string.regexp",
236
+ regex: "/[sxngimy]*",
237
+ next: "no_regex"
238
+ }, {
239
+ token : "invalid",
240
+ regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
241
+ }, {
242
+ token : "constant.language.escape",
243
+ regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
244
+ }, {
245
+ token : "constant.language.delimiter",
246
+ regex: /\|/
247
+ }, {
248
+ token: "constant.language.escape",
249
+ regex: /\[\^?/,
250
+ next: "regex_character_class"
251
+ }, {
252
+ token: "empty",
253
+ regex: "$",
254
+ next: "no_regex"
255
+ }, {
256
+ defaultToken: "string.regexp"
257
+ }
258
+ ],
259
+ "regex_character_class": [
260
+ {
261
+ token: "regexp.charclass.keyword.operator",
262
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
263
+ }, {
264
+ token: "constant.language.escape",
265
+ regex: "]",
266
+ next: "regex"
267
+ }, {
268
+ token: "constant.language.escape",
269
+ regex: "-"
270
+ }, {
271
+ token: "empty",
272
+ regex: "$",
273
+ next: "no_regex"
274
+ }, {
275
+ defaultToken: "string.regexp.charachterclass"
276
+ }
277
+ ],
278
+ "function_arguments": [
279
+ {
280
+ token: "variable.parameter",
281
+ regex: identifierRe
282
+ }, {
283
+ token: "punctuation.operator",
284
+ regex: "[, ]+"
285
+ }, {
286
+ token: "punctuation.operator",
287
+ regex: "$"
288
+ }, {
289
+ token: "empty",
290
+ regex: "",
291
+ next: "no_regex"
292
+ }
293
+ ],
294
+ "comment_regex_allowed" : [
295
+ {token : "comment", regex : "\\*\\/", next : "start"},
296
+ {defaultToken : "comment"}
297
+ ],
298
+ "comment" : [
299
+ {token : "comment", regex : "\\*\\/", next : "no_regex"},
300
+ {defaultToken : "comment"}
301
+ ],
302
+ "line_comment_regex_allowed" : [
303
+ {token : "comment", regex : "$|^", next : "start"},
304
+ {defaultToken : "comment"}
305
+ ],
306
+ "line_comment" : [
307
+ {token : "comment", regex : "$|^", next : "no_regex"},
308
+ {defaultToken : "comment"}
309
+ ],
310
+ "qqstring" : [
311
+ {
312
+ token : "constant.language.escape",
313
+ regex : escapedRe
314
+ }, {
315
+ token : "string",
316
+ regex : "\\\\$",
317
+ next : "qqstring"
318
+ }, {
319
+ token : "string",
320
+ regex : '"|$',
321
+ next : "no_regex"
322
+ }, {
323
+ defaultToken: "string"
324
+ }
325
+ ],
326
+ "qstring" : [
327
+ {
328
+ token : "constant.language.escape",
329
+ regex : escapedRe
330
+ }, {
331
+ token : "string",
332
+ regex : "\\\\$",
333
+ next : "qstring"
334
+ }, {
335
+ token : "string",
336
+ regex : "'|$",
337
+ next : "no_regex"
338
+ }, {
339
+ defaultToken: "string"
340
+ }
341
+ ]
342
+ };
343
+
344
+
345
+ if (!options || !options.noES6) {
346
+ this.$rules.no_regex.unshift({
347
+ regex: "[{}]", onMatch: function(val, state, stack) {
348
+ this.next = val == "{" ? this.nextState : "";
349
+ if (val == "{" && stack.length) {
350
+ stack.unshift("start", state);
351
+ return "paren";
352
+ }
353
+ if (val == "}" && stack.length) {
354
+ stack.shift();
355
+ this.next = stack.shift();
356
+ if (this.next.indexOf("string") != -1)
357
+ return "paren.quasi.end";
358
+ }
359
+ return val == "{" ? "paren.lparen" : "paren.rparen";
360
+ },
361
+ nextState: "start"
362
+ }, {
363
+ token : "string.quasi.start",
364
+ regex : /`/,
365
+ push : [{
366
+ token : "constant.language.escape",
367
+ regex : escapedRe
368
+ }, {
369
+ token : "paren.quasi.start",
370
+ regex : /\${/,
371
+ push : "start"
372
+ }, {
373
+ token : "string.quasi.end",
374
+ regex : /`/,
375
+ next : "pop"
376
+ }, {
377
+ defaultToken: "string.quasi"
378
+ }]
379
+ });
380
+ }
381
+
382
+ this.embedRules(DocCommentHighlightRules, "doc-",
383
+ [ DocCommentHighlightRules.getEndRule("no_regex") ]);
384
+
385
+ this.normalizeRules();
386
+ };
387
+
388
+ oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
389
+
390
+ exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
391
+ });
392
+
393
+ define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
394
+ "use strict";
395
+
396
+ var Range = require("../range").Range;
397
+
398
+ var MatchingBraceOutdent = function() {};
399
+
400
+ (function() {
401
+
402
+ this.checkOutdent = function(line, input) {
403
+ if (! /^\s+$/.test(line))
404
+ return false;
405
+
406
+ return /^\s*\}/.test(input);
407
+ };
408
+
409
+ this.autoOutdent = function(doc, row) {
410
+ var line = doc.getLine(row);
411
+ var match = line.match(/^(\s*\})/);
412
+
413
+ if (!match) return 0;
414
+
415
+ var column = match[1].length;
416
+ var openBracePos = doc.findMatchingBracket({row: row, column: column});
417
+
418
+ if (!openBracePos || openBracePos.row == row) return 0;
419
+
420
+ var indent = this.$getIndent(doc.getLine(openBracePos.row));
421
+ doc.replace(new Range(row, 0, row, column-1), indent);
422
+ };
423
+
424
+ this.$getIndent = function(line) {
425
+ return line.match(/^\s*/)[0];
426
+ };
427
+
428
+ }).call(MatchingBraceOutdent.prototype);
429
+
430
+ exports.MatchingBraceOutdent = MatchingBraceOutdent;
431
+ });
432
+
433
+ define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) {
434
+ "use strict";
435
+
436
+ var oop = require("../../lib/oop");
437
+ var Behaviour = require("../behaviour").Behaviour;
438
+ var TokenIterator = require("../../token_iterator").TokenIterator;
439
+ var lang = require("../../lib/lang");
440
+
441
+ var SAFE_INSERT_IN_TOKENS =
442
+ ["text", "paren.rparen", "punctuation.operator"];
443
+ var SAFE_INSERT_BEFORE_TOKENS =
444
+ ["text", "paren.rparen", "punctuation.operator", "comment"];
445
+
446
+ var context;
447
+ var contextCache = {}
448
+ var initContext = function(editor) {
449
+ var id = -1;
450
+ if (editor.multiSelect) {
451
+ id = editor.selection.id;
452
+ if (contextCache.rangeCount != editor.multiSelect.rangeCount)
453
+ contextCache = {rangeCount: editor.multiSelect.rangeCount};
454
+ }
455
+ if (contextCache[id])
456
+ return context = contextCache[id];
457
+ context = contextCache[id] = {
458
+ autoInsertedBrackets: 0,
459
+ autoInsertedRow: -1,
460
+ autoInsertedLineEnd: "",
461
+ maybeInsertedBrackets: 0,
462
+ maybeInsertedRow: -1,
463
+ maybeInsertedLineStart: "",
464
+ maybeInsertedLineEnd: ""
465
+ };
466
+ };
467
+
468
+ var CstyleBehaviour = function() {
469
+ this.add("braces", "insertion", function(state, action, editor, session, text) {
470
+ var cursor = editor.getCursorPosition();
471
+ var line = session.doc.getLine(cursor.row);
472
+ if (text == '{') {
473
+ initContext(editor);
474
+ var selection = editor.getSelectionRange();
475
+ var selected = session.doc.getTextRange(selection);
476
+ if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
477
+ return {
478
+ text: '{' + selected + '}',
479
+ selection: false
480
+ };
481
+ } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
482
+ if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) {
483
+ CstyleBehaviour.recordAutoInsert(editor, session, "}");
484
+ return {
485
+ text: '{}',
486
+ selection: [1, 1]
487
+ };
488
+ } else {
489
+ CstyleBehaviour.recordMaybeInsert(editor, session, "{");
490
+ return {
491
+ text: '{',
492
+ selection: [1, 1]
493
+ };
494
+ }
495
+ }
496
+ } else if (text == '}') {
497
+ initContext(editor);
498
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
499
+ if (rightChar == '}') {
500
+ var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
501
+ if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
502
+ CstyleBehaviour.popAutoInsertedClosing();
503
+ return {
504
+ text: '',
505
+ selection: [1, 1]
506
+ };
507
+ }
508
+ }
509
+ } else if (text == "\n" || text == "\r\n") {
510
+ initContext(editor);
511
+ var closing = "";
512
+ if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {
513
+ closing = lang.stringRepeat("}", context.maybeInsertedBrackets);
514
+ CstyleBehaviour.clearMaybeInsertedClosing();
515
+ }
516
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
517
+ if (rightChar === '}') {
518
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}');
519
+ if (!openBracePos)
520
+ return null;
521
+ var next_indent = this.$getIndent(session.getLine(openBracePos.row));
522
+ } else if (closing) {
523
+ var next_indent = this.$getIndent(line);
524
+ } else {
525
+ CstyleBehaviour.clearMaybeInsertedClosing();
526
+ return;
527
+ }
528
+ var indent = next_indent + session.getTabString();
529
+
530
+ return {
531
+ text: '\n' + indent + '\n' + next_indent + closing,
532
+ selection: [1, indent.length, 1, indent.length]
533
+ };
534
+ } else {
535
+ CstyleBehaviour.clearMaybeInsertedClosing();
536
+ }
537
+ });
538
+
539
+ this.add("braces", "deletion", function(state, action, editor, session, range) {
540
+ var selected = session.doc.getTextRange(range);
541
+ if (!range.isMultiLine() && selected == '{') {
542
+ initContext(editor);
543
+ var line = session.doc.getLine(range.start.row);
544
+ var rightChar = line.substring(range.end.column, range.end.column + 1);
545
+ if (rightChar == '}') {
546
+ range.end.column++;
547
+ return range;
548
+ } else {
549
+ context.maybeInsertedBrackets--;
550
+ }
551
+ }
552
+ });
553
+
554
+ this.add("parens", "insertion", function(state, action, editor, session, text) {
555
+ if (text == '(') {
556
+ initContext(editor);
557
+ var selection = editor.getSelectionRange();
558
+ var selected = session.doc.getTextRange(selection);
559
+ if (selected !== "" && editor.getWrapBehavioursEnabled()) {
560
+ return {
561
+ text: '(' + selected + ')',
562
+ selection: false
563
+ };
564
+ } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
565
+ CstyleBehaviour.recordAutoInsert(editor, session, ")");
566
+ return {
567
+ text: '()',
568
+ selection: [1, 1]
569
+ };
570
+ }
571
+ } else if (text == ')') {
572
+ initContext(editor);
573
+ var cursor = editor.getCursorPosition();
574
+ var line = session.doc.getLine(cursor.row);
575
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
576
+ if (rightChar == ')') {
577
+ var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
578
+ if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
579
+ CstyleBehaviour.popAutoInsertedClosing();
580
+ return {
581
+ text: '',
582
+ selection: [1, 1]
583
+ };
584
+ }
585
+ }
586
+ }
587
+ });
588
+
589
+ this.add("parens", "deletion", function(state, action, editor, session, range) {
590
+ var selected = session.doc.getTextRange(range);
591
+ if (!range.isMultiLine() && selected == '(') {
592
+ initContext(editor);
593
+ var line = session.doc.getLine(range.start.row);
594
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
595
+ if (rightChar == ')') {
596
+ range.end.column++;
597
+ return range;
598
+ }
599
+ }
600
+ });
601
+
602
+ this.add("brackets", "insertion", function(state, action, editor, session, text) {
603
+ if (text == '[') {
604
+ initContext(editor);
605
+ var selection = editor.getSelectionRange();
606
+ var selected = session.doc.getTextRange(selection);
607
+ if (selected !== "" && editor.getWrapBehavioursEnabled()) {
608
+ return {
609
+ text: '[' + selected + ']',
610
+ selection: false
611
+ };
612
+ } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
613
+ CstyleBehaviour.recordAutoInsert(editor, session, "]");
614
+ return {
615
+ text: '[]',
616
+ selection: [1, 1]
617
+ };
618
+ }
619
+ } else if (text == ']') {
620
+ initContext(editor);
621
+ var cursor = editor.getCursorPosition();
622
+ var line = session.doc.getLine(cursor.row);
623
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
624
+ if (rightChar == ']') {
625
+ var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row});
626
+ if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
627
+ CstyleBehaviour.popAutoInsertedClosing();
628
+ return {
629
+ text: '',
630
+ selection: [1, 1]
631
+ };
632
+ }
633
+ }
634
+ }
635
+ });
636
+
637
+ this.add("brackets", "deletion", function(state, action, editor, session, range) {
638
+ var selected = session.doc.getTextRange(range);
639
+ if (!range.isMultiLine() && selected == '[') {
640
+ initContext(editor);
641
+ var line = session.doc.getLine(range.start.row);
642
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
643
+ if (rightChar == ']') {
644
+ range.end.column++;
645
+ return range;
646
+ }
647
+ }
648
+ });
649
+
650
+ this.add("string_dquotes", "insertion", function(state, action, editor, session, text) {
651
+ if (text == '"' || text == "'") {
652
+ initContext(editor);
653
+ var quote = text;
654
+ var selection = editor.getSelectionRange();
655
+ var selected = session.doc.getTextRange(selection);
656
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
657
+ return {
658
+ text: quote + selected + quote,
659
+ selection: false
660
+ };
661
+ } else {
662
+ var cursor = editor.getCursorPosition();
663
+ var line = session.doc.getLine(cursor.row);
664
+ var leftChar = line.substring(cursor.column-1, cursor.column);
665
+ if (leftChar == '\\') {
666
+ return null;
667
+ }
668
+ var tokens = session.getTokens(selection.start.row);
669
+ var col = 0, token;
670
+ var quotepos = -1; // Track whether we're inside an open quote.
671
+
672
+ for (var x = 0; x < tokens.length; x++) {
673
+ token = tokens[x];
674
+ if (token.type == "string") {
675
+ quotepos = -1;
676
+ } else if (quotepos < 0) {
677
+ quotepos = token.value.indexOf(quote);
678
+ }
679
+ if ((token.value.length + col) > selection.start.column) {
680
+ break;
681
+ }
682
+ col += tokens[x].value.length;
683
+ }
684
+ if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) {
685
+ if (!CstyleBehaviour.isSaneInsertion(editor, session))
686
+ return;
687
+ return {
688
+ text: quote + quote,
689
+ selection: [1,1]
690
+ };
691
+ } else if (token && token.type === "string") {
692
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
693
+ if (rightChar == quote) {
694
+ return {
695
+ text: '',
696
+ selection: [1, 1]
697
+ };
698
+ }
699
+ }
700
+ }
701
+ }
702
+ });
703
+
704
+ this.add("string_dquotes", "deletion", function(state, action, editor, session, range) {
705
+ var selected = session.doc.getTextRange(range);
706
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
707
+ initContext(editor);
708
+ var line = session.doc.getLine(range.start.row);
709
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
710
+ if (rightChar == selected) {
711
+ range.end.column++;
712
+ return range;
713
+ }
714
+ }
715
+ });
716
+
717
+ };
718
+
719
+
720
+ CstyleBehaviour.isSaneInsertion = function(editor, session) {
721
+ var cursor = editor.getCursorPosition();
722
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
723
+ if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
724
+ var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
725
+ if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
726
+ return false;
727
+ }
728
+ iterator.stepForward();
729
+ return iterator.getCurrentTokenRow() !== cursor.row ||
730
+ this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
731
+ };
732
+
733
+ CstyleBehaviour.$matchTokenType = function(token, types) {
734
+ return types.indexOf(token.type || token) > -1;
735
+ };
736
+
737
+ CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
738
+ var cursor = editor.getCursorPosition();
739
+ var line = session.doc.getLine(cursor.row);
740
+ if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0]))
741
+ context.autoInsertedBrackets = 0;
742
+ context.autoInsertedRow = cursor.row;
743
+ context.autoInsertedLineEnd = bracket + line.substr(cursor.column);
744
+ context.autoInsertedBrackets++;
745
+ };
746
+
747
+ CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
748
+ var cursor = editor.getCursorPosition();
749
+ var line = session.doc.getLine(cursor.row);
750
+ if (!this.isMaybeInsertedClosing(cursor, line))
751
+ context.maybeInsertedBrackets = 0;
752
+ context.maybeInsertedRow = cursor.row;
753
+ context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
754
+ context.maybeInsertedLineEnd = line.substr(cursor.column);
755
+ context.maybeInsertedBrackets++;
756
+ };
757
+
758
+ CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
759
+ return context.autoInsertedBrackets > 0 &&
760
+ cursor.row === context.autoInsertedRow &&
761
+ bracket === context.autoInsertedLineEnd[0] &&
762
+ line.substr(cursor.column) === context.autoInsertedLineEnd;
763
+ };
764
+
765
+ CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
766
+ return context.maybeInsertedBrackets > 0 &&
767
+ cursor.row === context.maybeInsertedRow &&
768
+ line.substr(cursor.column) === context.maybeInsertedLineEnd &&
769
+ line.substr(0, cursor.column) == context.maybeInsertedLineStart;
770
+ };
771
+
772
+ CstyleBehaviour.popAutoInsertedClosing = function() {
773
+ context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1);
774
+ context.autoInsertedBrackets--;
775
+ };
776
+
777
+ CstyleBehaviour.clearMaybeInsertedClosing = function() {
778
+ if (context) {
779
+ context.maybeInsertedBrackets = 0;
780
+ context.maybeInsertedRow = -1;
781
+ }
782
+ };
783
+
784
+
785
+
786
+ oop.inherits(CstyleBehaviour, Behaviour);
787
+
788
+ exports.CstyleBehaviour = CstyleBehaviour;
789
+ });
790
+
791
+ define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
792
+ "use strict";
793
+
794
+ var oop = require("../../lib/oop");
795
+ var Range = require("../../range").Range;
796
+ var BaseFoldMode = require("./fold_mode").FoldMode;
797
+
798
+ var FoldMode = exports.FoldMode = function(commentRegex) {
799
+ if (commentRegex) {
800
+ this.foldingStartMarker = new RegExp(
801
+ this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
802
+ );
803
+ this.foldingStopMarker = new RegExp(
804
+ this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
805
+ );
806
+ }
807
+ };
808
+ oop.inherits(FoldMode, BaseFoldMode);
809
+
810
+ (function() {
811
+
812
+ this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
813
+ this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
814
+
815
+ this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
816
+ var line = session.getLine(row);
817
+ var match = line.match(this.foldingStartMarker);
818
+ if (match) {
819
+ var i = match.index;
820
+
821
+ if (match[1])
822
+ return this.openingBracketBlock(session, match[1], row, i);
823
+
824
+ var range = session.getCommentFoldRange(row, i + match[0].length, 1);
825
+
826
+ if (range && !range.isMultiLine()) {
827
+ if (forceMultiline) {
828
+ range = this.getSectionRange(session, row);
829
+ } else if (foldStyle != "all")
830
+ range = null;
831
+ }
832
+
833
+ return range;
834
+ }
835
+
836
+ if (foldStyle === "markbegin")
837
+ return;
838
+
839
+ var match = line.match(this.foldingStopMarker);
840
+ if (match) {
841
+ var i = match.index + match[0].length;
842
+
843
+ if (match[1])
844
+ return this.closingBracketBlock(session, match[1], row, i);
845
+
846
+ return session.getCommentFoldRange(row, i, -1);
847
+ }
848
+ };
849
+
850
+ this.getSectionRange = function(session, row) {
851
+ var line = session.getLine(row);
852
+ var startIndent = line.search(/\S/);
853
+ var startRow = row;
854
+ var startColumn = line.length;
855
+ row = row + 1;
856
+ var endRow = row;
857
+ var maxRow = session.getLength();
858
+ while (++row < maxRow) {
859
+ line = session.getLine(row);
860
+ var indent = line.search(/\S/);
861
+ if (indent === -1)
862
+ continue;
863
+ if (startIndent > indent)
864
+ break;
865
+ var subRange = this.getFoldWidgetRange(session, "all", row);
866
+
867
+ if (subRange) {
868
+ if (subRange.start.row <= startRow) {
869
+ break;
870
+ } else if (subRange.isMultiLine()) {
871
+ row = subRange.end.row;
872
+ } else if (startIndent == indent) {
873
+ break;
874
+ }
875
+ }
876
+ endRow = row;
877
+ }
878
+
879
+ return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
880
+ };
881
+
882
+ }).call(FoldMode.prototype);
883
+
884
+ });
885
+
886
+ define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","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) {
887
+ "use strict";
888
+
889
+ var oop = require("../lib/oop");
890
+ var TextMode = require("./text").Mode;
891
+ var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
892
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
893
+ var Range = require("../range").Range;
894
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
895
+ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
896
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
897
+
898
+ var Mode = function() {
899
+ this.HighlightRules = JavaScriptHighlightRules;
900
+
901
+ this.$outdent = new MatchingBraceOutdent();
902
+ this.$behaviour = new CstyleBehaviour();
903
+ this.foldingRules = new CStyleFoldMode();
904
+ };
905
+ oop.inherits(Mode, TextMode);
906
+
907
+ (function() {
908
+
909
+ this.lineCommentStart = "//";
910
+ this.blockComment = {start: "/*", end: "*/"};
911
+
912
+ this.getNextLineIndent = function(state, line, tab) {
913
+ var indent = this.$getIndent(line);
914
+
915
+ var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
916
+ var tokens = tokenizedLine.tokens;
917
+ var endState = tokenizedLine.state;
918
+
919
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
920
+ return indent;
921
+ }
922
+
923
+ if (state == "start" || state == "no_regex") {
924
+ var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
925
+ if (match) {
926
+ indent += tab;
927
+ }
928
+ } else if (state == "doc-start") {
929
+ if (endState == "start" || endState == "no_regex") {
930
+ return "";
931
+ }
932
+ var match = line.match(/^\s*(\/?)\*/);
933
+ if (match) {
934
+ if (match[1]) {
935
+ indent += " ";
936
+ }
937
+ indent += "* ";
938
+ }
939
+ }
940
+
941
+ return indent;
942
+ };
943
+
944
+ this.checkOutdent = function(state, line, input) {
945
+ return this.$outdent.checkOutdent(line, input);
946
+ };
947
+
948
+ this.autoOutdent = function(state, doc, row) {
949
+ this.$outdent.autoOutdent(doc, row);
950
+ };
951
+
952
+ this.createWorker = function(session) {
953
+ var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
954
+ worker.attachToDocument(session.getDocument());
955
+
956
+ worker.on("jslint", function(results) {
957
+ session.setAnnotations(results.data);
958
+ });
959
+
960
+ worker.on("terminate", function() {
961
+ session.clearAnnotations();
962
+ });
963
+
964
+ return worker;
965
+ };
966
+
967
+ this.$id = "ace/mode/javascript";
968
+ }).call(Mode.prototype);
969
+
970
+ exports.Mode = Mode;
971
+ });
972
+
973
+ define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) {
974
+ "use strict";
975
+
976
+ var oop = require("../lib/oop");
977
+ var lang = require("../lib/lang");
978
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
979
+ var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index";
980
+ var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
981
+ var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero";
982
+ var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow";
983
+ var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace";
984
+
985
+ var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
986
+ var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
987
+ var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
988
+
989
+ var CssHighlightRules = function() {
990
+
991
+ var keywordMapper = this.createKeywordMapper({
992
+ "support.function": supportFunction,
993
+ "support.constant": supportConstant,
994
+ "support.type": supportType,
995
+ "support.constant.color": supportConstantColor,
996
+ "support.constant.fonts": supportConstantFonts
997
+ }, "text", true);
998
+
999
+ this.$rules = {
1000
+ "start" : [{
1001
+ token : "comment", // multi line comment
1002
+ regex : "\\/\\*",
1003
+ push : "comment"
1004
+ }, {
1005
+ token: "paren.lparen",
1006
+ regex: "\\{",
1007
+ push: "ruleset"
1008
+ }, {
1009
+ token: "string",
1010
+ regex: "@.*?{",
1011
+ push: "media"
1012
+ }, {
1013
+ token: "keyword",
1014
+ regex: "#[a-z0-9-_]+"
1015
+ }, {
1016
+ token: "variable",
1017
+ regex: "\\.[a-z0-9-_]+"
1018
+ }, {
1019
+ token: "string",
1020
+ regex: ":[a-z0-9-_]+"
1021
+ }, {
1022
+ token: "constant",
1023
+ regex: "[a-z0-9-_]+"
1024
+ }, {
1025
+ caseInsensitive: true
1026
+ }],
1027
+
1028
+ "media" : [{
1029
+ token : "comment", // multi line comment
1030
+ regex : "\\/\\*",
1031
+ push : "comment"
1032
+ }, {
1033
+ token: "paren.lparen",
1034
+ regex: "\\{",
1035
+ push: "ruleset"
1036
+ }, {
1037
+ token: "string",
1038
+ regex: "\\}",
1039
+ next: "pop"
1040
+ }, {
1041
+ token: "keyword",
1042
+ regex: "#[a-z0-9-_]+"
1043
+ }, {
1044
+ token: "variable",
1045
+ regex: "\\.[a-z0-9-_]+"
1046
+ }, {
1047
+ token: "string",
1048
+ regex: ":[a-z0-9-_]+"
1049
+ }, {
1050
+ token: "constant",
1051
+ regex: "[a-z0-9-_]+"
1052
+ }, {
1053
+ caseInsensitive: true
1054
+ }],
1055
+
1056
+ "comment" : [{
1057
+ token : "comment",
1058
+ regex : "\\*\\/",
1059
+ next : "pop"
1060
+ }, {
1061
+ defaultToken : "comment"
1062
+ }],
1063
+
1064
+ "ruleset" : [
1065
+ {
1066
+ token : "paren.rparen",
1067
+ regex : "\\}",
1068
+ next: "pop"
1069
+ }, {
1070
+ token : "comment", // multi line comment
1071
+ regex : "\\/\\*",
1072
+ push : "comment"
1073
+ }, {
1074
+ token : "string", // single line
1075
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
1076
+ }, {
1077
+ token : "string", // single line
1078
+ regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
1079
+ }, {
1080
+ token : ["constant.numeric", "keyword"],
1081
+ regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)"
1082
+ }, {
1083
+ token : "constant.numeric",
1084
+ regex : numRe
1085
+ }, {
1086
+ token : "constant.numeric", // hex6 color
1087
+ regex : "#[a-f0-9]{6}"
1088
+ }, {
1089
+ token : "constant.numeric", // hex3 color
1090
+ regex : "#[a-f0-9]{3}"
1091
+ }, {
1092
+ token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
1093
+ regex : pseudoElements
1094
+ }, {
1095
+ token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
1096
+ regex : pseudoClasses
1097
+ }, {
1098
+ token : ["support.function", "string", "support.function"],
1099
+ regex : "(url\\()(.*)(\\))"
1100
+ }, {
1101
+ token : keywordMapper,
1102
+ regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
1103
+ }, {
1104
+ caseInsensitive: true
1105
+ }]
1106
+ };
1107
+
1108
+ this.normalizeRules();
1109
+ };
1110
+
1111
+ oop.inherits(CssHighlightRules, TextHighlightRules);
1112
+
1113
+ exports.CssHighlightRules = CssHighlightRules;
1114
+
1115
+ });
1116
+
1117
+ define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) {
1118
+ "use strict";
1119
+
1120
+ var oop = require("../../lib/oop");
1121
+ var Behaviour = require("../behaviour").Behaviour;
1122
+ var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
1123
+ var TokenIterator = require("../../token_iterator").TokenIterator;
1124
+
1125
+ var CssBehaviour = function () {
1126
+
1127
+ this.inherit(CstyleBehaviour);
1128
+
1129
+ this.add("colon", "insertion", function (state, action, editor, session, text) {
1130
+ if (text === ':') {
1131
+ var cursor = editor.getCursorPosition();
1132
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
1133
+ var token = iterator.getCurrentToken();
1134
+ if (token && token.value.match(/\s+/)) {
1135
+ token = iterator.stepBackward();
1136
+ }
1137
+ if (token && token.type === 'support.type') {
1138
+ var line = session.doc.getLine(cursor.row);
1139
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
1140
+ if (rightChar === ':') {
1141
+ return {
1142
+ text: '',
1143
+ selection: [1, 1]
1144
+ }
1145
+ }
1146
+ if (!line.substring(cursor.column).match(/^\s*;/)) {
1147
+ return {
1148
+ text: ':;',
1149
+ selection: [1, 1]
1150
+ }
1151
+ }
1152
+ }
1153
+ }
1154
+ });
1155
+
1156
+ this.add("colon", "deletion", function (state, action, editor, session, range) {
1157
+ var selected = session.doc.getTextRange(range);
1158
+ if (!range.isMultiLine() && selected === ':') {
1159
+ var cursor = editor.getCursorPosition();
1160
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
1161
+ var token = iterator.getCurrentToken();
1162
+ if (token && token.value.match(/\s+/)) {
1163
+ token = iterator.stepBackward();
1164
+ }
1165
+ if (token && token.type === 'support.type') {
1166
+ var line = session.doc.getLine(range.start.row);
1167
+ var rightChar = line.substring(range.end.column, range.end.column + 1);
1168
+ if (rightChar === ';') {
1169
+ range.end.column ++;
1170
+ return range;
1171
+ }
1172
+ }
1173
+ }
1174
+ });
1175
+
1176
+ this.add("semicolon", "insertion", function (state, action, editor, session, text) {
1177
+ if (text === ';') {
1178
+ var cursor = editor.getCursorPosition();
1179
+ var line = session.doc.getLine(cursor.row);
1180
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
1181
+ if (rightChar === ';') {
1182
+ return {
1183
+ text: '',
1184
+ selection: [1, 1]
1185
+ }
1186
+ }
1187
+ }
1188
+ });
1189
+
1190
+ }
1191
+ oop.inherits(CssBehaviour, CstyleBehaviour);
1192
+
1193
+ exports.CssBehaviour = CssBehaviour;
1194
+ });
1195
+
1196
+ define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) {
1197
+ "use strict";
1198
+
1199
+ var oop = require("../lib/oop");
1200
+ var TextMode = require("./text").Mode;
1201
+ var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
1202
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
1203
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
1204
+ var CssBehaviour = require("./behaviour/css").CssBehaviour;
1205
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
1206
+
1207
+ var Mode = function() {
1208
+ this.HighlightRules = CssHighlightRules;
1209
+ this.$outdent = new MatchingBraceOutdent();
1210
+ this.$behaviour = new CssBehaviour();
1211
+ this.foldingRules = new CStyleFoldMode();
1212
+ };
1213
+ oop.inherits(Mode, TextMode);
1214
+
1215
+ (function() {
1216
+
1217
+ this.foldingRules = "cStyle";
1218
+ this.blockComment = {start: "/*", end: "*/"};
1219
+
1220
+ this.getNextLineIndent = function(state, line, tab) {
1221
+ var indent = this.$getIndent(line);
1222
+ var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
1223
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
1224
+ return indent;
1225
+ }
1226
+
1227
+ var match = line.match(/^.*\{\s*$/);
1228
+ if (match) {
1229
+ indent += tab;
1230
+ }
1231
+
1232
+ return indent;
1233
+ };
1234
+
1235
+ this.checkOutdent = function(state, line, input) {
1236
+ return this.$outdent.checkOutdent(line, input);
1237
+ };
1238
+
1239
+ this.autoOutdent = function(state, doc, row) {
1240
+ this.$outdent.autoOutdent(doc, row);
1241
+ };
1242
+
1243
+ this.createWorker = function(session) {
1244
+ var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
1245
+ worker.attachToDocument(session.getDocument());
1246
+
1247
+ worker.on("csslint", function(e) {
1248
+ session.setAnnotations(e.data);
1249
+ });
1250
+
1251
+ worker.on("terminate", function() {
1252
+ session.clearAnnotations();
1253
+ });
1254
+
1255
+ return worker;
1256
+ };
1257
+
1258
+ this.$id = "ace/mode/css";
1259
+ }).call(Mode.prototype);
1260
+
1261
+ exports.Mode = Mode;
1262
+
1263
+ });
1264
+
1265
+ define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
1266
+ "use strict";
1267
+
1268
+ var oop = require("../lib/oop");
1269
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1270
+
1271
+ var XmlHighlightRules = function(normalize) {
1272
+ this.$rules = {
1273
+ start : [
1274
+ {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"},
1275
+ {
1276
+ token : ["punctuation.xml-decl.xml", "keyword.xml-decl.xml"],
1277
+ regex : "(<\\?)(xml)(?=[\\s])", next : "xml_decl", caseInsensitive: true
1278
+ },
1279
+ {
1280
+ token : ["punctuation.instruction.xml", "keyword.instruction.xml"],
1281
+ regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "processing_instruction",
1282
+ },
1283
+ {token : "comment.xml", regex : "<\\!--", next : "comment"},
1284
+ {
1285
+ token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"],
1286
+ regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true
1287
+ },
1288
+ {include : "tag"},
1289
+ {token : "text.end-tag-open.xml", regex: "</"},
1290
+ {token : "text.tag-open.xml", regex: "<"},
1291
+ {include : "reference"},
1292
+ {defaultToken : "text.xml"}
1293
+ ],
1294
+
1295
+ xml_decl : [{
1296
+ token : "entity.other.attribute-name.decl-attribute-name.xml",
1297
+ regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+"
1298
+ }, {
1299
+ token : "keyword.operator.decl-attribute-equals.xml",
1300
+ regex : "="
1301
+ }, {
1302
+ include: "whitespace"
1303
+ }, {
1304
+ include: "string"
1305
+ }, {
1306
+ token : "punctuation.xml-decl.xml",
1307
+ regex : "\\?>",
1308
+ next : "start"
1309
+ }],
1310
+
1311
+ processing_instruction : [
1312
+ {token : "punctuation.instruction.xml", regex : "\\?>", next : "start"},
1313
+ {defaultToken : "instruction.xml"}
1314
+ ],
1315
+
1316
+ doctype : [
1317
+ {include : "whitespace"},
1318
+ {include : "string"},
1319
+ {token : "xml-pe.doctype.xml", regex : ">", next : "start"},
1320
+ {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"},
1321
+ {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"}
1322
+ ],
1323
+
1324
+ int_subset : [{
1325
+ token : "text.xml",
1326
+ regex : "\\s+"
1327
+ }, {
1328
+ token: "punctuation.int-subset.xml",
1329
+ regex: "]",
1330
+ next: "pop"
1331
+ }, {
1332
+ token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
1333
+ regex : "(<\\!)([-_a-zA-Z0-9]+)",
1334
+ push : [{
1335
+ token : "text",
1336
+ regex : "\\s+"
1337
+ },
1338
+ {
1339
+ token : "punctuation.markup-decl.xml",
1340
+ regex : ">",
1341
+ next : "pop"
1342
+ },
1343
+ {include : "string"}]
1344
+ }],
1345
+
1346
+ cdata : [
1347
+ {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"},
1348
+ {token : "text.xml", regex : "\\s+"},
1349
+ {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"}
1350
+ ],
1351
+
1352
+ comment : [
1353
+ {token : "comment.xml", regex : "-->", next : "start"},
1354
+ {defaultToken : "comment.xml"}
1355
+ ],
1356
+
1357
+ reference : [{
1358
+ token : "constant.language.escape.reference.xml",
1359
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
1360
+ }],
1361
+
1362
+ attr_reference : [{
1363
+ token : "constant.language.escape.reference.attribute-value.xml",
1364
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
1365
+ }],
1366
+
1367
+ tag : [{
1368
+ token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
1369
+ regex : "(?:(<)|(</))((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)",
1370
+ next: [
1371
+ {include : "attributes"},
1372
+ {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
1373
+ ]
1374
+ }],
1375
+
1376
+ tag_whitespace : [
1377
+ {token : "text.tag-whitespace.xml", regex : "\\s+"}
1378
+ ],
1379
+ whitespace : [
1380
+ {token : "text.whitespace.xml", regex : "\\s+"}
1381
+ ],
1382
+ string: [{
1383
+ token : "string.xml",
1384
+ regex : "'",
1385
+ push : [
1386
+ {token : "string.xml", regex: "'", next: "pop"},
1387
+ {defaultToken : "string.xml"}
1388
+ ]
1389
+ }, {
1390
+ token : "string.xml",
1391
+ regex : '"',
1392
+ push : [
1393
+ {token : "string.xml", regex: '"', next: "pop"},
1394
+ {defaultToken : "string.xml"}
1395
+ ]
1396
+ }],
1397
+
1398
+ attributes: [{
1399
+ token : "entity.other.attribute-name.xml",
1400
+ regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+"
1401
+ }, {
1402
+ token : "keyword.operator.attribute-equals.xml",
1403
+ regex : "="
1404
+ }, {
1405
+ include: "tag_whitespace"
1406
+ }, {
1407
+ include: "attribute_value"
1408
+ }],
1409
+
1410
+ attribute_value: [{
1411
+ token : "string.attribute-value.xml",
1412
+ regex : "'",
1413
+ push : [
1414
+ {token : "string.attribute-value.xml", regex: "'", next: "pop"},
1415
+ {include : "attr_reference"},
1416
+ {defaultToken : "string.attribute-value.xml"}
1417
+ ]
1418
+ }, {
1419
+ token : "string.attribute-value.xml",
1420
+ regex : '"',
1421
+ push : [
1422
+ {token : "string.attribute-value.xml", regex: '"', next: "pop"},
1423
+ {include : "attr_reference"},
1424
+ {defaultToken : "string.attribute-value.xml"}
1425
+ ]
1426
+ }]
1427
+ };
1428
+
1429
+ if (this.constructor === XmlHighlightRules)
1430
+ this.normalizeRules();
1431
+ };
1432
+
1433
+
1434
+ (function() {
1435
+
1436
+ this.embedTagRules = function(HighlightRules, prefix, tag){
1437
+ this.$rules.tag.unshift({
1438
+ token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
1439
+ regex : "(<)(" + tag + "(?=\\s|>|$))",
1440
+ next: [
1441
+ {include : "attributes"},
1442
+ {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"}
1443
+ ]
1444
+ });
1445
+
1446
+ this.$rules[tag + "-end"] = [
1447
+ {include : "attributes"},
1448
+ {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start",
1449
+ onMatch : function(value, currentState, stack) {
1450
+ stack.splice(0);
1451
+ return this.token;
1452
+ }}
1453
+ ]
1454
+
1455
+ this.embedRules(HighlightRules, prefix, [{
1456
+ token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
1457
+ regex : "(</)(" + tag + "(?=\\s|>|$))",
1458
+ next: tag + "-end"
1459
+ }, {
1460
+ token: "string.cdata.xml",
1461
+ regex : "<\\!\\[CDATA\\["
1462
+ }, {
1463
+ token: "string.cdata.xml",
1464
+ regex : "\\]\\]>"
1465
+ }]);
1466
+ };
1467
+
1468
+ }).call(TextHighlightRules.prototype);
1469
+
1470
+ oop.inherits(XmlHighlightRules, TextHighlightRules);
1471
+
1472
+ exports.XmlHighlightRules = XmlHighlightRules;
1473
+ });
1474
+
1475
+ define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module) {
1476
+ "use strict";
1477
+
1478
+ var oop = require("../lib/oop");
1479
+ var lang = require("../lib/lang");
1480
+ var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
1481
+ var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
1482
+ var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
1483
+
1484
+ var tagMap = lang.createMap({
1485
+ a : 'anchor',
1486
+ button : 'form',
1487
+ form : 'form',
1488
+ img : 'image',
1489
+ input : 'form',
1490
+ label : 'form',
1491
+ option : 'form',
1492
+ script : 'script',
1493
+ select : 'form',
1494
+ textarea : 'form',
1495
+ style : 'style',
1496
+ table : 'table',
1497
+ tbody : 'table',
1498
+ td : 'table',
1499
+ tfoot : 'table',
1500
+ th : 'table',
1501
+ tr : 'table'
1502
+ });
1503
+
1504
+ var HtmlHighlightRules = function() {
1505
+ XmlHighlightRules.call(this);
1506
+
1507
+ this.addRules({
1508
+ attributes: [{
1509
+ include : "tag_whitespace"
1510
+ }, {
1511
+ token : "entity.other.attribute-name.xml",
1512
+ regex : "[-_a-zA-Z0-9:]+"
1513
+ }, {
1514
+ token : "keyword.operator.attribute-equals.xml",
1515
+ regex : "=",
1516
+ push : [{
1517
+ include: "tag_whitespace"
1518
+ }, {
1519
+ token : "string.unquoted.attribute-value.html",
1520
+ regex : "[^<>='\"`\\s]+",
1521
+ next : "pop"
1522
+ }, {
1523
+ token : "empty",
1524
+ regex : "",
1525
+ next : "pop"
1526
+ }]
1527
+ }, {
1528
+ include : "attribute_value"
1529
+ }],
1530
+ tag: [{
1531
+ token : function(start, tag) {
1532
+ var group = tagMap[tag];
1533
+ return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml",
1534
+ "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"];
1535
+ },
1536
+ regex : "(</?)([-_a-zA-Z0-9:]+)",
1537
+ next: "tag_stuff"
1538
+ }],
1539
+ tag_stuff: [
1540
+ {include : "attributes"},
1541
+ {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
1542
+ ],
1543
+ });
1544
+
1545
+ this.embedTagRules(CssHighlightRules, "css-", "style");
1546
+ this.embedTagRules(JavaScriptHighlightRules, "js-", "script");
1547
+
1548
+ if (this.constructor === HtmlHighlightRules)
1549
+ this.normalizeRules();
1550
+ };
1551
+
1552
+ oop.inherits(HtmlHighlightRules, XmlHighlightRules);
1553
+
1554
+ exports.HtmlHighlightRules = HtmlHighlightRules;
1555
+ });
1556
+
1557
+ define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module) {
1558
+ "use strict";
1559
+
1560
+ var oop = require("../../lib/oop");
1561
+ var Behaviour = require("../behaviour").Behaviour;
1562
+ var TokenIterator = require("../../token_iterator").TokenIterator;
1563
+
1564
+ function is(token, type) {
1565
+ return token.type.lastIndexOf(type + ".xml") > -1;
1566
+ }
1567
+
1568
+ var XmlBehaviour = function () {
1569
+
1570
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
1571
+ if (text == '"' || text == "'") {
1572
+ var quote = text;
1573
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
1574
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
1575
+ return {
1576
+ text: quote + selected + quote,
1577
+ selection: false
1578
+ };
1579
+ }
1580
+
1581
+ var cursor = editor.getCursorPosition();
1582
+ var line = session.doc.getLine(cursor.row);
1583
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
1584
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
1585
+ var token = iterator.getCurrentToken();
1586
+
1587
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
1588
+ return {
1589
+ text: "",
1590
+ selection: [1, 1]
1591
+ };
1592
+ }
1593
+
1594
+ if (!token)
1595
+ token = iterator.stepBackward();
1596
+
1597
+ if (!token)
1598
+ return;
1599
+
1600
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
1601
+ token = iterator.stepBackward();
1602
+ }
1603
+ var rightSpace = !rightChar || rightChar.match(/\s/);
1604
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
1605
+ return {
1606
+ text: quote + quote,
1607
+ selection: [1, 1]
1608
+ };
1609
+ }
1610
+ }
1611
+ });
1612
+
1613
+ this.add("string_dquotes", "deletion", function(state, action, editor, session, range) {
1614
+ var selected = session.doc.getTextRange(range);
1615
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
1616
+ var line = session.doc.getLine(range.start.row);
1617
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
1618
+ if (rightChar == selected) {
1619
+ range.end.column++;
1620
+ return range;
1621
+ }
1622
+ }
1623
+ });
1624
+
1625
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
1626
+ if (text == '>') {
1627
+ var position = editor.getCursorPosition();
1628
+ var iterator = new TokenIterator(session, position.row, position.column);
1629
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
1630
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
1631
+ return;
1632
+ if (is(token, "reference.attribute-value"))
1633
+ return;
1634
+ if (is(token, "attribute-value")) {
1635
+ var firstChar = token.value.charAt(0);
1636
+ if (firstChar == '"' || firstChar == "'") {
1637
+ var lastChar = token.value.charAt(token.value.length - 1);
1638
+ var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length;
1639
+ if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar)
1640
+ return;
1641
+ }
1642
+ }
1643
+ while (!is(token, "tag-name")) {
1644
+ token = iterator.stepBackward();
1645
+ }
1646
+
1647
+ var tokenRow = iterator.getCurrentTokenRow();
1648
+ var tokenColumn = iterator.getCurrentTokenColumn();
1649
+ if (is(iterator.stepBackward(), "end-tag-open"))
1650
+ return;
1651
+
1652
+ var element = token.value;
1653
+ if (tokenRow == position.row)
1654
+ element = element.substring(0, position.column - tokenColumn);
1655
+
1656
+ if (this.voidElements.hasOwnProperty(element.toLowerCase()))
1657
+ return;
1658
+
1659
+ return {
1660
+ text: '>' + '</' + element + '>',
1661
+ selection: [1, 1]
1662
+ };
1663
+ }
1664
+ });
1665
+
1666
+ this.add('autoindent', 'insertion', function (state, action, editor, session, text) {
1667
+ if (text == "\n") {
1668
+ var cursor = editor.getCursorPosition();
1669
+ var line = session.getLine(cursor.row);
1670
+ var rightChars = line.substring(cursor.column, cursor.column + 2);
1671
+ if (rightChars == '</') {
1672
+ var next_indent = this.$getIndent(line);
1673
+ var indent = next_indent + session.getTabString();
1674
+
1675
+ return {
1676
+ text: '\n' + indent + '\n' + next_indent,
1677
+ selection: [1, indent.length, 1, indent.length]
1678
+ };
1679
+ }
1680
+ }
1681
+ });
1682
+
1683
+ };
1684
+
1685
+ oop.inherits(XmlBehaviour, Behaviour);
1686
+
1687
+ exports.XmlBehaviour = XmlBehaviour;
1688
+ });
1689
+
1690
+ define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module) {
1691
+ "use strict";
1692
+
1693
+ var oop = require("../../lib/oop");
1694
+ var BaseFoldMode = require("./fold_mode").FoldMode;
1695
+
1696
+ var FoldMode = exports.FoldMode = function(defaultMode, subModes) {
1697
+ this.defaultMode = defaultMode;
1698
+ this.subModes = subModes;
1699
+ };
1700
+ oop.inherits(FoldMode, BaseFoldMode);
1701
+
1702
+ (function() {
1703
+
1704
+
1705
+ this.$getMode = function(state) {
1706
+ if (typeof state != "string")
1707
+ state = state[0];
1708
+ for (var key in this.subModes) {
1709
+ if (state.indexOf(key) === 0)
1710
+ return this.subModes[key];
1711
+ }
1712
+ return null;
1713
+ };
1714
+
1715
+ this.$tryMode = function(state, session, foldStyle, row) {
1716
+ var mode = this.$getMode(state);
1717
+ return (mode ? mode.getFoldWidget(session, foldStyle, row) : "");
1718
+ };
1719
+
1720
+ this.getFoldWidget = function(session, foldStyle, row) {
1721
+ return (
1722
+ this.$tryMode(session.getState(row-1), session, foldStyle, row) ||
1723
+ this.$tryMode(session.getState(row), session, foldStyle, row) ||
1724
+ this.defaultMode.getFoldWidget(session, foldStyle, row)
1725
+ );
1726
+ };
1727
+
1728
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
1729
+ var mode = this.$getMode(session.getState(row-1));
1730
+
1731
+ if (!mode || !mode.getFoldWidget(session, foldStyle, row))
1732
+ mode = this.$getMode(session.getState(row));
1733
+
1734
+ if (!mode || !mode.getFoldWidget(session, foldStyle, row))
1735
+ mode = this.defaultMode;
1736
+
1737
+ return mode.getFoldWidgetRange(session, foldStyle, row);
1738
+ };
1739
+
1740
+ }).call(FoldMode.prototype);
1741
+
1742
+ });
1743
+
1744
+ 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) {
1745
+ "use strict";
1746
+
1747
+ var oop = require("../../lib/oop");
1748
+ var lang = require("../../lib/lang");
1749
+ var Range = require("../../range").Range;
1750
+ var BaseFoldMode = require("./fold_mode").FoldMode;
1751
+ var TokenIterator = require("../../token_iterator").TokenIterator;
1752
+
1753
+ var FoldMode = exports.FoldMode = function(voidElements, optionalEndTags) {
1754
+ BaseFoldMode.call(this);
1755
+ this.voidElements = voidElements || {};
1756
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
1757
+ if (optionalEndTags)
1758
+ oop.mixin(this.optionalEndTags, optionalEndTags);
1759
+
1760
+ };
1761
+ oop.inherits(FoldMode, BaseFoldMode);
1762
+
1763
+ var Tag = function() {
1764
+ this.tagName = "";
1765
+ this.closing = false;
1766
+ this.selfClosing = false;
1767
+ this.start = {row: 0, column: 0};
1768
+ this.end = {row: 0, column: 0};
1769
+ };
1770
+
1771
+ function is(token, type) {
1772
+ return token.type.lastIndexOf(type + ".xml") > -1;
1773
+ }
1774
+
1775
+ (function() {
1776
+
1777
+ this.getFoldWidget = function(session, foldStyle, row) {
1778
+ var tag = this._getFirstTagInLine(session, row);
1779
+
1780
+ if (!tag)
1781
+ return "";
1782
+
1783
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
1784
+ return foldStyle == "markbeginend" ? "end" : "";
1785
+
1786
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
1787
+ return "";
1788
+
1789
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
1790
+ return "";
1791
+
1792
+ return "start";
1793
+ };
1794
+ this._getFirstTagInLine = function(session, row) {
1795
+ var tokens = session.getTokens(row);
1796
+ var tag = new Tag();
1797
+
1798
+ for (var i = 0; i < tokens.length; i++) {
1799
+ var token = tokens[i];
1800
+ if (is(token, "tag-open")) {
1801
+ tag.end.column = tag.start.column + token.value.length;
1802
+ tag.closing = is(token, "end-tag-open");
1803
+ token = tokens[++i];
1804
+ if (!token)
1805
+ return null;
1806
+ tag.tagName = token.value;
1807
+ tag.end.column += token.value.length;
1808
+ for (i++; i < tokens.length; i++) {
1809
+ token = tokens[i];
1810
+ tag.end.column += token.value.length;
1811
+ if (is(token, "tag-close")) {
1812
+ tag.selfClosing = token.value == '/>';
1813
+ break;
1814
+ }
1815
+ }
1816
+ return tag;
1817
+ } else if (is(token, "tag-close")) {
1818
+ tag.selfClosing = token.value == '/>';
1819
+ return tag;
1820
+ }
1821
+ tag.start.column += token.value.length;
1822
+ }
1823
+
1824
+ return null;
1825
+ };
1826
+
1827
+ this._findEndTagInLine = function(session, row, tagName, startColumn) {
1828
+ var tokens = session.getTokens(row);
1829
+ var column = 0;
1830
+ for (var i = 0; i < tokens.length; i++) {
1831
+ var token = tokens[i];
1832
+ column += token.value.length;
1833
+ if (column < startColumn)
1834
+ continue;
1835
+ if (is(token, "end-tag-open")) {
1836
+ token = tokens[i + 1];
1837
+ if (token && token.value == tagName)
1838
+ return true;
1839
+ }
1840
+ }
1841
+ return false;
1842
+ };
1843
+ this._readTagForward = function(iterator) {
1844
+ var token = iterator.getCurrentToken();
1845
+ if (!token)
1846
+ return null;
1847
+
1848
+ var tag = new Tag();
1849
+ do {
1850
+ if (is(token, "tag-open")) {
1851
+ tag.closing = is(token, "end-tag-open");
1852
+ tag.start.row = iterator.getCurrentTokenRow();
1853
+ tag.start.column = iterator.getCurrentTokenColumn();
1854
+ } else if (is(token, "tag-name")) {
1855
+ tag.tagName = token.value;
1856
+ } else if (is(token, "tag-close")) {
1857
+ tag.selfClosing = token.value == "/>";
1858
+ tag.end.row = iterator.getCurrentTokenRow();
1859
+ tag.end.column = iterator.getCurrentTokenColumn() + token.value.length;
1860
+ iterator.stepForward();
1861
+ return tag;
1862
+ }
1863
+ } while(token = iterator.stepForward());
1864
+
1865
+ return null;
1866
+ };
1867
+
1868
+ this._readTagBackward = function(iterator) {
1869
+ var token = iterator.getCurrentToken();
1870
+ if (!token)
1871
+ return null;
1872
+
1873
+ var tag = new Tag();
1874
+ do {
1875
+ if (is(token, "tag-open")) {
1876
+ tag.closing = is(token, "end-tag-open");
1877
+ tag.start.row = iterator.getCurrentTokenRow();
1878
+ tag.start.column = iterator.getCurrentTokenColumn();
1879
+ iterator.stepBackward();
1880
+ return tag;
1881
+ } else if (is(token, "tag-name")) {
1882
+ tag.tagName = token.value;
1883
+ } else if (is(token, "tag-close")) {
1884
+ tag.selfClosing = token.value == "/>";
1885
+ tag.end.row = iterator.getCurrentTokenRow();
1886
+ tag.end.column = iterator.getCurrentTokenColumn() + token.value.length;
1887
+ }
1888
+ } while(token = iterator.stepBackward());
1889
+
1890
+ return null;
1891
+ };
1892
+
1893
+ this._pop = function(stack, tag) {
1894
+ while (stack.length) {
1895
+
1896
+ var top = stack[stack.length-1];
1897
+ if (!tag || top.tagName == tag.tagName) {
1898
+ return stack.pop();
1899
+ }
1900
+ else if (this.optionalEndTags.hasOwnProperty(tag.tagName)) {
1901
+ return;
1902
+ }
1903
+ else if (this.optionalEndTags.hasOwnProperty(top.tagName)) {
1904
+ stack.pop();
1905
+ continue;
1906
+ } else {
1907
+ return null;
1908
+ }
1909
+ }
1910
+ };
1911
+
1912
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
1913
+ var firstTag = this._getFirstTagInLine(session, row);
1914
+
1915
+ if (!firstTag)
1916
+ return null;
1917
+
1918
+ var isBackward = firstTag.closing || firstTag.selfClosing;
1919
+ var stack = [];
1920
+ var tag;
1921
+
1922
+ if (!isBackward) {
1923
+ var iterator = new TokenIterator(session, row, firstTag.start.column);
1924
+ var start = {
1925
+ row: row,
1926
+ column: firstTag.start.column + firstTag.tagName.length + 2
1927
+ };
1928
+ while (tag = this._readTagForward(iterator)) {
1929
+ if (tag.selfClosing) {
1930
+ if (!stack.length) {
1931
+ tag.start.column += tag.tagName.length + 2;
1932
+ tag.end.column -= 2;
1933
+ return Range.fromPoints(tag.start, tag.end);
1934
+ } else
1935
+ continue;
1936
+ }
1937
+
1938
+ if (tag.closing) {
1939
+ this._pop(stack, tag);
1940
+ if (stack.length == 0)
1941
+ return Range.fromPoints(start, tag.start);
1942
+ }
1943
+ else {
1944
+ stack.push(tag);
1945
+ }
1946
+ }
1947
+ }
1948
+ else {
1949
+ var iterator = new TokenIterator(session, row, firstTag.end.column);
1950
+ var end = {
1951
+ row: row,
1952
+ column: firstTag.start.column
1953
+ };
1954
+
1955
+ while (tag = this._readTagBackward(iterator)) {
1956
+ if (tag.selfClosing) {
1957
+ if (!stack.length) {
1958
+ tag.start.column += tag.tagName.length + 2;
1959
+ tag.end.column -= 2;
1960
+ return Range.fromPoints(tag.start, tag.end);
1961
+ } else
1962
+ continue;
1963
+ }
1964
+
1965
+ if (!tag.closing) {
1966
+ this._pop(stack, tag);
1967
+ if (stack.length == 0) {
1968
+ tag.start.column += tag.tagName.length + 2;
1969
+ return Range.fromPoints(tag.start, end);
1970
+ }
1971
+ }
1972
+ else {
1973
+ stack.push(tag);
1974
+ }
1975
+ }
1976
+ }
1977
+
1978
+ };
1979
+
1980
+ }).call(FoldMode.prototype);
1981
+
1982
+ });
1983
+
1984
+ 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) {
1985
+ "use strict";
1986
+
1987
+ var oop = require("../../lib/oop");
1988
+ var MixedFoldMode = require("./mixed").FoldMode;
1989
+ var XmlFoldMode = require("./xml").FoldMode;
1990
+ var CStyleFoldMode = require("./cstyle").FoldMode;
1991
+
1992
+ var FoldMode = exports.FoldMode = function(voidElements, optionalTags) {
1993
+ MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), {
1994
+ "js-": new CStyleFoldMode(),
1995
+ "css-": new CStyleFoldMode()
1996
+ });
1997
+ };
1998
+
1999
+ oop.inherits(FoldMode, MixedFoldMode);
2000
+
2001
+ });
2002
+
2003
+ define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module) {
2004
+ "use strict";
2005
+
2006
+ var TokenIterator = require("../token_iterator").TokenIterator;
2007
+
2008
+ var commonAttributes = [
2009
+ "accesskey",
2010
+ "class",
2011
+ "contenteditable",
2012
+ "contextmenu",
2013
+ "dir",
2014
+ "draggable",
2015
+ "dropzone",
2016
+ "hidden",
2017
+ "id",
2018
+ "inert",
2019
+ "itemid",
2020
+ "itemprop",
2021
+ "itemref",
2022
+ "itemscope",
2023
+ "itemtype",
2024
+ "lang",
2025
+ "spellcheck",
2026
+ "style",
2027
+ "tabindex",
2028
+ "title",
2029
+ "translate"
2030
+ ];
2031
+
2032
+ var eventAttributes = [
2033
+ "onabort",
2034
+ "onblur",
2035
+ "oncancel",
2036
+ "oncanplay",
2037
+ "oncanplaythrough",
2038
+ "onchange",
2039
+ "onclick",
2040
+ "onclose",
2041
+ "oncontextmenu",
2042
+ "oncuechange",
2043
+ "ondblclick",
2044
+ "ondrag",
2045
+ "ondragend",
2046
+ "ondragenter",
2047
+ "ondragleave",
2048
+ "ondragover",
2049
+ "ondragstart",
2050
+ "ondrop",
2051
+ "ondurationchange",
2052
+ "onemptied",
2053
+ "onended",
2054
+ "onerror",
2055
+ "onfocus",
2056
+ "oninput",
2057
+ "oninvalid",
2058
+ "onkeydown",
2059
+ "onkeypress",
2060
+ "onkeyup",
2061
+ "onload",
2062
+ "onloadeddata",
2063
+ "onloadedmetadata",
2064
+ "onloadstart",
2065
+ "onmousedown",
2066
+ "onmousemove",
2067
+ "onmouseout",
2068
+ "onmouseover",
2069
+ "onmouseup",
2070
+ "onmousewheel",
2071
+ "onpause",
2072
+ "onplay",
2073
+ "onplaying",
2074
+ "onprogress",
2075
+ "onratechange",
2076
+ "onreset",
2077
+ "onscroll",
2078
+ "onseeked",
2079
+ "onseeking",
2080
+ "onselect",
2081
+ "onshow",
2082
+ "onstalled",
2083
+ "onsubmit",
2084
+ "onsuspend",
2085
+ "ontimeupdate",
2086
+ "onvolumechange",
2087
+ "onwaiting"
2088
+ ];
2089
+
2090
+ var globalAttributes = commonAttributes.concat(eventAttributes);
2091
+
2092
+ var attributeMap = {
2093
+ "html": ["manifest"],
2094
+ "head": [],
2095
+ "title": [],
2096
+ "base": ["href", "target"],
2097
+ "link": ["href", "hreflang", "rel", "media", "type", "sizes"],
2098
+ "meta": ["http-equiv", "name", "content", "charset"],
2099
+ "style": ["type", "media", "scoped"],
2100
+ "script": ["charset", "type", "src", "defer", "async"],
2101
+ "noscript": ["href"],
2102
+ "body": ["onafterprint", "onbeforeprint", "onbeforeunload", "onhashchange", "onmessage", "onoffline", "onpopstate", "onredo", "onresize", "onstorage", "onundo", "onunload"],
2103
+ "section": [],
2104
+ "nav": [],
2105
+ "article": ["pubdate"],
2106
+ "aside": [],
2107
+ "h1": [],
2108
+ "h2": [],
2109
+ "h3": [],
2110
+ "h4": [],
2111
+ "h5": [],
2112
+ "h6": [],
2113
+ "header": [],
2114
+ "footer": [],
2115
+ "address": [],
2116
+ "main": [],
2117
+ "p": [],
2118
+ "hr": [],
2119
+ "pre": [],
2120
+ "blockquote": ["cite"],
2121
+ "ol": ["start", "reversed"],
2122
+ "ul": [],
2123
+ "li": ["value"],
2124
+ "dl": [],
2125
+ "dt": [],
2126
+ "dd": [],
2127
+ "figure": [],
2128
+ "figcaption": [],
2129
+ "div": [],
2130
+ "a": ["href", "target", "ping", "rel", "media", "hreflang", "type"],
2131
+ "em": [],
2132
+ "strong": [],
2133
+ "small": [],
2134
+ "s": [],
2135
+ "cite": [],
2136
+ "q": ["cite"],
2137
+ "dfn": [],
2138
+ "abbr": [],
2139
+ "data": [],
2140
+ "time": ["datetime"],
2141
+ "code": [],
2142
+ "var": [],
2143
+ "samp": [],
2144
+ "kbd": [],
2145
+ "sub": [],
2146
+ "sup": [],
2147
+ "i": [],
2148
+ "b": [],
2149
+ "u": [],
2150
+ "mark": [],
2151
+ "ruby": [],
2152
+ "rt": [],
2153
+ "rp": [],
2154
+ "bdi": [],
2155
+ "bdo": [],
2156
+ "span": [],
2157
+ "br": [],
2158
+ "wbr": [],
2159
+ "ins": ["cite", "datetime"],
2160
+ "del": ["cite", "datetime"],
2161
+ "img": ["alt", "src", "height", "width", "usemap", "ismap"],
2162
+ "iframe": ["name", "src", "height", "width", "sandbox", "seamless"],
2163
+ "embed": ["src", "height", "width", "type"],
2164
+ "object": ["param", "data", "type", "height" , "width", "usemap", "name", "form", "classid"],
2165
+ "param": ["name", "value"],
2166
+ "video": ["src", "autobuffer", "autoplay", "loop", "controls", "width", "height", "poster"],
2167
+ "audio": ["src", "autobuffer", "autoplay", "loop", "controls"],
2168
+ "source": ["src", "type", "media"],
2169
+ "track": ["kind", "src", "srclang", "label", "default"],
2170
+ "canvas": ["width", "height"],
2171
+ "map": ["name"],
2172
+ "area": ["shape", "coords", "href", "hreflang", "alt", "target", "media", "rel", "ping", "type"],
2173
+ "svg": [],
2174
+ "math": [],
2175
+ "table": ["summary"],
2176
+ "caption": [],
2177
+ "colgroup": ["span"],
2178
+ "col": ["span"],
2179
+ "tbody": [],
2180
+ "thead": [],
2181
+ "tfoot": [],
2182
+ "tr": [],
2183
+ "td": ["headers", "rowspan", "colspan"],
2184
+ "th": ["headers", "rowspan", "colspan", "scope"],
2185
+ "form": ["accept-charset", "action", "autocomplete", "enctype", "method", "name", "novalidate", "target"],
2186
+ "fieldset": ["disabled", "form", "name"],
2187
+ "legend": [],
2188
+ "label": ["form", "for"],
2189
+ "input": ["type", "accept", "alt", "autocomplete", "checked", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "height", "list", "max", "maxlength", "min", "multiple", "pattern", "placeholder", "readonly", "required", "size", "src", "step", "width", "files", "value"],
2190
+ "button": ["autofocus", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "name", "value", "type"],
2191
+ "select": ["autofocus", "disabled", "form", "multiple", "name", "size"],
2192
+ "datalist": [],
2193
+ "optgroup": ["disabled", "label"],
2194
+ "option": ["disabled", "selected", "label", "value"],
2195
+ "textarea": ["autofocus", "disabled", "form", "maxlength", "name", "placeholder", "readonly", "required", "rows", "cols", "wrap"],
2196
+ "keygen": ["autofocus", "challenge", "disabled", "form", "keytype", "name"],
2197
+ "output": ["for", "form", "name"],
2198
+ "progress": ["value", "max"],
2199
+ "meter": ["value", "min", "max", "low", "high", "optimum"],
2200
+ "details": ["open"],
2201
+ "summary": [],
2202
+ "command": ["type", "label", "icon", "disabled", "checked", "radiogroup", "command"],
2203
+ "menu": ["type", "label"],
2204
+ "dialog": ["open"]
2205
+ };
2206
+
2207
+ var elements = Object.keys(attributeMap);
2208
+
2209
+ function is(token, type) {
2210
+ return token.type.lastIndexOf(type + ".xml") > -1;
2211
+ }
2212
+
2213
+ function findTagName(session, pos) {
2214
+ var iterator = new TokenIterator(session, pos.row, pos.column);
2215
+ var token = iterator.getCurrentToken();
2216
+ while (token && !is(token, "tag-name")){
2217
+ token = iterator.stepBackward();
2218
+ }
2219
+ if (token)
2220
+ return token.value;
2221
+ }
2222
+
2223
+ var HtmlCompletions = function() {
2224
+
2225
+ };
2226
+
2227
+ (function() {
2228
+
2229
+ this.getCompletions = function(state, session, pos, prefix) {
2230
+ var token = session.getTokenAt(pos.row, pos.column);
2231
+
2232
+ if (!token)
2233
+ return [];
2234
+ if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open"))
2235
+ return this.getTagCompletions(state, session, pos, prefix);
2236
+ if (is(token, "tag-whitespace") || is(token, "attribute-name"))
2237
+ return this.getAttributeCompetions(state, session, pos, prefix);
2238
+
2239
+ return [];
2240
+ };
2241
+
2242
+ this.getTagCompletions = function(state, session, pos, prefix) {
2243
+ return elements.map(function(element){
2244
+ return {
2245
+ value: element,
2246
+ meta: "tag",
2247
+ score: Number.MAX_VALUE
2248
+ };
2249
+ });
2250
+ };
2251
+
2252
+ this.getAttributeCompetions = function(state, session, pos, prefix) {
2253
+ var tagName = findTagName(session, pos);
2254
+ if (!tagName)
2255
+ return [];
2256
+ var attributes = globalAttributes;
2257
+ if (tagName in attributeMap) {
2258
+ attributes = attributes.concat(attributeMap[tagName]);
2259
+ }
2260
+ return attributes.map(function(attribute){
2261
+ return {
2262
+ caption: attribute,
2263
+ snippet: attribute + '="$0"',
2264
+ meta: "attribute",
2265
+ score: Number.MAX_VALUE
2266
+ };
2267
+ });
2268
+ };
2269
+
2270
+ }).call(HtmlCompletions.prototype);
2271
+
2272
+ exports.HtmlCompletions = HtmlCompletions;
2273
+ });
2274
+
2275
+ define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"], function(require, exports, module) {
2276
+ "use strict";
2277
+
2278
+ var oop = require("../lib/oop");
2279
+ var lang = require("../lib/lang");
2280
+ var TextMode = require("./text").Mode;
2281
+ var JavaScriptMode = require("./javascript").Mode;
2282
+ var CssMode = require("./css").Mode;
2283
+ var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
2284
+ var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
2285
+ var HtmlFoldMode = require("./folding/html").FoldMode;
2286
+ var HtmlCompletions = require("./html_completions").HtmlCompletions;
2287
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
2288
+ var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"];
2289
+ var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"];
2290
+
2291
+ var Mode = function(options) {
2292
+ this.fragmentContext = options && options.fragmentContext;
2293
+ this.HighlightRules = HtmlHighlightRules;
2294
+ this.$behaviour = new XmlBehaviour();
2295
+ this.$completer = new HtmlCompletions();
2296
+
2297
+ this.createModeDelegates({
2298
+ "js-": JavaScriptMode,
2299
+ "css-": CssMode
2300
+ });
2301
+
2302
+ this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags));
2303
+ };
2304
+ oop.inherits(Mode, TextMode);
2305
+
2306
+ (function() {
2307
+
2308
+ this.blockComment = {start: "<!--", end: "-->"};
2309
+
2310
+ this.voidElements = lang.arrayToMap(voidElements);
2311
+
2312
+ this.getNextLineIndent = function(state, line, tab) {
2313
+ return this.$getIndent(line);
2314
+ };
2315
+
2316
+ this.checkOutdent = function(state, line, input) {
2317
+ return false;
2318
+ };
2319
+
2320
+ this.getCompletions = function(state, session, pos, prefix) {
2321
+ return this.$completer.getCompletions(state, session, pos, prefix);
2322
+ };
2323
+
2324
+ this.createWorker = function(session) {
2325
+ if (this.constructor != Mode)
2326
+ return;
2327
+ var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker");
2328
+ worker.attachToDocument(session.getDocument());
2329
+
2330
+ if (this.fragmentContext)
2331
+ worker.call("setOptions", [{context: this.fragmentContext}]);
2332
+
2333
+ worker.on("error", function(e) {
2334
+ session.setAnnotations(e.data);
2335
+ });
2336
+
2337
+ worker.on("terminate", function() {
2338
+ session.clearAnnotations();
2339
+ });
2340
+
2341
+ return worker;
2342
+ };
2343
+
2344
+ this.$id = "ace/mode/html";
2345
+ }).call(Mode.prototype);
2346
+
2347
+ exports.Mode = Mode;
2348
+ });
2349
+
2350
+ define("ace/mode/smarty_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/html_highlight_rules"], function(require, exports, module) {
2351
+ "use strict";
2352
+
2353
+ var oop = require("../lib/oop");
2354
+ var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
2355
+
2356
+ var SmartyHighlightRules = function() {
2357
+ HtmlHighlightRules.call(this);
2358
+ var smartyRules = { start:
2359
+ [ { include: '#comments' },
2360
+ { include: '#blocks' } ],
2361
+ '#blocks':
2362
+ [ { token: 'punctuation.section.embedded.begin.smarty',
2363
+ regex: '\\{%?',
2364
+ push:
2365
+ [ { token: 'punctuation.section.embedded.end.smarty',
2366
+ regex: '%?\\}',
2367
+ next: 'pop' },
2368
+ { include: '#strings' },
2369
+ { include: '#variables' },
2370
+ { include: '#lang' },
2371
+ { defaultToken: 'source.smarty' } ] } ],
2372
+ '#comments':
2373
+ [ { token:
2374
+ [ 'punctuation.definition.comment.smarty',
2375
+ 'comment.block.smarty' ],
2376
+ regex: '(\\{%?)(\\*)',
2377
+ push:
2378
+ [ { token: 'comment.block.smarty', regex: '\\*%?\\}', next: 'pop' },
2379
+ { defaultToken: 'comment.block.smarty' } ] } ],
2380
+ '#lang':
2381
+ [ { token: 'keyword.operator.smarty',
2382
+ regex: '(?:!=|!|<=|>=|<|>|===|==|%|&&|\\|\\|)|\\b(?:and|or|eq|neq|ne|gte|gt|ge|lte|lt|le|not|mod)\\b' },
2383
+ { token: 'constant.language.smarty',
2384
+ regex: '\\b(?:TRUE|FALSE|true|false)\\b' },
2385
+ { token: 'keyword.control.smarty',
2386
+ regex: '\\b(?:if|else|elseif|foreach|foreachelse|section|switch|case|break|default)\\b' },
2387
+ { token: 'variable.parameter.smarty', regex: '\\b[a-zA-Z]+=' },
2388
+ { token: 'support.function.built-in.smarty',
2389
+ regex: '\\b(?:capture|config_load|counter|cycle|debug|eval|fetch|include_php|include|insert|literal|math|strip|rdelim|ldelim|assign|constant|block|html_[a-z_]*)\\b' },
2390
+ { token: 'support.function.variable-modifier.smarty',
2391
+ regex: '\\|(?:capitalize|cat|count_characters|count_paragraphs|count_sentences|count_words|date_format|default|escape|indent|lower|nl2br|regex_replace|replace|spacify|string_format|strip_tags|strip|truncate|upper|wordwrap)' } ],
2392
+ '#strings':
2393
+ [ { token: 'punctuation.definition.string.begin.smarty',
2394
+ regex: '\'',
2395
+ push:
2396
+ [ { token: 'punctuation.definition.string.end.smarty',
2397
+ regex: '\'',
2398
+ next: 'pop' },
2399
+ { token: 'constant.character.escape.smarty', regex: '\\\\.' },
2400
+ { defaultToken: 'string.quoted.single.smarty' } ] },
2401
+ { token: 'punctuation.definition.string.begin.smarty',
2402
+ regex: '"',
2403
+ push:
2404
+ [ { token: 'punctuation.definition.string.end.smarty',
2405
+ regex: '"',
2406
+ next: 'pop' },
2407
+ { token: 'constant.character.escape.smarty', regex: '\\\\.' },
2408
+ { defaultToken: 'string.quoted.double.smarty' } ] } ],
2409
+ '#variables':
2410
+ [ { token:
2411
+ [ 'punctuation.definition.variable.smarty',
2412
+ 'variable.other.global.smarty' ],
2413
+ regex: '\\b(\\$)(Smarty\\.)' },
2414
+ { token:
2415
+ [ 'punctuation.definition.variable.smarty',
2416
+ 'variable.other.smarty' ],
2417
+ regex: '(\\$)([a-zA-Z_][a-zA-Z0-9_]*)\\b' },
2418
+ { token: [ 'keyword.operator.smarty', 'variable.other.property.smarty' ],
2419
+ regex: '(->)([a-zA-Z_][a-zA-Z0-9_]*)\\b' },
2420
+ { token:
2421
+ [ 'keyword.operator.smarty',
2422
+ 'meta.function-call.object.smarty',
2423
+ 'punctuation.definition.variable.smarty',
2424
+ 'variable.other.smarty',
2425
+ 'punctuation.definition.variable.smarty' ],
2426
+ regex: '(->)([a-zA-Z_][a-zA-Z0-9_]*)(\\()(.*?)(\\))' } ] }
2427
+
2428
+ var smartyStart = smartyRules.start;
2429
+
2430
+ for (var rule in this.$rules) {
2431
+ this.$rules[rule].unshift.apply(this.$rules[rule], smartyStart);
2432
+ }
2433
+
2434
+ Object.keys(smartyRules).forEach(function(x) {
2435
+ if (!this.$rules[x])
2436
+ this.$rules[x] = smartyRules[x];
2437
+ }, this);
2438
+
2439
+ this.normalizeRules();
2440
+ };
2441
+
2442
+ SmartyHighlightRules.metaData = { fileTypes: [ 'tpl' ],
2443
+ foldingStartMarker: '\\{%?',
2444
+ foldingStopMarker: '%?\\}',
2445
+ name: 'Smarty',
2446
+ scopeName: 'text.html.smarty' }
2447
+
2448
+
2449
+ oop.inherits(SmartyHighlightRules, HtmlHighlightRules);
2450
+
2451
+ exports.SmartyHighlightRules = SmartyHighlightRules;
2452
+ });
2453
+
2454
+ define("ace/mode/smarty",["require","exports","module","ace/lib/oop","ace/mode/html","ace/mode/smarty_highlight_rules"], function(require, exports, module) {
2455
+ "use strict";
2456
+
2457
+ var oop = require("../lib/oop");
2458
+ var HtmlMode = require("./html").Mode;
2459
+ var SmartyHighlightRules = require("./smarty_highlight_rules").SmartyHighlightRules;
2460
+
2461
+ var Mode = function() {
2462
+ HtmlMode.call(this);
2463
+ this.HighlightRules = SmartyHighlightRules;
2464
+ };
2465
+
2466
+ oop.inherits(Mode, HtmlMode);
2467
+
2468
+ (function() {
2469
+
2470
+ this.$id = "ace/mode/smarty";
2471
+ }).call(Mode.prototype);
2472
+
2473
+ exports.Mode = Mode;
2474
+ });