ace-rails-ap 0.0.3 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (267) hide show
  1. data/lib/ace/rails/version.rb +1 -1
  2. data/vendor/assets/javascripts/ace.js +15680 -1
  3. data/vendor/assets/javascripts/keybinding-emacs.js +367 -1
  4. data/vendor/assets/javascripts/keybinding-vim.js +1635 -1
  5. data/vendor/assets/javascripts/mode-c9search.js +275 -0
  6. data/vendor/assets/javascripts/mode-c_cpp.js +744 -1
  7. data/vendor/assets/javascripts/mode-clojure.js +364 -1
  8. data/vendor/assets/javascripts/mode-coffee.js +527 -1
  9. data/vendor/assets/javascripts/mode-coldfusion.js +1966 -1
  10. data/vendor/assets/javascripts/mode-csharp.js +633 -1
  11. data/vendor/assets/javascripts/mode-css.js +499 -1
  12. data/vendor/assets/javascripts/mode-diff.js +250 -0
  13. data/vendor/assets/javascripts/{mode-c_cpp-uncompressed.js → mode-glsl.js} +147 -244
  14. data/vendor/assets/javascripts/mode-golang.js +681 -1
  15. data/vendor/assets/javascripts/mode-groovy.js +1240 -1
  16. data/vendor/assets/javascripts/mode-haxe.js +633 -1
  17. data/vendor/assets/javascripts/mode-html.js +2064 -1
  18. data/vendor/assets/javascripts/mode-java.js +1202 -1
  19. data/vendor/assets/javascripts/mode-javascript.js +1069 -1
  20. data/vendor/assets/javascripts/mode-json.js +588 -1
  21. data/vendor/assets/javascripts/{mode-haxe-uncompressed.js → mode-jsx.js} +189 -312
  22. data/vendor/assets/javascripts/mode-latex.js +95 -1
  23. data/vendor/assets/javascripts/mode-less.js +512 -1
  24. data/vendor/assets/javascripts/mode-liquid.js +1125 -1
  25. data/vendor/assets/javascripts/mode-lua.js +551 -1
  26. data/vendor/assets/javascripts/{mode-html-uncompressed.js → mode-luahtml.js} +544 -604
  27. data/vendor/assets/javascripts/{mode-coldfusion-uncompressed.js → mode-luapage.js} +2326 -2180
  28. data/vendor/assets/javascripts/mode-markdown.js +2369 -1
  29. data/vendor/assets/javascripts/mode-ocaml.js +464 -1
  30. data/vendor/assets/javascripts/mode-perl.js +432 -1
  31. data/vendor/assets/javascripts/mode-pgsql.js +970 -1
  32. data/vendor/assets/javascripts/mode-php.js +1718 -1
  33. data/vendor/assets/javascripts/mode-powershell.js +610 -1
  34. data/vendor/assets/javascripts/mode-python.js +397 -1
  35. data/vendor/assets/javascripts/mode-ruby.js +318 -1
  36. data/vendor/assets/javascripts/mode-scad.js +732 -1
  37. data/vendor/assets/javascripts/mode-scala.js +1237 -1
  38. data/vendor/assets/javascripts/mode-scss.js +537 -1
  39. data/vendor/assets/javascripts/mode-sh.js +250 -1
  40. data/vendor/assets/javascripts/mode-sql.js +140 -1
  41. data/vendor/assets/javascripts/mode-svg.js +1681 -1
  42. data/vendor/assets/javascripts/mode-tcl.js +320 -0
  43. data/vendor/assets/javascripts/mode-textile.js +182 -1
  44. data/vendor/assets/javascripts/mode-xml.js +829 -1
  45. data/vendor/assets/javascripts/mode-xquery.js +605 -1
  46. data/vendor/assets/javascripts/mode-yaml.js +189 -0
  47. data/vendor/assets/javascripts/theme-chrome.js +213 -1
  48. data/vendor/assets/javascripts/theme-clouds.js +167 -1
  49. data/vendor/assets/javascripts/theme-clouds_midnight.js +168 -1
  50. data/vendor/assets/javascripts/theme-cobalt.js +194 -1
  51. data/vendor/assets/javascripts/theme-crimson_editor.js +200 -1
  52. data/vendor/assets/javascripts/theme-dawn.js +198 -1
  53. data/vendor/assets/javascripts/theme-dreamweaver.js +230 -1
  54. data/vendor/assets/javascripts/theme-eclipse.js +157 -1
  55. data/vendor/assets/javascripts/theme-github.js +182 -0
  56. data/vendor/assets/javascripts/theme-idle_fingers.js +186 -1
  57. data/vendor/assets/javascripts/theme-kr_theme.js +189 -1
  58. data/vendor/assets/javascripts/theme-merbivore.js +189 -1
  59. data/vendor/assets/javascripts/theme-merbivore_soft.js +195 -1
  60. data/vendor/assets/javascripts/theme-mono_industrial.js +197 -1
  61. data/vendor/assets/javascripts/theme-monokai.js +194 -1
  62. data/vendor/assets/javascripts/theme-pastel_on_dark.js +199 -1
  63. data/vendor/assets/javascripts/theme-solarized_dark.js +180 -1
  64. data/vendor/assets/javascripts/theme-solarized_light.js +179 -1
  65. data/vendor/assets/javascripts/theme-textmate.js +216 -0
  66. data/vendor/assets/javascripts/theme-tomorrow.js +213 -1
  67. data/vendor/assets/javascripts/theme-tomorrow_night.js +213 -1
  68. data/vendor/assets/javascripts/theme-tomorrow_night_blue.js +213 -1
  69. data/vendor/assets/javascripts/theme-tomorrow_night_bright.js +213 -1
  70. data/vendor/assets/javascripts/theme-tomorrow_night_eighties.js +209 -1
  71. data/vendor/assets/javascripts/theme-twilight.js +211 -1
  72. data/vendor/assets/javascripts/theme-vibrant_ink.js +190 -1
  73. data/vendor/assets/javascripts/worker-coffee.js +83 -893
  74. data/vendor/assets/javascripts/worker-css.js +88 -1402
  75. data/vendor/assets/javascripts/worker-javascript.js +97 -812
  76. data/vendor/assets/javascripts/worker-json.js +84 -761
  77. data/vendor/assets/javascripts/worker-xquery.js +66464 -0
  78. metadata +12 -195
  79. data/vendor/assets/javascripts/ace-compat-noconflict.js +0 -1
  80. data/vendor/assets/javascripts/ace-compat-uncompressed-noconflict.js +0 -480
  81. data/vendor/assets/javascripts/ace-compat-uncompressed.js +0 -480
  82. data/vendor/assets/javascripts/ace-compat.js +0 -1
  83. data/vendor/assets/javascripts/ace-noconflict.js +0 -10
  84. data/vendor/assets/javascripts/ace-uncompressed-noconflict.js +0 -19976
  85. data/vendor/assets/javascripts/ace-uncompressed.js +0 -19976
  86. data/vendor/assets/javascripts/keybinding-emacs-noconflict.js +0 -1
  87. data/vendor/assets/javascripts/keybinding-emacs-uncompressed-noconflict.js +0 -150
  88. data/vendor/assets/javascripts/keybinding-emacs-uncompressed.js +0 -150
  89. data/vendor/assets/javascripts/keybinding-vim-noconflict.js +0 -1
  90. data/vendor/assets/javascripts/keybinding-vim-uncompressed-noconflict.js +0 -138
  91. data/vendor/assets/javascripts/keybinding-vim-uncompressed.js +0 -138
  92. data/vendor/assets/javascripts/mode-c_cpp-noconflict.js +0 -1
  93. data/vendor/assets/javascripts/mode-c_cpp-uncompressed-noconflict.js +0 -919
  94. data/vendor/assets/javascripts/mode-clojure-noconflict.js +0 -1
  95. data/vendor/assets/javascripts/mode-clojure-uncompressed-noconflict.js +0 -422
  96. data/vendor/assets/javascripts/mode-clojure-uncompressed.js +0 -422
  97. data/vendor/assets/javascripts/mode-coffee-noconflict.js +0 -1
  98. data/vendor/assets/javascripts/mode-coffee-uncompressed-noconflict.js +0 -607
  99. data/vendor/assets/javascripts/mode-coffee-uncompressed.js +0 -607
  100. data/vendor/assets/javascripts/mode-coldfusion-noconflict.js +0 -1
  101. data/vendor/assets/javascripts/mode-coldfusion-uncompressed-noconflict.js +0 -2458
  102. data/vendor/assets/javascripts/mode-csharp-noconflict.js +0 -1
  103. data/vendor/assets/javascripts/mode-csharp-uncompressed-noconflict.js +0 -769
  104. data/vendor/assets/javascripts/mode-csharp-uncompressed.js +0 -769
  105. data/vendor/assets/javascripts/mode-css-noconflict.js +0 -1
  106. data/vendor/assets/javascripts/mode-css-uncompressed-noconflict.js +0 -641
  107. data/vendor/assets/javascripts/mode-css-uncompressed.js +0 -641
  108. data/vendor/assets/javascripts/mode-golang-noconflict.js +0 -1
  109. data/vendor/assets/javascripts/mode-golang-uncompressed-noconflict.js +0 -378
  110. data/vendor/assets/javascripts/mode-golang-uncompressed.js +0 -378
  111. data/vendor/assets/javascripts/mode-groovy-noconflict.js +0 -1
  112. data/vendor/assets/javascripts/mode-groovy-uncompressed-noconflict.js +0 -1393
  113. data/vendor/assets/javascripts/mode-groovy-uncompressed.js +0 -1393
  114. data/vendor/assets/javascripts/mode-haxe-noconflict.js +0 -1
  115. data/vendor/assets/javascripts/mode-haxe-uncompressed-noconflict.js +0 -769
  116. data/vendor/assets/javascripts/mode-html-noconflict.js +0 -1
  117. data/vendor/assets/javascripts/mode-html-uncompressed-noconflict.js +0 -2475
  118. data/vendor/assets/javascripts/mode-java-noconflict.js +0 -1
  119. data/vendor/assets/javascripts/mode-java-uncompressed-noconflict.js +0 -1395
  120. data/vendor/assets/javascripts/mode-java-uncompressed.js +0 -1395
  121. data/vendor/assets/javascripts/mode-javascript-noconflict.js +0 -1
  122. data/vendor/assets/javascripts/mode-javascript-uncompressed-noconflict.js +0 -1226
  123. data/vendor/assets/javascripts/mode-javascript-uncompressed.js +0 -1226
  124. data/vendor/assets/javascripts/mode-json-noconflict.js +0 -1
  125. data/vendor/assets/javascripts/mode-json-uncompressed-noconflict.js +0 -701
  126. data/vendor/assets/javascripts/mode-json-uncompressed.js +0 -701
  127. data/vendor/assets/javascripts/mode-latex-noconflict.js +0 -1
  128. data/vendor/assets/javascripts/mode-latex-uncompressed-noconflict.js +0 -95
  129. data/vendor/assets/javascripts/mode-latex-uncompressed.js +0 -95
  130. data/vendor/assets/javascripts/mode-less-noconflict.js +0 -1
  131. data/vendor/assets/javascripts/mode-less-uncompressed-noconflict.js +0 -655
  132. data/vendor/assets/javascripts/mode-less-uncompressed.js +0 -655
  133. data/vendor/assets/javascripts/mode-liquid-noconflict.js +0 -1
  134. data/vendor/assets/javascripts/mode-liquid-uncompressed-noconflict.js +0 -1353
  135. data/vendor/assets/javascripts/mode-liquid-uncompressed.js +0 -1353
  136. data/vendor/assets/javascripts/mode-lua-noconflict.js +0 -1
  137. data/vendor/assets/javascripts/mode-lua-uncompressed-noconflict.js +0 -523
  138. data/vendor/assets/javascripts/mode-lua-uncompressed.js +0 -523
  139. data/vendor/assets/javascripts/mode-markdown-noconflict.js +0 -1
  140. data/vendor/assets/javascripts/mode-markdown-uncompressed-noconflict.js +0 -2925
  141. data/vendor/assets/javascripts/mode-markdown-uncompressed.js +0 -2925
  142. data/vendor/assets/javascripts/mode-ocaml-noconflict.js +0 -1
  143. data/vendor/assets/javascripts/mode-ocaml-uncompressed-noconflict.js +0 -539
  144. data/vendor/assets/javascripts/mode-ocaml-uncompressed.js +0 -539
  145. data/vendor/assets/javascripts/mode-perl-noconflict.js +0 -1
  146. data/vendor/assets/javascripts/mode-perl-uncompressed-noconflict.js +0 -574
  147. data/vendor/assets/javascripts/mode-perl-uncompressed.js +0 -574
  148. data/vendor/assets/javascripts/mode-pgsql-noconflict.js +0 -1
  149. data/vendor/assets/javascripts/mode-pgsql-uncompressed-noconflict.js +0 -1104
  150. data/vendor/assets/javascripts/mode-pgsql-uncompressed.js +0 -1104
  151. data/vendor/assets/javascripts/mode-php-noconflict.js +0 -1
  152. data/vendor/assets/javascripts/mode-php-uncompressed-noconflict.js +0 -1885
  153. data/vendor/assets/javascripts/mode-php-uncompressed.js +0 -1885
  154. data/vendor/assets/javascripts/mode-powershell-noconflict.js +0 -1
  155. data/vendor/assets/javascripts/mode-powershell-uncompressed-noconflict.js +0 -710
  156. data/vendor/assets/javascripts/mode-powershell-uncompressed.js +0 -710
  157. data/vendor/assets/javascripts/mode-python-noconflict.js +0 -1
  158. data/vendor/assets/javascripts/mode-python-uncompressed-noconflict.js +0 -507
  159. data/vendor/assets/javascripts/mode-python-uncompressed.js +0 -507
  160. data/vendor/assets/javascripts/mode-ruby-noconflict.js +0 -1
  161. data/vendor/assets/javascripts/mode-ruby-uncompressed-noconflict.js +0 -391
  162. data/vendor/assets/javascripts/mode-ruby-uncompressed.js +0 -391
  163. data/vendor/assets/javascripts/mode-scad-noconflict.js +0 -1
  164. data/vendor/assets/javascripts/mode-scad-uncompressed-noconflict.js +0 -907
  165. data/vendor/assets/javascripts/mode-scad-uncompressed.js +0 -907
  166. data/vendor/assets/javascripts/mode-scala-noconflict.js +0 -1
  167. data/vendor/assets/javascripts/mode-scala-uncompressed-noconflict.js +0 -1395
  168. data/vendor/assets/javascripts/mode-scala-uncompressed.js +0 -1395
  169. data/vendor/assets/javascripts/mode-scss-noconflict.js +0 -1
  170. data/vendor/assets/javascripts/mode-scss-uncompressed-noconflict.js +0 -679
  171. data/vendor/assets/javascripts/mode-scss-uncompressed.js +0 -679
  172. data/vendor/assets/javascripts/mode-sh-noconflict.js +0 -1
  173. data/vendor/assets/javascripts/mode-sh-uncompressed-noconflict.js +0 -289
  174. data/vendor/assets/javascripts/mode-sh-uncompressed.js +0 -289
  175. data/vendor/assets/javascripts/mode-sql-noconflict.js +0 -1
  176. data/vendor/assets/javascripts/mode-sql-uncompressed-noconflict.js +0 -159
  177. data/vendor/assets/javascripts/mode-sql-uncompressed.js +0 -159
  178. data/vendor/assets/javascripts/mode-svg-noconflict.js +0 -1
  179. data/vendor/assets/javascripts/mode-svg-uncompressed-noconflict.js +0 -2137
  180. data/vendor/assets/javascripts/mode-svg-uncompressed.js +0 -2137
  181. data/vendor/assets/javascripts/mode-text-noconflict.js +0 -0
  182. data/vendor/assets/javascripts/mode-text-uncompressed-noconflict.js +0 -0
  183. data/vendor/assets/javascripts/mode-text-uncompressed.js +0 -0
  184. data/vendor/assets/javascripts/mode-textile-noconflict.js +0 -1
  185. data/vendor/assets/javascripts/mode-textile-uncompressed-noconflict.js +0 -254
  186. data/vendor/assets/javascripts/mode-textile-uncompressed.js +0 -254
  187. data/vendor/assets/javascripts/mode-xml-noconflict.js +0 -1
  188. data/vendor/assets/javascripts/mode-xml-uncompressed-noconflict.js +0 -1012
  189. data/vendor/assets/javascripts/mode-xml-uncompressed.js +0 -1012
  190. data/vendor/assets/javascripts/mode-xquery-noconflict.js +0 -1
  191. data/vendor/assets/javascripts/mode-xquery-uncompressed-noconflict.js +0 -540
  192. data/vendor/assets/javascripts/mode-xquery-uncompressed.js +0 -540
  193. data/vendor/assets/javascripts/theme-chrome-noconflict.js +0 -1
  194. data/vendor/assets/javascripts/theme-chrome-uncompressed-noconflict.js +0 -207
  195. data/vendor/assets/javascripts/theme-chrome-uncompressed.js +0 -207
  196. data/vendor/assets/javascripts/theme-clouds-noconflict.js +0 -1
  197. data/vendor/assets/javascripts/theme-clouds-uncompressed-noconflict.js +0 -160
  198. data/vendor/assets/javascripts/theme-clouds-uncompressed.js +0 -160
  199. data/vendor/assets/javascripts/theme-clouds_midnight-noconflict.js +0 -1
  200. data/vendor/assets/javascripts/theme-clouds_midnight-uncompressed-noconflict.js +0 -161
  201. data/vendor/assets/javascripts/theme-clouds_midnight-uncompressed.js +0 -161
  202. data/vendor/assets/javascripts/theme-cobalt-noconflict.js +0 -1
  203. data/vendor/assets/javascripts/theme-cobalt-uncompressed-noconflict.js +0 -187
  204. data/vendor/assets/javascripts/theme-cobalt-uncompressed.js +0 -187
  205. data/vendor/assets/javascripts/theme-crimson_editor-noconflict.js +0 -1
  206. data/vendor/assets/javascripts/theme-crimson_editor-uncompressed-noconflict.js +0 -198
  207. data/vendor/assets/javascripts/theme-crimson_editor-uncompressed.js +0 -198
  208. data/vendor/assets/javascripts/theme-dawn-noconflict.js +0 -1
  209. data/vendor/assets/javascripts/theme-dawn-uncompressed-noconflict.js +0 -191
  210. data/vendor/assets/javascripts/theme-dawn-uncompressed.js +0 -191
  211. data/vendor/assets/javascripts/theme-dreamweaver-noconflict.js +0 -1
  212. data/vendor/assets/javascripts/theme-dreamweaver-uncompressed-noconflict.js +0 -227
  213. data/vendor/assets/javascripts/theme-dreamweaver-uncompressed.js +0 -227
  214. data/vendor/assets/javascripts/theme-eclipse-noconflict.js +0 -1
  215. data/vendor/assets/javascripts/theme-eclipse-uncompressed-noconflict.js +0 -147
  216. data/vendor/assets/javascripts/theme-eclipse-uncompressed.js +0 -147
  217. data/vendor/assets/javascripts/theme-idle_fingers-noconflict.js +0 -1
  218. data/vendor/assets/javascripts/theme-idle_fingers-uncompressed-noconflict.js +0 -179
  219. data/vendor/assets/javascripts/theme-idle_fingers-uncompressed.js +0 -179
  220. data/vendor/assets/javascripts/theme-kr_theme-noconflict.js +0 -1
  221. data/vendor/assets/javascripts/theme-kr_theme-uncompressed-noconflict.js +0 -182
  222. data/vendor/assets/javascripts/theme-kr_theme-uncompressed.js +0 -182
  223. data/vendor/assets/javascripts/theme-merbivore-noconflict.js +0 -1
  224. data/vendor/assets/javascripts/theme-merbivore-uncompressed-noconflict.js +0 -182
  225. data/vendor/assets/javascripts/theme-merbivore-uncompressed.js +0 -182
  226. data/vendor/assets/javascripts/theme-merbivore_soft-noconflict.js +0 -1
  227. data/vendor/assets/javascripts/theme-merbivore_soft-uncompressed-noconflict.js +0 -188
  228. data/vendor/assets/javascripts/theme-merbivore_soft-uncompressed.js +0 -188
  229. data/vendor/assets/javascripts/theme-mono_industrial-noconflict.js +0 -1
  230. data/vendor/assets/javascripts/theme-mono_industrial-uncompressed-noconflict.js +0 -190
  231. data/vendor/assets/javascripts/theme-mono_industrial-uncompressed.js +0 -190
  232. data/vendor/assets/javascripts/theme-monokai-noconflict.js +0 -1
  233. data/vendor/assets/javascripts/theme-monokai-uncompressed-noconflict.js +0 -191
  234. data/vendor/assets/javascripts/theme-monokai-uncompressed.js +0 -191
  235. data/vendor/assets/javascripts/theme-pastel_on_dark-noconflict.js +0 -1
  236. data/vendor/assets/javascripts/theme-pastel_on_dark-uncompressed-noconflict.js +0 -192
  237. data/vendor/assets/javascripts/theme-pastel_on_dark-uncompressed.js +0 -192
  238. data/vendor/assets/javascripts/theme-solarized_dark-noconflict.js +0 -1
  239. data/vendor/assets/javascripts/theme-solarized_dark-uncompressed-noconflict.js +0 -176
  240. data/vendor/assets/javascripts/theme-solarized_dark-uncompressed.js +0 -176
  241. data/vendor/assets/javascripts/theme-solarized_light-noconflict.js +0 -1
  242. data/vendor/assets/javascripts/theme-solarized_light-uncompressed-noconflict.js +0 -172
  243. data/vendor/assets/javascripts/theme-solarized_light-uncompressed.js +0 -172
  244. data/vendor/assets/javascripts/theme-textmate-noconflict.js +0 -0
  245. data/vendor/assets/javascripts/theme-textmate-uncompressed-noconflict.js +0 -0
  246. data/vendor/assets/javascripts/theme-textmate-uncompressed.js +0 -0
  247. data/vendor/assets/javascripts/theme-tomorrow-noconflict.js +0 -1
  248. data/vendor/assets/javascripts/theme-tomorrow-uncompressed-noconflict.js +0 -206
  249. data/vendor/assets/javascripts/theme-tomorrow-uncompressed.js +0 -206
  250. data/vendor/assets/javascripts/theme-tomorrow_night-noconflict.js +0 -1
  251. data/vendor/assets/javascripts/theme-tomorrow_night-uncompressed-noconflict.js +0 -206
  252. data/vendor/assets/javascripts/theme-tomorrow_night-uncompressed.js +0 -206
  253. data/vendor/assets/javascripts/theme-tomorrow_night_blue-noconflict.js +0 -1
  254. data/vendor/assets/javascripts/theme-tomorrow_night_blue-uncompressed-noconflict.js +0 -209
  255. data/vendor/assets/javascripts/theme-tomorrow_night_blue-uncompressed.js +0 -209
  256. data/vendor/assets/javascripts/theme-tomorrow_night_bright-noconflict.js +0 -1
  257. data/vendor/assets/javascripts/theme-tomorrow_night_bright-uncompressed-noconflict.js +0 -206
  258. data/vendor/assets/javascripts/theme-tomorrow_night_bright-uncompressed.js +0 -206
  259. data/vendor/assets/javascripts/theme-tomorrow_night_eighties-noconflict.js +0 -1
  260. data/vendor/assets/javascripts/theme-tomorrow_night_eighties-uncompressed-noconflict.js +0 -202
  261. data/vendor/assets/javascripts/theme-tomorrow_night_eighties-uncompressed.js +0 -202
  262. data/vendor/assets/javascripts/theme-twilight-noconflict.js +0 -1
  263. data/vendor/assets/javascripts/theme-twilight-uncompressed-noconflict.js +0 -204
  264. data/vendor/assets/javascripts/theme-twilight-uncompressed.js +0 -204
  265. data/vendor/assets/javascripts/theme-vibrant_ink-noconflict.js +0 -1
  266. data/vendor/assets/javascripts/theme-vibrant_ink-uncompressed-noconflict.js +0 -183
  267. data/vendor/assets/javascripts/theme-vibrant_ink-uncompressed.js +0 -183
@@ -1 +1,829 @@
1
- define("ace/mode/xml",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/xml_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/xml"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("./text").Mode,f=a("../tokenizer").Tokenizer,g=a("./xml_highlight_rules").XmlHighlightRules,h=a("./behaviour/xml").XmlBehaviour,i=a("./folding/xml").FoldMode,j=function(){this.$tokenizer=new f((new g).getRules()),this.$behaviour=new h,this.foldingRules=new i};d.inherits(j,e),function(){this.getNextLineIndent=function(a,b,c){return this.$getIndent(b)}}.call(j.prototype),b.Mode=j}),define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/xml_util","ace/mode/text_highlight_rules"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("./xml_util"),f=a("./text_highlight_rules").TextHighlightRules,g=function(){this.$rules={start:[{token:"text",regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:"xml_pe",regex:"<\\?.*?\\?>"},{token:"comment",merge:!0,regex:"<\\!--",next:"comment"},{token:"xml_pe",regex:"<\\!.*?>"},{token:"meta.tag",regex:"<\\/?",next:"tag"},{token:"text",regex:"\\s+"},{token:"constant.character.entity",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"},{token:"text",regex:"[^<]+"}],cdata:[{token:"text",regex:"\\]\\]>",next:"start"},{token:"text",regex:"\\s+"},{token:"text",regex:"(?:[^\\]]|\\](?!\\]>))+"}],comment:[{token:"comment",regex:".*?-->",next:"start"},{token:"comment",merge:!0,regex:".+"}]},e.tag(this.$rules,"tag","start")};d.inherits(g,f),b.XmlHighlightRules=g}),define("ace/mode/xml_util",["require","exports","module","ace/lib/lang"],function(a,b,c){function g(a){return[{token:"string",regex:'".*?"'},{token:"string",merge:!0,regex:'["].*',next:a+"_qqstring"},{token:"string",regex:"'.*?'"},{token:"string",merge:!0,regex:"['].*",next:a+"_qstring"}]}function h(a,b){return[{token:"string",merge:!0,regex:".*?"+a,next:b},{token:"string",merge:!0,regex:".+"}]}"use strict";var d=a("../lib/lang"),e=d.arrayToMap("button|form|input|label|select|textarea".split("|")),f=d.arrayToMap("table|tbody|td|tfoot|th|tr".split("|"));b.tag=function(a,b,c){a[b]=[{token:"text",regex:"\\s+"},{token:function(a){return a==="a"?"meta.tag.anchor":a==="img"?"meta.tag.image":a==="script"?"meta.tag.script":a==="style"?"meta.tag.style":e.hasOwnProperty(a.toLowerCase())?"meta.tag.form":f.hasOwnProperty(a.toLowerCase())?"meta.tag.table":"meta.tag"},merge:!0,regex:"[-_a-zA-Z0-9:]+",next:b+"_embed_attribute_list"},{token:"empty",regex:"",next:b+"_embed_attribute_list"}],a[b+"_qstring"]=h("'",b+"_embed_attribute_list"),a[b+"_qqstring"]=h('"',b+"_embed_attribute_list"),a[b+"_embed_attribute_list"]=[{token:"meta.tag",merge:!0,regex:"/?>",next:c},{token:"keyword.operator",regex:"="},{token:"entity.other.attribute-name",regex:"[-_a-zA-Z0-9:]+"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"text",regex:"\\s+"}].concat(g(b))}}),define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle"],function(a,b,c){"use strict";var d=a("../../lib/oop"),e=a("../behaviour").Behaviour,f=a("./cstyle").CstyleBehaviour,g=function(){this.inherit(f,["string_dquotes"]),this.add("brackets","insertion",function(a,b,c,d,e){if(e=="<"){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);return g!==""?!1:{text:"<>",selection:[1,1]}}if(e==">"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j==">")return{text:"",selection:[1,1]}}else if(e=="\n"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),k=i.substring(h.column,h.column+2);if(k=="</"){var l=this.$getIndent(d.doc.getLine(h.row))+d.getTabString(),m=this.$getIndent(d.doc.getLine(h.row));return{text:"\n"+l+"\n"+m,selection:[1,l.length,1,l.length]}}}})};d.inherits(g,e),b.XmlBehaviour=g}),define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour"],function(a,b,c){"use strict";var d=a("../../lib/oop"),e=a("../behaviour").Behaviour,f=function(){this.add("braces","insertion",function(a,b,c,d,e){if(e=="{"){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);return g!==""?{text:"{"+g+"}",selection:!1}:{text:"{}",selection:[1,1]}}if(e=="}"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j=="}"){var k=d.$findOpeningBracket("}",{column:h.column+1,row:h.row});if(k!==null)return{text:"",selection:[1,1]}}}else if(e=="\n"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j=="}"){var l=d.findMatchingBracket({row:h.row,column:h.column+1});if(!l)return null;var m=this.getNextLineIndent(a,i.substring(0,i.length-1),d.getTabString()),n=this.$getIndent(d.doc.getLine(l.row));return{text:"\n"+m+"\n"+n,selection:[1,m.length,1,m.length]}}}}),this.add("braces","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=="{"){var g=d.doc.getLine(e.start.row),h=g.substring(e.end.column,e.end.column+1);if(h=="}")return e.end.column++,e}}),this.add("parens","insertion",function(a,b,c,d,e){if(e=="("){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);return g!==""?{text:"("+g+")",selection:!1}:{text:"()",selection:[1,1]}}if(e==")"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j==")"){var k=d.$findOpeningBracket(")",{column:h.column+1,row:h.row});if(k!==null)return{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=="("){var g=d.doc.getLine(e.start.row),h=g.substring(e.start.column+1,e.start.column+2);if(h==")")return e.end.column++,e}}),this.add("string_dquotes","insertion",function(a,b,c,d,e){if(e=='"'||e=="'"){var f=e,g=c.getSelectionRange(),h=d.doc.getTextRange(g);if(h!=="")return{text:f+h+f,selection:!1};var i=c.getCursorPosition(),j=d.doc.getLine(i.row),k=j.substring(i.column-1,i.column);if(k=="\\")return null;var l=d.getTokens(g.start.row,g.start.row)[0].tokens,m=0,n,o=-1;for(var p=0;p<l.length;p++){n=l[p],n.type=="string"?o=-1:o<0&&(o=n.value.indexOf(f));if(n.value.length+m>g.start.column)break;m+=l[p].value.length}if(!n||o<0&&n.type!=="comment"&&(n.type!=="string"||g.start.column!==n.value.length+m-1&&n.value.lastIndexOf(f)===n.value.length-1))return{text:f+f,selection:[1,1]};if(n&&n.type==="string"){var q=j.substring(i.column,i.column+1);if(q==f)return{text:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&(f=='"'||f=="'")){var g=d.doc.getLine(e.start.row),h=g.substring(e.start.column+1,e.start.column+2);if(h=='"')return e.end.column++,e}})};d.inherits(f,e),b.CstyleBehaviour=f}),define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/range","ace/mode/folding/fold_mode","ace/token_iterator"],function(a,b,c){"use strict";var d=a("../../lib/oop"),e=a("../../lib/lang"),f=a("../../range").Range,g=a("./fold_mode").FoldMode,h=a("../../token_iterator").TokenIterator,i=b.FoldMode=function(a){g.call(this),this.voidElements=a||{}};d.inherits(i,g),function(){this.getFoldWidget=function(a,b,c){var d=this._getFirstTagInLine(a,c);return d.closing?b=="markbeginend"?"end":"":!d.tagName||this.voidElements[d.tagName.toLowerCase()]?"":d.selfClosing?"":d.value.indexOf("/"+d.tagName)!==-1?"":"start"},this._getFirstTagInLine=function(a,b){var c=a.getTokens(b,b)[0].tokens,d="";for(var f=0;f<c.length;f++){var g=c[f];g.type.indexOf("meta.tag")===0?d+=g.value:d+=e.stringRepeat(" ",g.value.length)}return this._parseTag(d)},this.tagRe=/^(\s*)(<?(\/?)([-_a-zA-Z0-9:!]*)\s*(\/?)>?)/,this._parseTag=function(a){var b=this.tagRe.exec(a),c=this.tagRe.lastIndex||0;return this.tagRe.lastIndex=0,{value:a,match:b?b[2]:"",closing:b?!!b[3]:!1,selfClosing:b?!!b[5]||b[2]=="/>":!1,tagName:b?b[4]:"",column:b[1]?c+b[1].length:c}},this._readTagForward=function(a){var b=a.getCurrentToken();if(!b)return null;var c="",d;do if(b.type.indexOf("meta.tag")===0){if(!d)var d={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()};c+=b.value;if(c.indexOf(">")!==-1){var e=this._parseTag(c);return e.start=d,e.end={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()+b.value.length},a.stepForward(),e}}while(b=a.stepForward());return null},this._readTagBackward=function(a){var b=a.getCurrentToken();if(!b)return null;var c="",d;do if(b.type.indexOf("meta.tag")===0){d||(d={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()+b.value.length}),c=b.value+c;if(c.indexOf("<")!==-1){var e=this._parseTag(c);return e.end=d,e.start={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()},a.stepBackward(),e}}while(b=a.stepBackward());return null},this._pop=function(a,b){while(a.length){var c=a[a.length-1];if(!b||c.tagName==b.tagName)return a.pop();if(this.voidElements[b.tagName])return;if(this.voidElements[c.tagName]){a.pop();continue}return null}},this.getFoldWidgetRange=function(a,b,c){var d=this._getFirstTagInLine(a,c);if(!d.match)return null;var e=d.closing||d.selfClosing,g=[],i;if(!e){var j=new h(a,c,d.column),k={row:c,column:d.column+d.tagName.length+2};while(i=this._readTagForward(j)){if(i.selfClosing){if(!g.length)return i.start.column+=i.tagName.length+2,i.end.column-=2,f.fromPoints(i.start,i.end);continue}if(i.closing){this._pop(g,i);if(g.length==0)return f.fromPoints(k,i.start)}else g.push(i)}}else{var j=new h(a,c,d.column+d.match.length),l={row:c,column:d.column};while(i=this._readTagBackward(j)){if(i.selfClosing){if(!g.length)return i.start.column+=i.tagName.length+2,i.end.column-=2,f.fromPoints(i.start,i.end);continue}if(!i.closing){this._pop(g,i);if(g.length==0)return i.start.column+=i.tagName.length+2,f.fromPoints(i.start,l)}else g.push(i)}}}}.call(i.prototype)}),define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(a,b,c){"use strict";var d=a("../../range").Range,e=b.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(a,b,c){var d=a.getLine(c);return this.foldingStartMarker.test(d)?"start":b=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(d)?"end":""},this.getFoldWidgetRange=function(a,b,c){return null},this.indentationBlock=function(a,b,c){var e=/^\s*/,f=b,g=b,h=a.getLine(b),i=c||h.length,j=h.match(e)[0].length,k=a.getLength();while(++b<k){h=a.getLine(b);var l=h.match(e)[0].length;if(l==h.length)continue;if(l<=j)break;g=b}if(g>f){var m=a.getLine(g).length;return new d(f,i,g,m)}},this.openingBracketBlock=function(a,b,c,e){var f={row:c,column:e+1},g=a.$findClosingBracket(b,f);if(!g)return;var h=a.foldWidgets[g.row];return h==null&&(h=this.getFoldWidget(a,g.row)),h=="start"&&(g.row--,g.column=a.getLine(g.row).length),d.fromPoints(f,g)}}).call(e.prototype)})
1
+ /* ***** BEGIN LICENSE BLOCK *****
2
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
3
+ *
4
+ * The contents of this file are subject to the Mozilla Public License Version
5
+ * 1.1 (the "License"); you may not use this file except in compliance with
6
+ * the License. You may obtain a copy of the License at
7
+ * http://www.mozilla.org/MPL/
8
+ *
9
+ * Software distributed under the License is distributed on an "AS IS" basis,
10
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11
+ * for the specific language governing rights and limitations under the
12
+ * License.
13
+ *
14
+ * The Original Code is Ajax.org Code Editor (ACE).
15
+ *
16
+ * The Initial Developer of the Original Code is
17
+ * Ajax.org B.V.
18
+ * Portions created by the Initial Developer are Copyright (C) 2010
19
+ * the Initial Developer. All Rights Reserved.
20
+ *
21
+ * Contributor(s):
22
+ * Fabian Jakobs <fabian AT ajax DOT org>
23
+ *
24
+ * Alternatively, the contents of this file may be used under the terms of
25
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
26
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27
+ * in which case the provisions of the GPL or the LGPL are applicable instead
28
+ * of those above. If you wish to allow use of your version of this file only
29
+ * under the terms of either the GPL or the LGPL, and not to allow others to
30
+ * use your version of this file under the terms of the MPL, indicate your
31
+ * decision by deleting the provisions above and replace them with the notice
32
+ * and other provisions required by the GPL or the LGPL. If you do not delete
33
+ * the provisions above, a recipient may use your version of this file under
34
+ * the terms of any one of the MPL, the GPL or the LGPL.
35
+ *
36
+ * ***** END LICENSE BLOCK ***** */
37
+
38
+ define('ace/mode/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/xml_highlight_rules', 'ace/mode/behaviour/xml', 'ace/mode/folding/xml'], function(require, exports, module) {
39
+
40
+
41
+ var oop = require("../lib/oop");
42
+ var TextMode = require("./text").Mode;
43
+ var Tokenizer = require("../tokenizer").Tokenizer;
44
+ var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
45
+ var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
46
+ var XmlFoldMode = require("./folding/xml").FoldMode;
47
+
48
+ var Mode = function() {
49
+ this.$tokenizer = new Tokenizer(new XmlHighlightRules().getRules());
50
+ this.$behaviour = new XmlBehaviour();
51
+ this.foldingRules = new XmlFoldMode();
52
+ };
53
+
54
+ oop.inherits(Mode, TextMode);
55
+
56
+ (function() {
57
+
58
+ this.getNextLineIndent = function(state, line, tab) {
59
+ return this.$getIndent(line);
60
+ };
61
+
62
+ }).call(Mode.prototype);
63
+
64
+ exports.Mode = Mode;
65
+ });
66
+
67
+ define('ace/mode/xml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
68
+
69
+
70
+ var oop = require("../lib/oop");
71
+ var xmlUtil = require("./xml_util");
72
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
73
+
74
+ var XmlHighlightRules = function() {
75
+
76
+ // regexp must not have capturing parentheses
77
+ // regexps are ordered -> the first match is used
78
+ this.$rules = {
79
+ start : [{
80
+ token : "text",
81
+ regex : "<\\!\\[CDATA\\[",
82
+ next : "cdata"
83
+ }, {
84
+ token : "xml_pe",
85
+ regex : "<\\?.*?\\?>"
86
+ }, {
87
+ token : "comment",
88
+ merge : true,
89
+ regex : "<\\!--",
90
+ next : "comment"
91
+ }, {
92
+ token : "xml_pe",
93
+ regex : "<\\!.*?>"
94
+ }, {
95
+ token : "meta.tag", // opening tag
96
+ regex : "<\\/?",
97
+ next : "tag"
98
+ }, {
99
+ token : "text",
100
+ regex : "\\s+"
101
+ }, {
102
+ token : "constant.character.entity",
103
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
104
+ }, {
105
+ token : "text",
106
+ regex : "[^<]+"
107
+ }],
108
+
109
+ cdata : [{
110
+ token : "text",
111
+ regex : "\\]\\]>",
112
+ next : "start"
113
+ }, {
114
+ token : "text",
115
+ regex : "\\s+"
116
+ }, {
117
+ token : "text",
118
+ regex : "(?:[^\\]]|\\](?!\\]>))+"
119
+ }],
120
+
121
+ comment : [{
122
+ token : "comment",
123
+ regex : ".*?-->",
124
+ next : "start"
125
+ }, {
126
+ token : "comment",
127
+ merge : true,
128
+ regex : ".+"
129
+ }]
130
+ };
131
+
132
+ xmlUtil.tag(this.$rules, "tag", "start");
133
+ };
134
+
135
+ oop.inherits(XmlHighlightRules, TextHighlightRules);
136
+
137
+ exports.XmlHighlightRules = XmlHighlightRules;
138
+ });
139
+
140
+ define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) {
141
+
142
+
143
+ function string(state) {
144
+ return [{
145
+ token : "string",
146
+ regex : '".*?"'
147
+ }, {
148
+ token : "string", // multi line string start
149
+ merge : true,
150
+ regex : '["].*',
151
+ next : state + "_qqstring"
152
+ }, {
153
+ token : "string",
154
+ regex : "'.*?'"
155
+ }, {
156
+ token : "string", // multi line string start
157
+ merge : true,
158
+ regex : "['].*",
159
+ next : state + "_qstring"
160
+ }];
161
+ }
162
+
163
+ function multiLineString(quote, state) {
164
+ return [{
165
+ token : "string",
166
+ merge : true,
167
+ regex : ".*?" + quote,
168
+ next : state
169
+ }, {
170
+ token : "string",
171
+ merge : true,
172
+ regex : '.+'
173
+ }];
174
+ }
175
+
176
+ exports.tag = function(states, name, nextState, tagMap) {
177
+ states[name] = [{
178
+ token : "text",
179
+ regex : "\\s+"
180
+ }, {
181
+ //token : "meta.tag",
182
+
183
+ token : !tagMap ? "meta.tag.tag-name" : function(value) {
184
+ if (tagMap[value])
185
+ return "meta.tag.tag-name." + tagMap[value];
186
+ else
187
+ return "meta.tag.tag-name";
188
+ },
189
+ merge : true,
190
+ regex : "[-_a-zA-Z0-9:]+",
191
+ next : name + "_embed_attribute_list"
192
+ }, {
193
+ token: "empty",
194
+ regex: "",
195
+ next : name + "_embed_attribute_list"
196
+ }];
197
+
198
+ states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list");
199
+ states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list");
200
+
201
+ states[name + "_embed_attribute_list"] = [{
202
+ token : "meta.tag",
203
+ merge : true,
204
+ regex : "\/?>",
205
+ next : nextState
206
+ }, {
207
+ token : "keyword.operator",
208
+ regex : "="
209
+ }, {
210
+ token : "entity.other.attribute-name",
211
+ regex : "[-_a-zA-Z0-9:]+"
212
+ }, {
213
+ token : "constant.numeric", // float
214
+ regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
215
+ }, {
216
+ token : "text",
217
+ regex : "\\s+"
218
+ }].concat(string(name));
219
+ };
220
+
221
+ });
222
+
223
+ define('ace/mode/behaviour/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) {
224
+
225
+
226
+ var oop = require("../../lib/oop");
227
+ var Behaviour = require("../behaviour").Behaviour;
228
+ var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
229
+ var TokenIterator = require("../../token_iterator").TokenIterator;
230
+
231
+ function hasType(token, type) {
232
+ var hasType = true;
233
+ var typeList = token.type.split('.');
234
+ var needleList = type.split('.');
235
+ needleList.forEach(function(needle){
236
+ if (typeList.indexOf(needle) == -1) {
237
+ hasType = false;
238
+ return false;
239
+ }
240
+ });
241
+ return hasType;
242
+ }
243
+
244
+ var XmlBehaviour = function () {
245
+
246
+ this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour
247
+
248
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
249
+ if (text == '>') {
250
+ var position = editor.getCursorPosition();
251
+ var iterator = new TokenIterator(session, position.row, position.column);
252
+ var token = iterator.getCurrentToken();
253
+ var atCursor = false;
254
+ if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){
255
+ do {
256
+ token = iterator.stepBackward();
257
+ } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text')));
258
+ } else {
259
+ atCursor = true;
260
+ }
261
+ if (!token || !hasType(token, 'meta.tag-name') || iterator.stepBackward().value.match('/')) {
262
+ return
263
+ }
264
+ var tag = token.value;
265
+ if (atCursor){
266
+ var tag = tag.substring(0, position.column - token.start);
267
+ }
268
+
269
+ return {
270
+ text: '>' + '</' + tag + '>',
271
+ selection: [1, 1]
272
+ }
273
+ }
274
+ });
275
+
276
+ this.add('autoindent', 'insertion', function (state, action, editor, session, text) {
277
+ if (text == "\n") {
278
+ var cursor = editor.getCursorPosition();
279
+ var line = session.doc.getLine(cursor.row);
280
+ var rightChars = line.substring(cursor.column, cursor.column + 2);
281
+ if (rightChars == '</') {
282
+ var indent = this.$getIndent(session.doc.getLine(cursor.row)) + session.getTabString();
283
+ var next_indent = this.$getIndent(session.doc.getLine(cursor.row));
284
+
285
+ return {
286
+ text: '\n' + indent + '\n' + next_indent,
287
+ selection: [1, indent.length, 1, indent.length]
288
+ }
289
+ }
290
+ }
291
+ });
292
+
293
+ }
294
+ oop.inherits(XmlBehaviour, Behaviour);
295
+
296
+ exports.XmlBehaviour = XmlBehaviour;
297
+ });
298
+
299
+ define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
300
+
301
+
302
+ var oop = require("../../lib/oop");
303
+ var Behaviour = require("../behaviour").Behaviour;
304
+
305
+ var CstyleBehaviour = function () {
306
+
307
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
308
+ if (text == '{') {
309
+ var selection = editor.getSelectionRange();
310
+ var selected = session.doc.getTextRange(selection);
311
+ if (selected !== "") {
312
+ return {
313
+ text: '{' + selected + '}',
314
+ selection: false
315
+ };
316
+ } else {
317
+ return {
318
+ text: '{}',
319
+ selection: [1, 1]
320
+ };
321
+ }
322
+ } else if (text == '}') {
323
+ var cursor = editor.getCursorPosition();
324
+ var line = session.doc.getLine(cursor.row);
325
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
326
+ if (rightChar == '}') {
327
+ var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
328
+ if (matching !== null) {
329
+ return {
330
+ text: '',
331
+ selection: [1, 1]
332
+ };
333
+ }
334
+ }
335
+ } else if (text == "\n") {
336
+ var cursor = editor.getCursorPosition();
337
+ var line = session.doc.getLine(cursor.row);
338
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
339
+ if (rightChar == '}') {
340
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
341
+ if (!openBracePos)
342
+ return null;
343
+
344
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
345
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
346
+
347
+ return {
348
+ text: '\n' + indent + '\n' + next_indent,
349
+ selection: [1, indent.length, 1, indent.length]
350
+ };
351
+ }
352
+ }
353
+ });
354
+
355
+ this.add("braces", "deletion", function (state, action, editor, session, range) {
356
+ var selected = session.doc.getTextRange(range);
357
+ if (!range.isMultiLine() && selected == '{') {
358
+ var line = session.doc.getLine(range.start.row);
359
+ var rightChar = line.substring(range.end.column, range.end.column + 1);
360
+ if (rightChar == '}') {
361
+ range.end.column++;
362
+ return range;
363
+ }
364
+ }
365
+ });
366
+
367
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
368
+ if (text == '(') {
369
+ var selection = editor.getSelectionRange();
370
+ var selected = session.doc.getTextRange(selection);
371
+ if (selected !== "") {
372
+ return {
373
+ text: '(' + selected + ')',
374
+ selection: false
375
+ };
376
+ } else {
377
+ return {
378
+ text: '()',
379
+ selection: [1, 1]
380
+ };
381
+ }
382
+ } else if (text == ')') {
383
+ var cursor = editor.getCursorPosition();
384
+ var line = session.doc.getLine(cursor.row);
385
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
386
+ if (rightChar == ')') {
387
+ var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
388
+ if (matching !== null) {
389
+ return {
390
+ text: '',
391
+ selection: [1, 1]
392
+ };
393
+ }
394
+ }
395
+ }
396
+ });
397
+
398
+ this.add("parens", "deletion", function (state, action, editor, session, range) {
399
+ var selected = session.doc.getTextRange(range);
400
+ if (!range.isMultiLine() && selected == '(') {
401
+ var line = session.doc.getLine(range.start.row);
402
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
403
+ if (rightChar == ')') {
404
+ range.end.column++;
405
+ return range;
406
+ }
407
+ }
408
+ });
409
+
410
+ this.add("brackets", "insertion", function (state, action, editor, session, text) {
411
+ if (text == '[') {
412
+ var selection = editor.getSelectionRange();
413
+ var selected = session.doc.getTextRange(selection);
414
+ if (selected !== "") {
415
+ return {
416
+ text: '[' + selected + ']',
417
+ selection: false
418
+ };
419
+ } else {
420
+ return {
421
+ text: '[]',
422
+ selection: [1, 1]
423
+ };
424
+ }
425
+ } else if (text == ']') {
426
+ var cursor = editor.getCursorPosition();
427
+ var line = session.doc.getLine(cursor.row);
428
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
429
+ if (rightChar == ']') {
430
+ var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row});
431
+ if (matching !== null) {
432
+ return {
433
+ text: '',
434
+ selection: [1, 1]
435
+ };
436
+ }
437
+ }
438
+ }
439
+ });
440
+
441
+ this.add("brackets", "deletion", function (state, action, editor, session, range) {
442
+ var selected = session.doc.getTextRange(range);
443
+ if (!range.isMultiLine() && selected == '[') {
444
+ var line = session.doc.getLine(range.start.row);
445
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
446
+ if (rightChar == ']') {
447
+ range.end.column++;
448
+ return range;
449
+ }
450
+ }
451
+ });
452
+
453
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
454
+ if (text == '"' || text == "'") {
455
+ var quote = text;
456
+ var selection = editor.getSelectionRange();
457
+ var selected = session.doc.getTextRange(selection);
458
+ if (selected !== "") {
459
+ return {
460
+ text: quote + selected + quote,
461
+ selection: false
462
+ };
463
+ } else {
464
+ var cursor = editor.getCursorPosition();
465
+ var line = session.doc.getLine(cursor.row);
466
+ var leftChar = line.substring(cursor.column-1, cursor.column);
467
+
468
+ // We're escaped.
469
+ if (leftChar == '\\') {
470
+ return null;
471
+ }
472
+
473
+ // Find what token we're inside.
474
+ var tokens = session.getTokens(selection.start.row);
475
+ var col = 0, token;
476
+ var quotepos = -1; // Track whether we're inside an open quote.
477
+
478
+ for (var x = 0; x < tokens.length; x++) {
479
+ token = tokens[x];
480
+ if (token.type == "string") {
481
+ quotepos = -1;
482
+ } else if (quotepos < 0) {
483
+ quotepos = token.value.indexOf(quote);
484
+ }
485
+ if ((token.value.length + col) > selection.start.column) {
486
+ break;
487
+ }
488
+ col += tokens[x].value.length;
489
+ }
490
+
491
+ // Try and be smart about when we auto insert.
492
+ 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)))) {
493
+ return {
494
+ text: quote + quote,
495
+ selection: [1,1]
496
+ };
497
+ } else if (token && token.type === "string") {
498
+ // Ignore input and move right one if we're typing over the closing quote.
499
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
500
+ if (rightChar == quote) {
501
+ return {
502
+ text: '',
503
+ selection: [1, 1]
504
+ };
505
+ }
506
+ }
507
+ }
508
+ }
509
+ });
510
+
511
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
512
+ var selected = session.doc.getTextRange(range);
513
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
514
+ var line = session.doc.getLine(range.start.row);
515
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
516
+ if (rightChar == '"') {
517
+ range.end.column++;
518
+ return range;
519
+ }
520
+ }
521
+ });
522
+
523
+ };
524
+
525
+ oop.inherits(CstyleBehaviour, Behaviour);
526
+
527
+ exports.CstyleBehaviour = CstyleBehaviour;
528
+ });
529
+
530
+ 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) {
531
+
532
+
533
+ var oop = require("../../lib/oop");
534
+ var lang = require("../../lib/lang");
535
+ var Range = require("../../range").Range;
536
+ var BaseFoldMode = require("./fold_mode").FoldMode;
537
+ var TokenIterator = require("../../token_iterator").TokenIterator;
538
+
539
+ var FoldMode = exports.FoldMode = function(voidElements) {
540
+ BaseFoldMode.call(this);
541
+ this.voidElements = voidElements || {};
542
+ };
543
+ oop.inherits(FoldMode, BaseFoldMode);
544
+
545
+ (function() {
546
+
547
+ this.getFoldWidget = function(session, foldStyle, row) {
548
+ var tag = this._getFirstTagInLine(session, row);
549
+
550
+ if (tag.closing)
551
+ return foldStyle == "markbeginend" ? "end" : "";
552
+
553
+ if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()])
554
+ return "";
555
+
556
+ if (tag.selfClosing)
557
+ return "";
558
+
559
+ if (tag.value.indexOf("/" + tag.tagName) !== -1)
560
+ return "";
561
+
562
+ return "start";
563
+ };
564
+
565
+ this._getFirstTagInLine = function(session, row) {
566
+ var tokens = session.getTokens(row);
567
+ var value = "";
568
+ for (var i = 0; i < tokens.length; i++) {
569
+ var token = tokens[i];
570
+ if (token.type.indexOf("meta.tag") === 0)
571
+ value += token.value;
572
+ else
573
+ value += lang.stringRepeat(" ", token.value.length);
574
+ }
575
+
576
+ return this._parseTag(value);
577
+ };
578
+
579
+ this.tagRe = /^(\s*)(<?(\/?)([-_a-zA-Z0-9:!]*)\s*(\/?)>?)/;
580
+ this._parseTag = function(tag) {
581
+
582
+ var match = this.tagRe.exec(tag);
583
+ var column = this.tagRe.lastIndex || 0;
584
+ this.tagRe.lastIndex = 0;
585
+
586
+ return {
587
+ value: tag,
588
+ match: match ? match[2] : "",
589
+ closing: match ? !!match[3] : false,
590
+ selfClosing: match ? !!match[5] || match[2] == "/>" : false,
591
+ tagName: match ? match[4] : "",
592
+ column: match[1] ? column + match[1].length : column
593
+ };
594
+ };
595
+ this._readTagForward = function(iterator) {
596
+ var token = iterator.getCurrentToken();
597
+ if (!token)
598
+ return null;
599
+
600
+ var value = "";
601
+ var start;
602
+
603
+ do {
604
+ if (token.type.indexOf("meta.tag") === 0) {
605
+ if (!start) {
606
+ var start = {
607
+ row: iterator.getCurrentTokenRow(),
608
+ column: iterator.getCurrentTokenColumn()
609
+ };
610
+ }
611
+ value += token.value;
612
+ if (value.indexOf(">") !== -1) {
613
+ var tag = this._parseTag(value);
614
+ tag.start = start;
615
+ tag.end = {
616
+ row: iterator.getCurrentTokenRow(),
617
+ column: iterator.getCurrentTokenColumn() + token.value.length
618
+ };
619
+ iterator.stepForward();
620
+ return tag;
621
+ }
622
+ }
623
+ } while(token = iterator.stepForward());
624
+
625
+ return null;
626
+ };
627
+
628
+ this._readTagBackward = function(iterator) {
629
+ var token = iterator.getCurrentToken();
630
+ if (!token)
631
+ return null;
632
+
633
+ var value = "";
634
+ var end;
635
+
636
+ do {
637
+ if (token.type.indexOf("meta.tag") === 0) {
638
+ if (!end) {
639
+ end = {
640
+ row: iterator.getCurrentTokenRow(),
641
+ column: iterator.getCurrentTokenColumn() + token.value.length
642
+ };
643
+ }
644
+ value = token.value + value;
645
+ if (value.indexOf("<") !== -1) {
646
+ var tag = this._parseTag(value);
647
+ tag.end = end;
648
+ tag.start = {
649
+ row: iterator.getCurrentTokenRow(),
650
+ column: iterator.getCurrentTokenColumn()
651
+ };
652
+ iterator.stepBackward();
653
+ return tag;
654
+ }
655
+ }
656
+ } while(token = iterator.stepBackward());
657
+
658
+ return null;
659
+ };
660
+
661
+ this._pop = function(stack, tag) {
662
+ while (stack.length) {
663
+
664
+ var top = stack[stack.length-1];
665
+ if (!tag || top.tagName == tag.tagName) {
666
+ return stack.pop();
667
+ }
668
+ else if (this.voidElements[tag.tagName]) {
669
+ return;
670
+ }
671
+ else if (this.voidElements[top.tagName]) {
672
+ stack.pop();
673
+ continue;
674
+ } else {
675
+ return null;
676
+ }
677
+ }
678
+ };
679
+
680
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
681
+ var firstTag = this._getFirstTagInLine(session, row);
682
+
683
+ if (!firstTag.match)
684
+ return null;
685
+
686
+ var isBackward = firstTag.closing || firstTag.selfClosing;
687
+ var stack = [];
688
+ var tag;
689
+
690
+ if (!isBackward) {
691
+ var iterator = new TokenIterator(session, row, firstTag.column);
692
+ var start = {
693
+ row: row,
694
+ column: firstTag.column + firstTag.tagName.length + 2
695
+ };
696
+ while (tag = this._readTagForward(iterator)) {
697
+ if (tag.selfClosing) {
698
+ if (!stack.length) {
699
+ tag.start.column += tag.tagName.length + 2;
700
+ tag.end.column -= 2;
701
+ return Range.fromPoints(tag.start, tag.end);
702
+ } else
703
+ continue;
704
+ }
705
+
706
+ if (tag.closing) {
707
+ this._pop(stack, tag);
708
+ if (stack.length == 0)
709
+ return Range.fromPoints(start, tag.start);
710
+ }
711
+ else {
712
+ stack.push(tag)
713
+ }
714
+ }
715
+ }
716
+ else {
717
+ var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length);
718
+ var end = {
719
+ row: row,
720
+ column: firstTag.column
721
+ };
722
+
723
+ while (tag = this._readTagBackward(iterator)) {
724
+ if (tag.selfClosing) {
725
+ if (!stack.length) {
726
+ tag.start.column += tag.tagName.length + 2;
727
+ tag.end.column -= 2;
728
+ return Range.fromPoints(tag.start, tag.end);
729
+ } else
730
+ continue;
731
+ }
732
+
733
+ if (!tag.closing) {
734
+ this._pop(stack, tag);
735
+ if (stack.length == 0) {
736
+ tag.start.column += tag.tagName.length + 2;
737
+ return Range.fromPoints(tag.start, end);
738
+ }
739
+ }
740
+ else {
741
+ stack.push(tag)
742
+ }
743
+ }
744
+ }
745
+
746
+ };
747
+
748
+ }).call(FoldMode.prototype);
749
+
750
+ });
751
+
752
+ define('ace/mode/folding/fold_mode', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
753
+
754
+
755
+ var Range = require("../../range").Range;
756
+
757
+ var FoldMode = exports.FoldMode = function() {};
758
+
759
+ (function() {
760
+
761
+ this.foldingStartMarker = null;
762
+ this.foldingStopMarker = null;
763
+
764
+ // must return "" if there's no fold, to enable caching
765
+ this.getFoldWidget = function(session, foldStyle, row) {
766
+ var line = session.getLine(row);
767
+ if (this.foldingStartMarker.test(line))
768
+ return "start";
769
+ if (foldStyle == "markbeginend"
770
+ && this.foldingStopMarker
771
+ && this.foldingStopMarker.test(line))
772
+ return "end";
773
+ return "";
774
+ };
775
+
776
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
777
+ return null;
778
+ };
779
+
780
+ this.indentationBlock = function(session, row, column) {
781
+ var re = /\S/;
782
+ var line = session.getLine(row);
783
+ var startLevel = line.search(re);
784
+ if (startLevel == -1)
785
+ return;
786
+
787
+ var startColumn = column || line.length;
788
+ var maxRow = session.getLength();
789
+ var startRow = row;
790
+ var endRow = row;
791
+
792
+ while (++row < maxRow) {
793
+ var level = session.getLine(row).search(re);
794
+
795
+ if (level == -1)
796
+ continue;
797
+
798
+ if (level <= startLevel)
799
+ break;
800
+
801
+ endRow = row;
802
+ }
803
+
804
+ if (endRow > startRow) {
805
+ var endColumn = session.getLine(endRow).length;
806
+ return new Range(startRow, startColumn, endRow, endColumn);
807
+ }
808
+ };
809
+
810
+ this.openingBracketBlock = function(session, bracket, row, column, typeRe) {
811
+ var start = {row: row, column: column + 1};
812
+ var end = session.$findClosingBracket(bracket, start, typeRe);
813
+ if (!end)
814
+ return;
815
+
816
+ var fw = session.foldWidgets[end.row];
817
+ if (fw == null)
818
+ fw = this.getFoldWidget(session, end.row);
819
+
820
+ if (fw == "start" && end.row > start.row) {
821
+ end.row --;
822
+ end.column = session.getLine(end.row).length;
823
+ }
824
+ return Range.fromPoints(start, end);
825
+ };
826
+
827
+ }).call(FoldMode.prototype);
828
+
829
+ });