aced_rails 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (255) hide show
  1. data/.gitignore +17 -0
  2. data/CHANGELOG.md +4 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE +22 -0
  5. data/README.md +49 -0
  6. data/Rakefile +2 -0
  7. data/aced_rails.gemspec +19 -0
  8. data/lib/aced_rails.rb +7 -0
  9. data/lib/aced_rails/engine.rb +4 -0
  10. data/lib/aced_rails/version.rb +3 -0
  11. data/vendor/assets/javascripts/ace/ace-compat-noconflict.js +1 -0
  12. data/vendor/assets/javascripts/ace/ace-compat-uncompressed-noconflict.js +480 -0
  13. data/vendor/assets/javascripts/ace/ace-compat-uncompressed.js +480 -0
  14. data/vendor/assets/javascripts/ace/ace-compat.js +1 -0
  15. data/vendor/assets/javascripts/ace/ace-noconflict.js +10 -0
  16. data/vendor/assets/javascripts/ace/ace-uncompressed-noconflict.js +14649 -0
  17. data/vendor/assets/javascripts/ace/ace-uncompressed.js +14649 -0
  18. data/vendor/assets/javascripts/ace/ace.js +10 -0
  19. data/vendor/assets/javascripts/ace/keybinding-emacs-noconflict.js +1 -0
  20. data/vendor/assets/javascripts/ace/keybinding-emacs-uncompressed-noconflict.js +405 -0
  21. data/vendor/assets/javascripts/ace/keybinding-emacs-uncompressed.js +405 -0
  22. data/vendor/assets/javascripts/ace/keybinding-emacs.js +1 -0
  23. data/vendor/assets/javascripts/ace/keybinding-vim-noconflict.js +1 -0
  24. data/vendor/assets/javascripts/ace/keybinding-vim-uncompressed-noconflict.js +393 -0
  25. data/vendor/assets/javascripts/ace/keybinding-vim-uncompressed.js +393 -0
  26. data/vendor/assets/javascripts/ace/keybinding-vim.js +1 -0
  27. data/vendor/assets/javascripts/ace/mode-c_cpp-noconflict.js +1 -0
  28. data/vendor/assets/javascripts/ace/mode-c_cpp-uncompressed-noconflict.js +918 -0
  29. data/vendor/assets/javascripts/ace/mode-c_cpp-uncompressed.js +918 -0
  30. data/vendor/assets/javascripts/ace/mode-c_cpp.js +1 -0
  31. data/vendor/assets/javascripts/ace/mode-clojure-noconflict.js +1 -0
  32. data/vendor/assets/javascripts/ace/mode-clojure-uncompressed-noconflict.js +422 -0
  33. data/vendor/assets/javascripts/ace/mode-clojure-uncompressed.js +422 -0
  34. data/vendor/assets/javascripts/ace/mode-clojure.js +1 -0
  35. data/vendor/assets/javascripts/ace/mode-coffee-noconflict.js +1 -0
  36. data/vendor/assets/javascripts/ace/mode-coffee-uncompressed-noconflict.js +605 -0
  37. data/vendor/assets/javascripts/ace/mode-coffee-uncompressed.js +605 -0
  38. data/vendor/assets/javascripts/ace/mode-coffee.js +1 -0
  39. data/vendor/assets/javascripts/ace/mode-coldfusion-noconflict.js +1 -0
  40. data/vendor/assets/javascripts/ace/mode-coldfusion-uncompressed-noconflict.js +2361 -0
  41. data/vendor/assets/javascripts/ace/mode-coldfusion-uncompressed.js +2361 -0
  42. data/vendor/assets/javascripts/ace/mode-coldfusion.js +1 -0
  43. data/vendor/assets/javascripts/ace/mode-csharp-noconflict.js +1 -0
  44. data/vendor/assets/javascripts/ace/mode-csharp-uncompressed-noconflict.js +768 -0
  45. data/vendor/assets/javascripts/ace/mode-csharp-uncompressed.js +768 -0
  46. data/vendor/assets/javascripts/ace/mode-csharp.js +1 -0
  47. data/vendor/assets/javascripts/ace/mode-css-noconflict.js +1 -0
  48. data/vendor/assets/javascripts/ace/mode-css-uncompressed-noconflict.js +664 -0
  49. data/vendor/assets/javascripts/ace/mode-css-uncompressed.js +664 -0
  50. data/vendor/assets/javascripts/ace/mode-css.js +1 -0
  51. data/vendor/assets/javascripts/ace/mode-groovy-noconflict.js +1 -0
  52. data/vendor/assets/javascripts/ace/mode-groovy-uncompressed-noconflict.js +1280 -0
  53. data/vendor/assets/javascripts/ace/mode-groovy-uncompressed.js +1280 -0
  54. data/vendor/assets/javascripts/ace/mode-groovy.js +1 -0
  55. data/vendor/assets/javascripts/ace/mode-haxe-noconflict.js +1 -0
  56. data/vendor/assets/javascripts/ace/mode-haxe-uncompressed-noconflict.js +768 -0
  57. data/vendor/assets/javascripts/ace/mode-haxe-uncompressed.js +768 -0
  58. data/vendor/assets/javascripts/ace/mode-haxe.js +1 -0
  59. data/vendor/assets/javascripts/ace/mode-html-noconflict.js +1 -0
  60. data/vendor/assets/javascripts/ace/mode-html-uncompressed-noconflict.js +2377 -0
  61. data/vendor/assets/javascripts/ace/mode-html-uncompressed.js +2377 -0
  62. data/vendor/assets/javascripts/ace/mode-html.js +1 -0
  63. data/vendor/assets/javascripts/ace/mode-java-noconflict.js +1 -0
  64. data/vendor/assets/javascripts/ace/mode-java-uncompressed-noconflict.js +1282 -0
  65. data/vendor/assets/javascripts/ace/mode-java-uncompressed.js +1282 -0
  66. data/vendor/assets/javascripts/ace/mode-java.js +1 -0
  67. data/vendor/assets/javascripts/ace/mode-javascript-noconflict.js +1 -0
  68. data/vendor/assets/javascripts/ace/mode-javascript-uncompressed-noconflict.js +1113 -0
  69. data/vendor/assets/javascripts/ace/mode-javascript-uncompressed.js +1113 -0
  70. data/vendor/assets/javascripts/ace/mode-javascript.js +1 -0
  71. data/vendor/assets/javascripts/ace/mode-json-noconflict.js +1 -0
  72. data/vendor/assets/javascripts/ace/mode-json-uncompressed-noconflict.js +696 -0
  73. data/vendor/assets/javascripts/ace/mode-json-uncompressed.js +696 -0
  74. data/vendor/assets/javascripts/ace/mode-json.js +1 -0
  75. data/vendor/assets/javascripts/ace/mode-latex-noconflict.js +1 -0
  76. data/vendor/assets/javascripts/ace/mode-latex-uncompressed-noconflict.js +95 -0
  77. data/vendor/assets/javascripts/ace/mode-latex-uncompressed.js +95 -0
  78. data/vendor/assets/javascripts/ace/mode-latex.js +1 -0
  79. data/vendor/assets/javascripts/ace/mode-lua-noconflict.js +1 -0
  80. data/vendor/assets/javascripts/ace/mode-lua-uncompressed-noconflict.js +523 -0
  81. data/vendor/assets/javascripts/ace/mode-lua-uncompressed.js +523 -0
  82. data/vendor/assets/javascripts/ace/mode-lua.js +1 -0
  83. data/vendor/assets/javascripts/ace/mode-markdown-noconflict.js +1 -0
  84. data/vendor/assets/javascripts/ace/mode-markdown-uncompressed-noconflict.js +2819 -0
  85. data/vendor/assets/javascripts/ace/mode-markdown-uncompressed.js +2819 -0
  86. data/vendor/assets/javascripts/ace/mode-markdown.js +1 -0
  87. data/vendor/assets/javascripts/ace/mode-ocaml-noconflict.js +1 -0
  88. data/vendor/assets/javascripts/ace/mode-ocaml-uncompressed-noconflict.js +539 -0
  89. data/vendor/assets/javascripts/ace/mode-ocaml-uncompressed.js +539 -0
  90. data/vendor/assets/javascripts/ace/mode-ocaml.js +1 -0
  91. data/vendor/assets/javascripts/ace/mode-perl-noconflict.js +1 -0
  92. data/vendor/assets/javascripts/ace/mode-perl-uncompressed-noconflict.js +573 -0
  93. data/vendor/assets/javascripts/ace/mode-perl-uncompressed.js +573 -0
  94. data/vendor/assets/javascripts/ace/mode-perl.js +1 -0
  95. data/vendor/assets/javascripts/ace/mode-pgsql-noconflict.js +1 -0
  96. data/vendor/assets/javascripts/ace/mode-pgsql-uncompressed-noconflict.js +1107 -0
  97. data/vendor/assets/javascripts/ace/mode-pgsql-uncompressed.js +1107 -0
  98. data/vendor/assets/javascripts/ace/mode-pgsql.js +1 -0
  99. data/vendor/assets/javascripts/ace/mode-php-noconflict.js +1 -0
  100. data/vendor/assets/javascripts/ace/mode-php-uncompressed-noconflict.js +1884 -0
  101. data/vendor/assets/javascripts/ace/mode-php-uncompressed.js +1884 -0
  102. data/vendor/assets/javascripts/ace/mode-php.js +1 -0
  103. data/vendor/assets/javascripts/ace/mode-powershell-noconflict.js +1 -0
  104. data/vendor/assets/javascripts/ace/mode-powershell-uncompressed-noconflict.js +706 -0
  105. data/vendor/assets/javascripts/ace/mode-powershell-uncompressed.js +706 -0
  106. data/vendor/assets/javascripts/ace/mode-powershell.js +1 -0
  107. data/vendor/assets/javascripts/ace/mode-python-noconflict.js +1 -0
  108. data/vendor/assets/javascripts/ace/mode-python-uncompressed-noconflict.js +506 -0
  109. data/vendor/assets/javascripts/ace/mode-python-uncompressed.js +506 -0
  110. data/vendor/assets/javascripts/ace/mode-python.js +1 -0
  111. data/vendor/assets/javascripts/ace/mode-ruby-noconflict.js +1 -0
  112. data/vendor/assets/javascripts/ace/mode-ruby-uncompressed-noconflict.js +391 -0
  113. data/vendor/assets/javascripts/ace/mode-ruby-uncompressed.js +391 -0
  114. data/vendor/assets/javascripts/ace/mode-ruby.js +1 -0
  115. data/vendor/assets/javascripts/ace/mode-scad-noconflict.js +1 -0
  116. data/vendor/assets/javascripts/ace/mode-scad-uncompressed-noconflict.js +906 -0
  117. data/vendor/assets/javascripts/ace/mode-scad-uncompressed.js +906 -0
  118. data/vendor/assets/javascripts/ace/mode-scad.js +1 -0
  119. data/vendor/assets/javascripts/ace/mode-scala-noconflict.js +1 -0
  120. data/vendor/assets/javascripts/ace/mode-scala-uncompressed-noconflict.js +1282 -0
  121. data/vendor/assets/javascripts/ace/mode-scala-uncompressed.js +1282 -0
  122. data/vendor/assets/javascripts/ace/mode-scala.js +1 -0
  123. data/vendor/assets/javascripts/ace/mode-scss-noconflict.js +1 -0
  124. data/vendor/assets/javascripts/ace/mode-scss-uncompressed-noconflict.js +678 -0
  125. data/vendor/assets/javascripts/ace/mode-scss-uncompressed.js +678 -0
  126. data/vendor/assets/javascripts/ace/mode-scss.js +1 -0
  127. data/vendor/assets/javascripts/ace/mode-sh-noconflict.js +1 -0
  128. data/vendor/assets/javascripts/ace/mode-sh-uncompressed-noconflict.js +268 -0
  129. data/vendor/assets/javascripts/ace/mode-sh-uncompressed.js +268 -0
  130. data/vendor/assets/javascripts/ace/mode-sh.js +1 -0
  131. data/vendor/assets/javascripts/ace/mode-sql-noconflict.js +1 -0
  132. data/vendor/assets/javascripts/ace/mode-sql-uncompressed-noconflict.js +159 -0
  133. data/vendor/assets/javascripts/ace/mode-sql-uncompressed.js +159 -0
  134. data/vendor/assets/javascripts/ace/mode-sql.js +1 -0
  135. data/vendor/assets/javascripts/ace/mode-svg-noconflict.js +1 -0
  136. data/vendor/assets/javascripts/ace/mode-svg-uncompressed-noconflict.js +2016 -0
  137. data/vendor/assets/javascripts/ace/mode-svg-uncompressed.js +2016 -0
  138. data/vendor/assets/javascripts/ace/mode-svg.js +1 -0
  139. data/vendor/assets/javascripts/ace/mode-text-noconflict.js +0 -0
  140. data/vendor/assets/javascripts/ace/mode-text-uncompressed-noconflict.js +0 -0
  141. data/vendor/assets/javascripts/ace/mode-text-uncompressed.js +0 -0
  142. data/vendor/assets/javascripts/ace/mode-text.js +0 -0
  143. data/vendor/assets/javascripts/ace/mode-textile-noconflict.js +1 -0
  144. data/vendor/assets/javascripts/ace/mode-textile-uncompressed-noconflict.js +254 -0
  145. data/vendor/assets/javascripts/ace/mode-textile-uncompressed.js +254 -0
  146. data/vendor/assets/javascripts/ace/mode-textile.js +1 -0
  147. data/vendor/assets/javascripts/ace/mode-xml-noconflict.js +1 -0
  148. data/vendor/assets/javascripts/ace/mode-xml-uncompressed-noconflict.js +1001 -0
  149. data/vendor/assets/javascripts/ace/mode-xml-uncompressed.js +1001 -0
  150. data/vendor/assets/javascripts/ace/mode-xml.js +1 -0
  151. data/vendor/assets/javascripts/ace/theme-chrome-noconflict.js +1 -0
  152. data/vendor/assets/javascripts/ace/theme-chrome-uncompressed-noconflict.js +212 -0
  153. data/vendor/assets/javascripts/ace/theme-chrome-uncompressed.js +212 -0
  154. data/vendor/assets/javascripts/ace/theme-chrome.js +1 -0
  155. data/vendor/assets/javascripts/ace/theme-clouds-noconflict.js +1 -0
  156. data/vendor/assets/javascripts/ace/theme-clouds-uncompressed-noconflict.js +155 -0
  157. data/vendor/assets/javascripts/ace/theme-clouds-uncompressed.js +155 -0
  158. data/vendor/assets/javascripts/ace/theme-clouds.js +1 -0
  159. data/vendor/assets/javascripts/ace/theme-clouds_midnight-noconflict.js +1 -0
  160. data/vendor/assets/javascripts/ace/theme-clouds_midnight-uncompressed-noconflict.js +156 -0
  161. data/vendor/assets/javascripts/ace/theme-clouds_midnight-uncompressed.js +156 -0
  162. data/vendor/assets/javascripts/ace/theme-clouds_midnight.js +1 -0
  163. data/vendor/assets/javascripts/ace/theme-cobalt-noconflict.js +1 -0
  164. data/vendor/assets/javascripts/ace/theme-cobalt-uncompressed-noconflict.js +170 -0
  165. data/vendor/assets/javascripts/ace/theme-cobalt-uncompressed.js +170 -0
  166. data/vendor/assets/javascripts/ace/theme-cobalt.js +1 -0
  167. data/vendor/assets/javascripts/ace/theme-crimson_editor-noconflict.js +1 -0
  168. data/vendor/assets/javascripts/ace/theme-crimson_editor-uncompressed-noconflict.js +198 -0
  169. data/vendor/assets/javascripts/ace/theme-crimson_editor-uncompressed.js +198 -0
  170. data/vendor/assets/javascripts/ace/theme-crimson_editor.js +1 -0
  171. data/vendor/assets/javascripts/ace/theme-dawn-noconflict.js +1 -0
  172. data/vendor/assets/javascripts/ace/theme-dawn-uncompressed-noconflict.js +174 -0
  173. data/vendor/assets/javascripts/ace/theme-dawn-uncompressed.js +174 -0
  174. data/vendor/assets/javascripts/ace/theme-dawn.js +1 -0
  175. data/vendor/assets/javascripts/ace/theme-dreamweaver-noconflict.js +1 -0
  176. data/vendor/assets/javascripts/ace/theme-dreamweaver-uncompressed-noconflict.js +227 -0
  177. data/vendor/assets/javascripts/ace/theme-dreamweaver-uncompressed.js +227 -0
  178. data/vendor/assets/javascripts/ace/theme-dreamweaver.js +1 -0
  179. data/vendor/assets/javascripts/ace/theme-eclipse-noconflict.js +1 -0
  180. data/vendor/assets/javascripts/ace/theme-eclipse-uncompressed-noconflict.js +147 -0
  181. data/vendor/assets/javascripts/ace/theme-eclipse-uncompressed.js +147 -0
  182. data/vendor/assets/javascripts/ace/theme-eclipse.js +1 -0
  183. data/vendor/assets/javascripts/ace/theme-idle_fingers-noconflict.js +1 -0
  184. data/vendor/assets/javascripts/ace/theme-idle_fingers-uncompressed-noconflict.js +162 -0
  185. data/vendor/assets/javascripts/ace/theme-idle_fingers-uncompressed.js +162 -0
  186. data/vendor/assets/javascripts/ace/theme-idle_fingers.js +1 -0
  187. data/vendor/assets/javascripts/ace/theme-kr_theme-noconflict.js +1 -0
  188. data/vendor/assets/javascripts/ace/theme-kr_theme-uncompressed-noconflict.js +165 -0
  189. data/vendor/assets/javascripts/ace/theme-kr_theme-uncompressed.js +165 -0
  190. data/vendor/assets/javascripts/ace/theme-kr_theme.js +1 -0
  191. data/vendor/assets/javascripts/ace/theme-merbivore-noconflict.js +1 -0
  192. data/vendor/assets/javascripts/ace/theme-merbivore-uncompressed-noconflict.js +165 -0
  193. data/vendor/assets/javascripts/ace/theme-merbivore-uncompressed.js +165 -0
  194. data/vendor/assets/javascripts/ace/theme-merbivore.js +1 -0
  195. data/vendor/assets/javascripts/ace/theme-merbivore_soft-noconflict.js +1 -0
  196. data/vendor/assets/javascripts/ace/theme-merbivore_soft-uncompressed-noconflict.js +171 -0
  197. data/vendor/assets/javascripts/ace/theme-merbivore_soft-uncompressed.js +171 -0
  198. data/vendor/assets/javascripts/ace/theme-merbivore_soft.js +1 -0
  199. data/vendor/assets/javascripts/ace/theme-mono_industrial-noconflict.js +1 -0
  200. data/vendor/assets/javascripts/ace/theme-mono_industrial-uncompressed-noconflict.js +169 -0
  201. data/vendor/assets/javascripts/ace/theme-mono_industrial-uncompressed.js +169 -0
  202. data/vendor/assets/javascripts/ace/theme-mono_industrial.js +1 -0
  203. data/vendor/assets/javascripts/ace/theme-monokai-noconflict.js +1 -0
  204. data/vendor/assets/javascripts/ace/theme-monokai-uncompressed-noconflict.js +171 -0
  205. data/vendor/assets/javascripts/ace/theme-monokai-uncompressed.js +171 -0
  206. data/vendor/assets/javascripts/ace/theme-monokai.js +1 -0
  207. data/vendor/assets/javascripts/ace/theme-pastel_on_dark-noconflict.js +1 -0
  208. data/vendor/assets/javascripts/ace/theme-pastel_on_dark-uncompressed-noconflict.js +179 -0
  209. data/vendor/assets/javascripts/ace/theme-pastel_on_dark-uncompressed.js +179 -0
  210. data/vendor/assets/javascripts/ace/theme-pastel_on_dark.js +1 -0
  211. data/vendor/assets/javascripts/ace/theme-solarized_dark-noconflict.js +1 -0
  212. data/vendor/assets/javascripts/ace/theme-solarized_dark-uncompressed-noconflict.js +160 -0
  213. data/vendor/assets/javascripts/ace/theme-solarized_dark-uncompressed.js +160 -0
  214. data/vendor/assets/javascripts/ace/theme-solarized_dark.js +1 -0
  215. data/vendor/assets/javascripts/ace/theme-solarized_light-noconflict.js +1 -0
  216. data/vendor/assets/javascripts/ace/theme-solarized_light-uncompressed-noconflict.js +159 -0
  217. data/vendor/assets/javascripts/ace/theme-solarized_light-uncompressed.js +159 -0
  218. data/vendor/assets/javascripts/ace/theme-solarized_light.js +1 -0
  219. data/vendor/assets/javascripts/ace/theme-textmate-noconflict.js +0 -0
  220. data/vendor/assets/javascripts/ace/theme-textmate-uncompressed-noconflict.js +0 -0
  221. data/vendor/assets/javascripts/ace/theme-textmate-uncompressed.js +0 -0
  222. data/vendor/assets/javascripts/ace/theme-textmate.js +0 -0
  223. data/vendor/assets/javascripts/ace/theme-tomorrow-noconflict.js +1 -0
  224. data/vendor/assets/javascripts/ace/theme-tomorrow-uncompressed-noconflict.js +189 -0
  225. data/vendor/assets/javascripts/ace/theme-tomorrow-uncompressed.js +189 -0
  226. data/vendor/assets/javascripts/ace/theme-tomorrow.js +1 -0
  227. data/vendor/assets/javascripts/ace/theme-tomorrow_night-noconflict.js +1 -0
  228. data/vendor/assets/javascripts/ace/theme-tomorrow_night-uncompressed-noconflict.js +189 -0
  229. data/vendor/assets/javascripts/ace/theme-tomorrow_night-uncompressed.js +189 -0
  230. data/vendor/assets/javascripts/ace/theme-tomorrow_night.js +1 -0
  231. data/vendor/assets/javascripts/ace/theme-tomorrow_night_blue-noconflict.js +1 -0
  232. data/vendor/assets/javascripts/ace/theme-tomorrow_night_blue-uncompressed-noconflict.js +189 -0
  233. data/vendor/assets/javascripts/ace/theme-tomorrow_night_blue-uncompressed.js +189 -0
  234. data/vendor/assets/javascripts/ace/theme-tomorrow_night_blue.js +1 -0
  235. data/vendor/assets/javascripts/ace/theme-tomorrow_night_bright-noconflict.js +1 -0
  236. data/vendor/assets/javascripts/ace/theme-tomorrow_night_bright-uncompressed-noconflict.js +189 -0
  237. data/vendor/assets/javascripts/ace/theme-tomorrow_night_bright-uncompressed.js +189 -0
  238. data/vendor/assets/javascripts/ace/theme-tomorrow_night_bright.js +1 -0
  239. data/vendor/assets/javascripts/ace/theme-tomorrow_night_eighties-noconflict.js +1 -0
  240. data/vendor/assets/javascripts/ace/theme-tomorrow_night_eighties-uncompressed-noconflict.js +185 -0
  241. data/vendor/assets/javascripts/ace/theme-tomorrow_night_eighties-uncompressed.js +185 -0
  242. data/vendor/assets/javascripts/ace/theme-tomorrow_night_eighties.js +1 -0
  243. data/vendor/assets/javascripts/ace/theme-twilight-noconflict.js +1 -0
  244. data/vendor/assets/javascripts/ace/theme-twilight-uncompressed-noconflict.js +183 -0
  245. data/vendor/assets/javascripts/ace/theme-twilight-uncompressed.js +183 -0
  246. data/vendor/assets/javascripts/ace/theme-twilight.js +1 -0
  247. data/vendor/assets/javascripts/ace/theme-vibrant_ink-noconflict.js +1 -0
  248. data/vendor/assets/javascripts/ace/theme-vibrant_ink-uncompressed-noconflict.js +166 -0
  249. data/vendor/assets/javascripts/ace/theme-vibrant_ink-uncompressed.js +166 -0
  250. data/vendor/assets/javascripts/ace/theme-vibrant_ink.js +1 -0
  251. data/vendor/assets/javascripts/ace/worker-coffee.js +7456 -0
  252. data/vendor/assets/javascripts/ace/worker-css.js +11693 -0
  253. data/vendor/assets/javascripts/ace/worker-javascript.js +10305 -0
  254. data/vendor/assets/javascripts/ace/worker-json.js +3062 -0
  255. metadata +310 -0
@@ -0,0 +1 @@
1
+ define("ace/mode/csharp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/csharp_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("./text").Mode,f=a("../tokenizer").Tokenizer,g=a("./csharp_highlight_rules").CSharpHighlightRules,h=a("./matching_brace_outdent").MatchingBraceOutdent,i=a("./behaviour/cstyle").CstyleBehaviour,j=a("./folding/cstyle").FoldMode,k=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h,this.$behaviour=new i,this.foldingRules=new j};d.inherits(k,e),function(){this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var g=b.match(/^.*[\{\(\[]\s*$/);g&&(d+=c)}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)},this.createWorker=function(a){return null}}.call(k.prototype),b.Mode=k}),define("ace/mode/csharp_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("../lib/lang"),f=a("./doc_comment_highlight_rules").DocCommentHighlightRules,g=a("./text_highlight_rules").TextHighlightRules,h=function(){var a=e.arrayToMap("abstract|event|new|struct|as|explicit|null|switch|base|extern|object|this|bool|false|operator|throw|break|finally|out|true|byte|fixed|override|try|case|float|params|typeof|catch|for|private|uint|char|foreach|protected|ulong|checked|goto|public|unchecked|class|if|readonly|unsafe|const|implicit|ref|ushort|continue|in|return|using|decimal|int|sbyte|virtual|default|interface|sealed|volatile|delegate|internal|short|void|do|is|sizeof|while|double|lock|stackalloc|else|long|static|enum|namespace|string|var|dynamic".split("|")),b=e.arrayToMap("null|true|false".split("|"));this.$rules={start:[{token:"comment",regex:"\\/\\/.*$"},(new f).getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",merge:!0,next:"comment"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:function(c){return c=="this"?"variable.language":a.hasOwnProperty(c)?"keyword":b.hasOwnProperty(c)?"constant.language":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"punctuation.operator",regex:"\\?|\\:|\\,|\\;|\\."},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",merge:!0,regex:".+"}]},this.embedRules(f,"doc-",[(new f).getEndRule("start")])};d.inherits(h,g),b.CSharpHighlightRules=h}),define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("./text_highlight_rules").TextHighlightRules,f=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc",merge:!0,regex:"\\s+"},{token:"comment.doc",merge:!0,regex:"TODO"},{token:"comment.doc",merge:!0,regex:"[^@\\*]+"},{token:"comment.doc",merge:!0,regex:"."}]}};d.inherits(f,e),function(){this.getStartRule=function(a){return{token:"comment.doc",merge:!0,regex:"\\/\\*(?=\\*)",next:a}},this.getEndRule=function(a){return{token:"comment.doc",merge:!0,regex:"\\*\\/",next:a}}}.call(f.prototype),b.DocCommentHighlightRules=f}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(a,b,c){"use strict";var d=a("../range").Range,e=function(){};((function(){this.checkOutdent=function(a,b){return/^\s+$/.test(a)?/^\s*\}/.test(b):!1},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);return b?b[1]:""}})).call(e.prototype),b.MatchingBraceOutdent=e}),define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour"],function(a,b,c){"use strict";var d=a("../../lib/oop"),e=a("../behaviour").Behaviour,f=function(){this.add("braces","insertion",function(a,b,c,d,e){if(e=="{"){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);return g!==""?{text:"{"+g+"}",selection:!1}:{text:"{}",selection:[1,1]}}if(e=="}"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j=="}"){var k=d.$findOpeningBracket("}",{column:h.column+1,row:h.row});if(k!==null)return{text:"",selection:[1,1]}}}else if(e=="\n"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j=="}"){var l=d.findMatchingBracket({row:h.row,column:h.column+1});if(!l)return null;var m=this.getNextLineIndent(a,i.substring(0,i.length-1),d.getTabString()),n=this.$getIndent(d.doc.getLine(l.row));return{text:"\n"+m+"\n"+n,selection:[1,m.length,1,m.length]}}}}),this.add("braces","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=="{"){var g=d.doc.getLine(e.start.row),h=g.substring(e.end.column,e.end.column+1);if(h=="}")return e.end.column++,e}}),this.add("parens","insertion",function(a,b,c,d,e){if(e=="("){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);return g!==""?{text:"("+g+")",selection:!1}:{text:"()",selection:[1,1]}}if(e==")"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j==")"){var k=d.$findOpeningBracket(")",{column:h.column+1,row:h.row});if(k!==null)return{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=="("){var g=d.doc.getLine(e.start.row),h=g.substring(e.start.column+1,e.start.column+2);if(h==")")return e.end.column++,e}}),this.add("string_dquotes","insertion",function(a,b,c,d,e){if(e=='"'){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);if(g!=="")return{text:'"'+g+'"',selection:!1};var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column-1,h.column);if(j=="\\")return null;var k=d.getTokens(f.start.row,f.start.row)[0].tokens,l=0,m,n=-1;for(var o=0;o<k.length;o++){m=k[o],m.type=="string"?n=-1:n<0&&(n=m.value.indexOf('"'));if(m.value.length+l>f.start.column)break;l+=k[o].value.length}if(!m||n<0&&m.type!=="comment"&&(m.type!=="string"||f.start.column!==m.value.length+l-1&&m.value.lastIndexOf('"')===m.value.length-1))return{text:'""',selection:[1,1]};if(m&&m.type==="string"){var p=i.substring(h.column,h.column+1);if(p=='"')return{text:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=='"'){var g=d.doc.getLine(e.start.row),h=g.substring(e.start.column+1,e.start.column+2);if(h=='"')return e.end.column++,e}})};d.inherits(f,e),b.CstyleBehaviour=f}),define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(a,b,c){"use strict";var d=a("../../lib/oop"),e=a("../../range").Range,f=a("./fold_mode").FoldMode,g=b.FoldMode=function(){};d.inherits(g,f),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.getFoldWidgetRange=function(a,b,c){var d=a.getLine(c),f=d.match(this.foldingStartMarker);if(f){var g=f.index;if(f[1])return this.openingBracketBlock(a,f[1],c,g);var h=a.getCommentFoldRange(c,g+f[0].length);return h.end.column-=2,h}if(b!=="markbeginend")return;var f=d.match(this.foldingStopMarker);if(f){var g=f.index+f[0].length;if(f[2]){var h=a.getCommentFoldRange(c,g);return h.end.column-=2,h}var i={row:c,column:g},j=a.$findOpeningBracket(f[1],i);if(!j)return;return j.column++,i.column--,e.fromPoints(j,i)}}}.call(g.prototype)}),define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(a,b,c){"use strict";var d=a("../../range").Range,e=b.FoldMode=function(){};((function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(a,b,c){var d=a.getLine(c);return this.foldingStartMarker.test(d)?"start":b=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(d)?"end":""},this.getFoldWidgetRange=function(a,b,c){return null},this.indentationBlock=function(a,b,c){var e=/^\s*/,f=b,g=b,h=a.getLine(b),i=c||h.length,j=h.match(e)[0].length,k=a.getLength();while(++b<k){h=a.getLine(b);var l=h.match(e)[0].length;if(l==h.length)continue;if(l<=j)break;g=b}if(g>f){var m=a.getLine(g).length;return new d(f,i,g,m)}},this.openingBracketBlock=function(a,b,c,e){var f={row:c,column:e+1},g=a.$findClosingBracket(b,f);if(!g)return;var h=a.foldWidgets[g.row];return h==null&&(h=this.getFoldWidget(a,g.row)),h=="start"&&(g.row--,g.column=a.getLine(g.row).length),d.fromPoints(f,g)}})).call(e.prototype)})
@@ -0,0 +1 @@
1
+ ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/folding/cstyle"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("./text").Mode,f=a("../tokenizer").Tokenizer,g=a("./css_highlight_rules").CssHighlightRules,h=a("./matching_brace_outdent").MatchingBraceOutdent,i=a("../worker/worker_client").WorkerClient,j=a("./folding/cstyle").FoldMode,k=function(){this.$tokenizer=new f((new g).getRules(),"i"),this.$outdent=new h,this.foldingRules=new j};d.inherits(k,e),function(){this.foldingRules="cStyle",this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a).tokens;if(e.length&&e[e.length-1].type=="comment")return d;var f=b.match(/^.*\{\s*$/);return f&&(d+=c),d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)},this.createWorker=function(a){var b=new i(["ace"],"worker-css.js","ace/mode/css_worker","Worker");return b.attachToDocument(a.getDocument()),b.on("csslint",function(b){var c=[];b.data.forEach(function(a){c.push({row:a.line-1,column:a.col-1,text:a.message,type:a.type,lint:a})}),a.setAnnotations(c)}),b}}.call(k.prototype),b.Mode=k}),ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("../lib/lang"),f=a("./text_highlight_rules").TextHighlightRules,g=function(){var a=e.arrayToMap("-moz-appearance|-moz-box-sizing|-webkit-box-sizing|-moz-outline-radius|-moz-transform|-webkit-transform|appearance|azimuth|background-attachment|background-color|background-image|background-origin|background-position|background-repeat|background|border-bottom-color|border-bottom-style|border-bottom-width|border-bottom|border-collapse|border-color|border-left-color|border-left-style|border-left-width|border-left|border-right-color|border-right-style|border-right-width|border-right|border-spacing|border-style|border-top-color|border-top-style|border-top-width|border-top|border-width|border|bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|counter-reset|cue-after|cue-before|cue|cursor|direction|display|elevation|empty-cells|float|font-family|font-size-adjust|font-size|font-stretch|font-style|font-variant|font-weight|font|height|left|letter-spacing|line-height|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|marker-offset|margin|marks|max-height|max-width|min-height|min-width|-moz-border-radius|opacity|orphans|outline-color|outline-offset|outline-radius|outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page|pause-after|pause-before|pause|pitch-range|pitch|play-during|pointer-events|position|quotes|resize|richness|right|size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|stress|table-layout|text-align|text-decoration|text-indent|text-shadow|text-transform|top|transform|unicode-bidi|vertical-align|visibility|voice-family|volume|white-space|widows|width|word-spacing|z-index".split("|")),b=e.arrayToMap("rgb|rgba|url|attr|counter|counters".split("|")),c=e.arrayToMap("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|decimal-leading-zero|decimal|default|disabled|disc|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|inactive|inherit|inline-block|inline|inset|inside|inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|keep-all|left|lighter|line-edge|line-through|line|list-item|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|solid|square|static|strict|super|sw-resize|table-footer-group|table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|zero".split("|")),d=e.arrayToMap("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow".split("|")),f="\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))",g=[{token:"comment",merge:!0,regex:"\\/\\*",next:"ruleset_comment"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"constant.numeric",regex:f+"(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)"},{token:"constant.numeric",regex:"#[a-f0-9]{6}"},{token:"constant.numeric",regex:"#[a-f0-9]{3}"},{token:function(e){return a.hasOwnProperty(e.toLowerCase())?"support.type":b.hasOwnProperty(e.toLowerCase())?"support.function":c.hasOwnProperty(e.toLowerCase())?"support.constant":d.hasOwnProperty(e.toLowerCase())?"support.constant.color":"text"},regex:"\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"}],h=e.copyArray(g);h.unshift({token:"paren.rparen",regex:"\\}",next:"start"});var i=e.copyArray(g);i.unshift({token:"paren.rparen",regex:"\\}",next:"media"});var j=[{token:"comment",merge:!0,regex:".+"}],k=e.copyArray(j);k.unshift({token:"comment",regex:".*?\\*\\/",next:"start"});var l=e.copyArray(j);l.unshift({token:"comment",regex:".*?\\*\\/",next:"media"});var m=e.copyArray(j);m.unshift({token:"comment",regex:".*?\\*\\/",next:"ruleset"}),this.$rules={start:[{token:"comment",merge:!0,regex:"\\/\\*",next:"comment"},{token:"paren.lparen",regex:"\\{",next:"ruleset"},{token:"string",regex:"@.*?{",next:"media"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant",regex:"[a-z0-9-_]+"}],media:[{token:"comment",merge:!0,regex:"\\/\\*",next:"media_comment"},{token:"paren.lparen",regex:"\\{",next:"media_ruleset"},{token:"string",regex:"\\}",next:"start"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant",regex:"[a-z0-9-_]+"}],comment:k,ruleset:h,ruleset_comment:m,media_ruleset:i,media_comment:l}};d.inherits(g,f),b.CssHighlightRules=g}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(a,b,c){"use strict";var d=a("../range").Range,e=function(){};((function(){this.checkOutdent=function(a,b){return/^\s+$/.test(a)?/^\s*\}/.test(b):!1},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);return b?b[1]:""}})).call(e.prototype),b.MatchingBraceOutdent=e}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(a,b,c){"use strict";var d=a("../../lib/oop"),e=a("../../range").Range,f=a("./fold_mode").FoldMode,g=b.FoldMode=function(){};d.inherits(g,f),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.getFoldWidgetRange=function(a,b,c){var d=a.getLine(c),f=d.match(this.foldingStartMarker);if(f){var g=f.index;if(f[1])return this.openingBracketBlock(a,f[1],c,g);var h=a.getCommentFoldRange(c,g+f[0].length);return h.end.column-=2,h}if(b!=="markbeginend")return;var f=d.match(this.foldingStopMarker);if(f){var g=f.index+f[0].length;if(f[2]){var h=a.getCommentFoldRange(c,g);return h.end.column-=2,h}var i={row:c,column:g},j=a.$findOpeningBracket(f[1],i);if(!j)return;return j.column++,i.column--,e.fromPoints(j,i)}}}.call(g.prototype)}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(a,b,c){"use strict";var d=a("../../range").Range,e=b.FoldMode=function(){};((function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(a,b,c){var d=a.getLine(c);return this.foldingStartMarker.test(d)?"start":b=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(d)?"end":""},this.getFoldWidgetRange=function(a,b,c){return null},this.indentationBlock=function(a,b,c){var e=/^\s*/,f=b,g=b,h=a.getLine(b),i=c||h.length,j=h.match(e)[0].length,k=a.getLength();while(++b<k){h=a.getLine(b);var l=h.match(e)[0].length;if(l==h.length)continue;if(l<=j)break;g=b}if(g>f){var m=a.getLine(g).length;return new d(f,i,g,m)}},this.openingBracketBlock=function(a,b,c,e){var f={row:c,column:e+1},g=a.$findClosingBracket(b,f);if(!g)return;var h=a.foldWidgets[g.row];return h==null&&(h=this.getFoldWidget(a,g.row)),h=="start"&&(g.row--,g.column=a.getLine(g.row).length),d.fromPoints(f,g)}})).call(e.prototype)})
@@ -0,0 +1,664 @@
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/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/css_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/worker/worker_client', 'ace/mode/folding/cstyle'], function(require, exports, module) {
39
+ "use strict";
40
+
41
+ var oop = require("../lib/oop");
42
+ var TextMode = require("./text").Mode;
43
+ var Tokenizer = require("../tokenizer").Tokenizer;
44
+ var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
45
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
46
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
47
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
48
+
49
+ var Mode = function() {
50
+ this.$tokenizer = new Tokenizer(new CssHighlightRules().getRules(), "i");
51
+ this.$outdent = new MatchingBraceOutdent();
52
+ this.foldingRules = new CStyleFoldMode();
53
+ };
54
+ oop.inherits(Mode, TextMode);
55
+
56
+ (function() {
57
+
58
+ this.foldingRules = "cStyle";
59
+
60
+ this.getNextLineIndent = function(state, line, tab) {
61
+ var indent = this.$getIndent(line);
62
+
63
+ // ignore braces in comments
64
+ var tokens = this.$tokenizer.getLineTokens(line, state).tokens;
65
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
66
+ return indent;
67
+ }
68
+
69
+ var match = line.match(/^.*\{\s*$/);
70
+ if (match) {
71
+ indent += tab;
72
+ }
73
+
74
+ return indent;
75
+ };
76
+
77
+ this.checkOutdent = function(state, line, input) {
78
+ return this.$outdent.checkOutdent(line, input);
79
+ };
80
+
81
+ this.autoOutdent = function(state, doc, row) {
82
+ this.$outdent.autoOutdent(doc, row);
83
+ };
84
+
85
+ this.createWorker = function(session) {
86
+ var worker = new WorkerClient(["ace"], "worker-css.js", "ace/mode/css_worker", "Worker");
87
+ worker.attachToDocument(session.getDocument());
88
+
89
+ worker.on("csslint", function(e) {
90
+ var errors = [];
91
+ e.data.forEach(function(message) {
92
+ errors.push({
93
+ row: message.line - 1,
94
+ column: message.col - 1,
95
+ text: message.message,
96
+ type: message.type,
97
+ lint: message
98
+ });
99
+ });
100
+
101
+ session.setAnnotations(errors);
102
+ });
103
+ return worker;
104
+ };
105
+
106
+ }).call(Mode.prototype);
107
+
108
+ exports.Mode = Mode;
109
+
110
+ });
111
+ /* ***** BEGIN LICENSE BLOCK *****
112
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
113
+ *
114
+ * The contents of this file are subject to the Mozilla Public License Version
115
+ * 1.1 (the "License"); you may not use this file except in compliance with
116
+ * the License. You may obtain a copy of the License at
117
+ * http://www.mozilla.org/MPL/
118
+ *
119
+ * Software distributed under the License is distributed on an "AS IS" basis,
120
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
121
+ * for the specific language governing rights and limitations under the
122
+ * License.
123
+ *
124
+ * The Original Code is Ajax.org Code Editor (ACE).
125
+ *
126
+ * The Initial Developer of the Original Code is
127
+ * Ajax.org B.V.
128
+ * Portions created by the Initial Developer are Copyright (C) 2010
129
+ * the Initial Developer. All Rights Reserved.
130
+ *
131
+ * Contributor(s):
132
+ * Fabian Jakobs <fabian AT ajax DOT org>
133
+ *
134
+ * Alternatively, the contents of this file may be used under the terms of
135
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
136
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
137
+ * in which case the provisions of the GPL or the LGPL are applicable instead
138
+ * of those above. If you wish to allow use of your version of this file only
139
+ * under the terms of either the GPL or the LGPL, and not to allow others to
140
+ * use your version of this file under the terms of the MPL, indicate your
141
+ * decision by deleting the provisions above and replace them with the notice
142
+ * and other provisions required by the GPL or the LGPL. If you do not delete
143
+ * the provisions above, a recipient may use your version of this file under
144
+ * the terms of any one of the MPL, the GPL or the LGPL.
145
+ *
146
+ * ***** END LICENSE BLOCK ***** */
147
+
148
+ ace.define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
149
+ "use strict";
150
+
151
+ var oop = require("../lib/oop");
152
+ var lang = require("../lib/lang");
153
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
154
+
155
+ var CssHighlightRules = function() {
156
+
157
+ var properties = lang.arrayToMap(
158
+ ("-moz-appearance|-moz-box-sizing|-webkit-box-sizing|-moz-outline-radius|-moz-transform|-webkit-transform|" +
159
+ "appearance|azimuth|background-attachment|background-color|background-image|" +
160
+ "background-origin|background-position|background-repeat|background|border-bottom-color|" +
161
+ "border-bottom-style|border-bottom-width|border-bottom|border-collapse|" +
162
+ "border-color|border-left-color|border-left-style|border-left-width|" +
163
+ "border-left|border-right-color|border-right-style|border-right-width|" +
164
+ "border-right|border-spacing|border-style|border-top-color|" +
165
+ "border-top-style|border-top-width|border-top|border-width|border|" +
166
+ "bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|" +
167
+ "counter-reset|cue-after|cue-before|cue|cursor|direction|display|" +
168
+ "elevation|empty-cells|float|font-family|font-size-adjust|font-size|" +
169
+ "font-stretch|font-style|font-variant|font-weight|font|height|left|" +
170
+ "letter-spacing|line-height|list-style-image|list-style-position|" +
171
+ "list-style-type|list-style|margin-bottom|margin-left|margin-right|" +
172
+ "margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" +
173
+ "min-width|-moz-border-radius|opacity|orphans|outline-color|outline-offset|outline-radius|" +
174
+ "outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" +
175
+ "padding-left|padding-right|padding-top|padding|page-break-after|" +
176
+ "page-break-before|page-break-inside|page|pause-after|pause-before|" +
177
+ "pause|pitch-range|pitch|play-during|pointer-events|position|quotes|resize|richness|right|" +
178
+ "size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" +
179
+ "stress|table-layout|text-align|text-decoration|text-indent|" +
180
+ "text-shadow|text-transform|top|transform|unicode-bidi|vertical-align|" +
181
+ "visibility|voice-family|volume|white-space|widows|width|word-spacing|" +
182
+ "z-index").split("|")
183
+ );
184
+
185
+ var functions = lang.arrayToMap(
186
+ ("rgb|rgba|url|attr|counter|counters").split("|")
187
+ );
188
+
189
+ var constants = lang.arrayToMap(
190
+ ("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" +
191
+ "block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" +
192
+ "char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" +
193
+ "decimal-leading-zero|decimal|default|disabled|disc|" +
194
+ "distribute-all-lines|distribute-letter|distribute-space|" +
195
+ "distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" +
196
+ "hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" +
197
+ "ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" +
198
+ "ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" +
199
+ "inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" +
200
+ "keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" +
201
+ "lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" +
202
+ "medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" +
203
+ "nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" +
204
+ "overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" +
205
+ "ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" +
206
+ "solid|square|static|strict|super|sw-resize|table-footer-group|" +
207
+ "table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" +
208
+ "transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" +
209
+ "vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" +
210
+ "zero").split("|")
211
+ );
212
+
213
+ var colors = lang.arrayToMap(
214
+ ("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|" +
215
+ "purple|red|silver|teal|white|yellow").split("|")
216
+ );
217
+
218
+ // regexp must not have capturing parentheses. Use (?:) instead.
219
+ // regexps are ordered -> the first match is used
220
+
221
+ var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
222
+
223
+ var base_ruleset = [
224
+ {
225
+ token : "comment", // multi line comment
226
+ merge : true,
227
+ regex : "\\/\\*",
228
+ next : "ruleset_comment"
229
+ },{
230
+ token : "string", // single line
231
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
232
+ }, {
233
+ token : "string", // single line
234
+ regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
235
+ }, {
236
+ token : "constant.numeric",
237
+ regex : numRe + "(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)"
238
+ }, {
239
+ token : "constant.numeric", // hex6 color
240
+ regex : "#[a-f0-9]{6}"
241
+ }, {
242
+ token : "constant.numeric", // hex3 color
243
+ regex : "#[a-f0-9]{3}"
244
+ }, {
245
+ token : function(value) {
246
+ if (properties.hasOwnProperty(value.toLowerCase())) {
247
+ return "support.type";
248
+ }
249
+ else if (functions.hasOwnProperty(value.toLowerCase())) {
250
+ return "support.function";
251
+ }
252
+ else if (constants.hasOwnProperty(value.toLowerCase())) {
253
+ return "support.constant";
254
+ }
255
+ else if (colors.hasOwnProperty(value.toLowerCase())) {
256
+ return "support.constant.color";
257
+ }
258
+ else {
259
+ return "text";
260
+ }
261
+ },
262
+ regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
263
+ }
264
+ ];
265
+
266
+ var ruleset = lang.copyArray(base_ruleset);
267
+ ruleset.unshift({
268
+ token : "paren.rparen",
269
+ regex : "\\}",
270
+ next: "start"
271
+ });
272
+
273
+ var media_ruleset = lang.copyArray( base_ruleset );
274
+ media_ruleset.unshift({
275
+ token : "paren.rparen",
276
+ regex : "\\}",
277
+ next: "media"
278
+ });
279
+
280
+ var base_comment = [{
281
+ token : "comment", // comment spanning whole line
282
+ merge : true,
283
+ regex : ".+"
284
+ }];
285
+
286
+ var comment = lang.copyArray(base_comment);
287
+ comment.unshift({
288
+ token : "comment", // closing comment
289
+ regex : ".*?\\*\\/",
290
+ next : "start"
291
+ });
292
+
293
+ var media_comment = lang.copyArray(base_comment);
294
+ media_comment.unshift({
295
+ token : "comment", // closing comment
296
+ regex : ".*?\\*\\/",
297
+ next : "media"
298
+ });
299
+
300
+ var ruleset_comment = lang.copyArray(base_comment);
301
+ ruleset_comment.unshift({
302
+ token : "comment", // closing comment
303
+ regex : ".*?\\*\\/",
304
+ next : "ruleset"
305
+ });
306
+
307
+ this.$rules = {
308
+ "start" : [{
309
+ token : "comment", // multi line comment
310
+ merge : true,
311
+ regex : "\\/\\*",
312
+ next : "comment"
313
+ }, {
314
+ token: "paren.lparen",
315
+ regex: "\\{",
316
+ next: "ruleset"
317
+ }, {
318
+ token: "string",
319
+ regex: "@.*?{",
320
+ next: "media"
321
+ },{
322
+ token: "keyword",
323
+ regex: "#[a-z0-9-_]+"
324
+ },{
325
+ token: "variable",
326
+ regex: "\\.[a-z0-9-_]+"
327
+ },{
328
+ token: "string",
329
+ regex: ":[a-z0-9-_]+"
330
+ },{
331
+ token: "constant",
332
+ regex: "[a-z0-9-_]+"
333
+ }],
334
+
335
+ "media" : [ {
336
+ token : "comment", // multi line comment
337
+ merge : true,
338
+ regex : "\\/\\*",
339
+ next : "media_comment"
340
+ }, {
341
+ token: "paren.lparen",
342
+ regex: "\\{",
343
+ next: "media_ruleset"
344
+ },{
345
+ token: "string",
346
+ regex: "\\}",
347
+ next: "start"
348
+ },{
349
+ token: "keyword",
350
+ regex: "#[a-z0-9-_]+"
351
+ },{
352
+ token: "variable",
353
+ regex: "\\.[a-z0-9-_]+"
354
+ },{
355
+ token: "string",
356
+ regex: ":[a-z0-9-_]+"
357
+ },{
358
+ token: "constant",
359
+ regex: "[a-z0-9-_]+"
360
+ }],
361
+
362
+ "comment" : comment,
363
+
364
+ "ruleset" : ruleset,
365
+ "ruleset_comment" : ruleset_comment,
366
+
367
+ "media_ruleset" : media_ruleset,
368
+ "media_comment" : media_comment
369
+ };
370
+ };
371
+
372
+ oop.inherits(CssHighlightRules, TextHighlightRules);
373
+
374
+ exports.CssHighlightRules = CssHighlightRules;
375
+
376
+ });
377
+ /* ***** BEGIN LICENSE BLOCK *****
378
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
379
+ *
380
+ * The contents of this file are subject to the Mozilla Public License Version
381
+ * 1.1 (the "License"); you may not use this file except in compliance with
382
+ * the License. You may obtain a copy of the License at
383
+ * http://www.mozilla.org/MPL/
384
+ *
385
+ * Software distributed under the License is distributed on an "AS IS" basis,
386
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
387
+ * for the specific language governing rights and limitations under the
388
+ * License.
389
+ *
390
+ * The Original Code is Ajax.org Code Editor (ACE).
391
+ *
392
+ * The Initial Developer of the Original Code is
393
+ * Ajax.org B.V.
394
+ * Portions created by the Initial Developer are Copyright (C) 2010
395
+ * the Initial Developer. All Rights Reserved.
396
+ *
397
+ * Contributor(s):
398
+ * Fabian Jakobs <fabian AT ajax DOT org>
399
+ *
400
+ * Alternatively, the contents of this file may be used under the terms of
401
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
402
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
403
+ * in which case the provisions of the GPL or the LGPL are applicable instead
404
+ * of those above. If you wish to allow use of your version of this file only
405
+ * under the terms of either the GPL or the LGPL, and not to allow others to
406
+ * use your version of this file under the terms of the MPL, indicate your
407
+ * decision by deleting the provisions above and replace them with the notice
408
+ * and other provisions required by the GPL or the LGPL. If you do not delete
409
+ * the provisions above, a recipient may use your version of this file under
410
+ * the terms of any one of the MPL, the GPL or the LGPL.
411
+ *
412
+ * ***** END LICENSE BLOCK ***** */
413
+
414
+ ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
415
+ "use strict";
416
+
417
+ var Range = require("../range").Range;
418
+
419
+ var MatchingBraceOutdent = function() {};
420
+
421
+ (function() {
422
+
423
+ this.checkOutdent = function(line, input) {
424
+ if (! /^\s+$/.test(line))
425
+ return false;
426
+
427
+ return /^\s*\}/.test(input);
428
+ };
429
+
430
+ this.autoOutdent = function(doc, row) {
431
+ var line = doc.getLine(row);
432
+ var match = line.match(/^(\s*\})/);
433
+
434
+ if (!match) return 0;
435
+
436
+ var column = match[1].length;
437
+ var openBracePos = doc.findMatchingBracket({row: row, column: column});
438
+
439
+ if (!openBracePos || openBracePos.row == row) return 0;
440
+
441
+ var indent = this.$getIndent(doc.getLine(openBracePos.row));
442
+ doc.replace(new Range(row, 0, row, column-1), indent);
443
+ };
444
+
445
+ this.$getIndent = function(line) {
446
+ var match = line.match(/^(\s+)/);
447
+ if (match) {
448
+ return match[1];
449
+ }
450
+
451
+ return "";
452
+ };
453
+
454
+ }).call(MatchingBraceOutdent.prototype);
455
+
456
+ exports.MatchingBraceOutdent = MatchingBraceOutdent;
457
+ });
458
+ /* ***** BEGIN LICENSE BLOCK *****
459
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
460
+ *
461
+ * The contents of this file are subject to the Mozilla Public License Version
462
+ * 1.1 (the "License"); you may not use this file except in compliance with
463
+ * the License. You may obtain a copy of the License at
464
+ * http://www.mozilla.org/MPL/
465
+ *
466
+ * Software distributed under the License is distributed on an "AS IS" basis,
467
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
468
+ * for the specific language governing rights and limitations under the
469
+ * License.
470
+ *
471
+ * The Original Code is Ajax.org Code Editor (ACE).
472
+ *
473
+ * The Initial Developer of the Original Code is
474
+ * Ajax.org B.V.
475
+ * Portions created by the Initial Developer are Copyright (C) 2010
476
+ * the Initial Developer. All Rights Reserved.
477
+ *
478
+ * Contributor(s):
479
+ * Fabian Jakobs <fabian AT ajax DOT org>
480
+ *
481
+ * Alternatively, the contents of this file may be used under the terms of
482
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
483
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
484
+ * in which case the provisions of the GPL or the LGPL are applicable instead
485
+ * of those above. If you wish to allow use of your version of this file only
486
+ * under the terms of either the GPL or the LGPL, and not to allow others to
487
+ * use your version of this file under the terms of the MPL, indicate your
488
+ * decision by deleting the provisions above and replace them with the notice
489
+ * and other provisions required by the GPL or the LGPL. If you do not delete
490
+ * the provisions above, a recipient may use your version of this file under
491
+ * the terms of any one of the MPL, the GPL or the LGPL.
492
+ *
493
+ * ***** END LICENSE BLOCK ***** */
494
+
495
+ ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
496
+ "use strict";
497
+
498
+ var oop = require("../../lib/oop");
499
+ var Range = require("../../range").Range;
500
+ var BaseFoldMode = require("./fold_mode").FoldMode;
501
+
502
+ var FoldMode = exports.FoldMode = function() {};
503
+ oop.inherits(FoldMode, BaseFoldMode);
504
+
505
+ (function() {
506
+
507
+ this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
508
+ this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
509
+
510
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
511
+ var line = session.getLine(row);
512
+ var match = line.match(this.foldingStartMarker);
513
+ if (match) {
514
+ var i = match.index;
515
+
516
+ if (match[1])
517
+ return this.openingBracketBlock(session, match[1], row, i);
518
+
519
+ var range = session.getCommentFoldRange(row, i + match[0].length);
520
+ range.end.column -= 2;
521
+ return range;
522
+ }
523
+
524
+ if (foldStyle !== "markbeginend")
525
+ return;
526
+
527
+ var match = line.match(this.foldingStopMarker);
528
+ if (match) {
529
+ var i = match.index + match[0].length;
530
+
531
+ if (match[2]) {
532
+ var range = session.getCommentFoldRange(row, i);
533
+ range.end.column -= 2;
534
+ return range;
535
+ }
536
+
537
+ var end = {row: row, column: i};
538
+ var start = session.$findOpeningBracket(match[1], end);
539
+
540
+ if (!start)
541
+ return;
542
+
543
+ start.column++;
544
+ end.column--;
545
+
546
+ return Range.fromPoints(start, end);
547
+ }
548
+ };
549
+
550
+ }).call(FoldMode.prototype);
551
+
552
+ });/* ***** BEGIN LICENSE BLOCK *****
553
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
554
+ *
555
+ * The contents of this file are subject to the Mozilla Public License Version
556
+ * 1.1 (the "License"); you may not use this file except in compliance with
557
+ * the License. You may obtain a copy of the License at
558
+ * http://www.mozilla.org/MPL/
559
+ *
560
+ * Software distributed under the License is distributed on an "AS IS" basis,
561
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
562
+ * for the specific language governing rights and limitations under the
563
+ * License.
564
+ *
565
+ * The Original Code is Ajax.org Code Editor (ACE).
566
+ *
567
+ * The Initial Developer of the Original Code is
568
+ * Ajax.org B.V.
569
+ * Portions created by the Initial Developer are Copyright (C) 2010
570
+ * the Initial Developer. All Rights Reserved.
571
+ *
572
+ * Contributor(s):
573
+ * Fabian Jakobs <fabian AT ajax DOT org>
574
+ *
575
+ * Alternatively, the contents of this file may be used under the terms of
576
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
577
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
578
+ * in which case the provisions of the GPL or the LGPL are applicable instead
579
+ * of those above. If you wish to allow use of your version of this file only
580
+ * under the terms of either the GPL or the LGPL, and not to allow others to
581
+ * use your version of this file under the terms of the MPL, indicate your
582
+ * decision by deleting the provisions above and replace them with the notice
583
+ * and other provisions required by the GPL or the LGPL. If you do not delete
584
+ * the provisions above, a recipient may use your version of this file under
585
+ * the terms of any one of the MPL, the GPL or the LGPL.
586
+ *
587
+ * ***** END LICENSE BLOCK ***** */
588
+
589
+ ace.define('ace/mode/folding/fold_mode', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
590
+ "use strict";
591
+
592
+ var Range = require("../../range").Range;
593
+
594
+ var FoldMode = exports.FoldMode = function() {};
595
+
596
+ (function() {
597
+
598
+ this.foldingStartMarker = null;
599
+ this.foldingStopMarker = null;
600
+
601
+ // must return "" if there's no fold, to enable caching
602
+ this.getFoldWidget = function(session, foldStyle, row) {
603
+ var line = session.getLine(row);
604
+ if (this.foldingStartMarker.test(line))
605
+ return "start";
606
+ if (foldStyle == "markbeginend"
607
+ && this.foldingStopMarker
608
+ && this.foldingStopMarker.test(line))
609
+ return "end";
610
+ return "";
611
+ };
612
+
613
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
614
+ return null;
615
+ };
616
+
617
+ this.indentationBlock = function(session, row, column) {
618
+ var re = /^\s*/;
619
+ var startRow = row;
620
+ var endRow = row;
621
+ var line = session.getLine(row);
622
+ var startColumn = column || line.length;
623
+ var startLevel = line.match(re)[0].length;
624
+ var maxRow = session.getLength()
625
+
626
+ while (++row < maxRow) {
627
+ line = session.getLine(row);
628
+ var level = line.match(re)[0].length;
629
+
630
+ if (level == line.length)
631
+ continue;
632
+
633
+ if (level <= startLevel)
634
+ break;
635
+
636
+ endRow = row;
637
+ }
638
+
639
+ if (endRow > startRow) {
640
+ var endColumn = session.getLine(endRow).length;
641
+ return new Range(startRow, startColumn, endRow, endColumn);
642
+ }
643
+ };
644
+
645
+ this.openingBracketBlock = function(session, bracket, row, column) {
646
+ var start = {row: row, column: column + 1};
647
+ var end = session.$findClosingBracket(bracket, start);
648
+ if (!end)
649
+ return;
650
+
651
+ var fw = session.foldWidgets[end.row];
652
+ if (fw == null)
653
+ fw = this.getFoldWidget(session, end.row);
654
+
655
+ if (fw == "start") {
656
+ end.row --;
657
+ end.column = session.getLine(end.row).length;
658
+ }
659
+ return Range.fromPoints(start, end);
660
+ };
661
+
662
+ }).call(FoldMode.prototype);
663
+
664
+ });