ace-rails-ap 0.0.2 → 0.0.3

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