aced_rails 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (304) hide show
  1. checksums.yaml +7 -0
  2. data/.travis.yml +3 -0
  3. data/CHANGELOG.md +9 -0
  4. data/README.md +29 -31
  5. data/aced_rails.gemspec +2 -2
  6. data/lib/aced_rails/config.rb +18 -18
  7. data/lib/aced_rails/helpers.rb +2 -3
  8. data/lib/aced_rails/version.rb +1 -1
  9. data/lib/generators/aced_rails/templates/aced_rails.rb +24 -16
  10. data/vendor/assets/javascripts/ace/ace.js +2 -1
  11. data/vendor/assets/javascripts/ace/ext-searchbox.js +1 -0
  12. data/vendor/assets/javascripts/ace/ext-spellcheck.js +1 -0
  13. data/vendor/assets/javascripts/ace/ext-static_highlight.js +1 -0
  14. data/vendor/assets/javascripts/ace/ext-textarea.js +1 -0
  15. data/vendor/assets/javascripts/ace/keybinding-emacs.js +1 -1
  16. data/vendor/assets/javascripts/ace/keybinding-vim.js +1 -1
  17. data/vendor/assets/javascripts/ace/mode-abap.js +1 -0
  18. data/vendor/assets/javascripts/ace/mode-asciidoc.js +1 -0
  19. data/vendor/assets/javascripts/ace/mode-c9search.js +1 -0
  20. data/vendor/assets/javascripts/ace/mode-c_cpp.js +1 -1
  21. data/vendor/assets/javascripts/ace/mode-clojure.js +1 -1
  22. data/vendor/assets/javascripts/ace/mode-coffee.js +1 -1
  23. data/vendor/assets/javascripts/ace/mode-coldfusion.js +1 -1
  24. data/vendor/assets/javascripts/ace/mode-csharp.js +1 -1
  25. data/vendor/assets/javascripts/ace/mode-css.js +1 -1
  26. data/vendor/assets/javascripts/ace/mode-curly.js +1 -0
  27. data/vendor/assets/javascripts/ace/mode-dart.js +1 -0
  28. data/vendor/assets/javascripts/ace/mode-diff.js +1 -0
  29. data/vendor/assets/javascripts/ace/mode-django.js +1 -0
  30. data/vendor/assets/javascripts/ace/mode-dot.js +1 -0
  31. data/vendor/assets/javascripts/ace/mode-glsl.js +1 -0
  32. data/vendor/assets/javascripts/ace/mode-golang.js +1 -0
  33. data/vendor/assets/javascripts/ace/mode-groovy.js +1 -1
  34. data/vendor/assets/javascripts/ace/mode-haml.js +1 -0
  35. data/vendor/assets/javascripts/ace/mode-haxe.js +1 -1
  36. data/vendor/assets/javascripts/ace/mode-html.js +1 -1
  37. data/vendor/assets/javascripts/ace/mode-jade.js +1 -0
  38. data/vendor/assets/javascripts/ace/mode-java.js +1 -1
  39. data/vendor/assets/javascripts/ace/mode-javascript.js +1 -1
  40. data/vendor/assets/javascripts/ace/mode-json.js +1 -1
  41. data/vendor/assets/javascripts/ace/mode-jsp.js +1 -0
  42. data/vendor/assets/javascripts/ace/mode-jsx.js +1 -0
  43. data/vendor/assets/javascripts/ace/mode-latex.js +1 -1
  44. data/vendor/assets/javascripts/ace/mode-less.js +1 -0
  45. data/vendor/assets/javascripts/ace/mode-liquid.js +1 -0
  46. data/vendor/assets/javascripts/ace/mode-lisp.js +1 -0
  47. data/vendor/assets/javascripts/ace/mode-livescript.js +1 -0
  48. data/vendor/assets/javascripts/ace/mode-lua.js +1 -1
  49. data/vendor/assets/javascripts/ace/mode-luapage.js +1 -0
  50. data/vendor/assets/javascripts/ace/mode-lucene.js +1 -0
  51. data/vendor/assets/javascripts/ace/mode-makefile.js +1 -0
  52. data/vendor/assets/javascripts/ace/mode-markdown.js +1 -1
  53. data/vendor/assets/javascripts/ace/mode-objectivec.js +1 -0
  54. data/vendor/assets/javascripts/ace/mode-ocaml.js +1 -1
  55. data/vendor/assets/javascripts/ace/mode-perl.js +1 -1
  56. data/vendor/assets/javascripts/ace/mode-pgsql.js +1 -1
  57. data/vendor/assets/javascripts/ace/mode-php.js +1 -1
  58. data/vendor/assets/javascripts/ace/mode-powershell.js +1 -1
  59. data/vendor/assets/javascripts/ace/mode-python.js +1 -1
  60. data/vendor/assets/javascripts/ace/mode-r.js +1 -0
  61. data/vendor/assets/javascripts/ace/mode-rdoc.js +1 -0
  62. data/vendor/assets/javascripts/ace/mode-rhtml.js +1 -0
  63. data/vendor/assets/javascripts/ace/mode-ruby.js +1 -1
  64. data/vendor/assets/javascripts/ace/mode-scad.js +1 -1
  65. data/vendor/assets/javascripts/ace/mode-scala.js +1 -1
  66. data/vendor/assets/javascripts/ace/mode-scheme.js +1 -0
  67. data/vendor/assets/javascripts/ace/mode-scss.js +1 -1
  68. data/vendor/assets/javascripts/ace/mode-sh.js +1 -1
  69. data/vendor/assets/javascripts/ace/mode-sql.js +1 -1
  70. data/vendor/assets/javascripts/ace/mode-stylus.js +1 -0
  71. data/vendor/assets/javascripts/ace/mode-svg.js +1 -1
  72. data/vendor/assets/javascripts/ace/mode-tcl.js +1 -0
  73. data/vendor/assets/javascripts/ace/mode-tex.js +1 -0
  74. data/vendor/assets/javascripts/ace/mode-textile.js +1 -1
  75. data/vendor/assets/javascripts/ace/mode-tm_snippet.js +1 -0
  76. data/vendor/assets/javascripts/ace/mode-typescript.js +1 -0
  77. data/vendor/assets/javascripts/ace/mode-vbscript.js +1 -0
  78. data/vendor/assets/javascripts/ace/mode-xml.js +1 -1
  79. data/vendor/assets/javascripts/ace/mode-xquery.js +1 -1
  80. data/vendor/assets/javascripts/ace/mode-yaml.js +1 -0
  81. data/vendor/assets/javascripts/ace/theme-ambiance.js +1 -0
  82. data/vendor/assets/javascripts/ace/theme-chaos.js +1 -0
  83. data/vendor/assets/javascripts/ace/theme-chrome.js +1 -1
  84. data/vendor/assets/javascripts/ace/theme-clouds.js +1 -1
  85. data/vendor/assets/javascripts/ace/theme-clouds_midnight.js +1 -1
  86. data/vendor/assets/javascripts/ace/theme-cobalt.js +1 -1
  87. data/vendor/assets/javascripts/ace/theme-crimson_editor.js +1 -1
  88. data/vendor/assets/javascripts/ace/theme-dawn.js +1 -1
  89. data/vendor/assets/javascripts/ace/theme-dreamweaver.js +1 -1
  90. data/vendor/assets/javascripts/ace/theme-eclipse.js +1 -1
  91. data/vendor/assets/javascripts/ace/theme-github.js +1 -0
  92. data/vendor/assets/javascripts/ace/theme-idle_fingers.js +1 -1
  93. data/vendor/assets/javascripts/ace/theme-kr.js +1 -0
  94. data/vendor/assets/javascripts/ace/theme-merbivore.js +1 -1
  95. data/vendor/assets/javascripts/ace/theme-merbivore_soft.js +1 -1
  96. data/vendor/assets/javascripts/ace/theme-mono_industrial.js +1 -1
  97. data/vendor/assets/javascripts/ace/theme-monokai.js +1 -1
  98. data/vendor/assets/javascripts/ace/theme-pastel_on_dark.js +1 -1
  99. data/vendor/assets/javascripts/ace/theme-solarized_dark.js +1 -1
  100. data/vendor/assets/javascripts/ace/theme-solarized_light.js +1 -1
  101. data/vendor/assets/javascripts/ace/theme-textmate.js +1 -0
  102. data/vendor/assets/javascripts/ace/theme-tomorrow.js +1 -1
  103. data/vendor/assets/javascripts/ace/theme-tomorrow_night.js +1 -1
  104. data/vendor/assets/javascripts/ace/theme-tomorrow_night_blue.js +1 -1
  105. data/vendor/assets/javascripts/ace/theme-tomorrow_night_bright.js +1 -1
  106. data/vendor/assets/javascripts/ace/theme-tomorrow_night_eighties.js +1 -1
  107. data/vendor/assets/javascripts/ace/theme-twilight.js +1 -1
  108. data/vendor/assets/javascripts/ace/theme-vibrant_ink.js +1 -1
  109. data/vendor/assets/javascripts/ace/theme-xcode.js +1 -0
  110. data/vendor/assets/javascripts/ace/worker-coffee.js +1 -7456
  111. data/vendor/assets/javascripts/ace/worker-css.js +1 -11693
  112. data/vendor/assets/javascripts/ace/worker-javascript.js +1 -10305
  113. data/vendor/assets/javascripts/ace/worker-json.js +1 -3062
  114. data/vendor/assets/javascripts/ace/worker-php.js +1 -0
  115. data/vendor/assets/javascripts/ace/worker-xquery.js +1 -0
  116. data/vendor/assets/javascripts/aced-rails.js.coffee +58 -0
  117. metadata +60 -205
  118. data/vendor/assets/javascripts/ace/ace-compat-noconflict.js +0 -1
  119. data/vendor/assets/javascripts/ace/ace-compat-uncompressed-noconflict.js +0 -480
  120. data/vendor/assets/javascripts/ace/ace-compat-uncompressed.js +0 -480
  121. data/vendor/assets/javascripts/ace/ace-compat.js +0 -1
  122. data/vendor/assets/javascripts/ace/ace-noconflict.js +0 -10
  123. data/vendor/assets/javascripts/ace/ace-uncompressed-noconflict.js +0 -15241
  124. data/vendor/assets/javascripts/ace/ace-uncompressed.js +0 -15241
  125. data/vendor/assets/javascripts/ace/keybinding-emacs-noconflict.js +0 -1
  126. data/vendor/assets/javascripts/ace/keybinding-emacs-uncompressed-noconflict.js +0 -150
  127. data/vendor/assets/javascripts/ace/keybinding-emacs-uncompressed.js +0 -150
  128. data/vendor/assets/javascripts/ace/keybinding-vim-noconflict.js +0 -1
  129. data/vendor/assets/javascripts/ace/keybinding-vim-uncompressed-noconflict.js +0 -138
  130. data/vendor/assets/javascripts/ace/keybinding-vim-uncompressed.js +0 -138
  131. data/vendor/assets/javascripts/ace/mode-c_cpp-noconflict.js +0 -1
  132. data/vendor/assets/javascripts/ace/mode-c_cpp-uncompressed-noconflict.js +0 -918
  133. data/vendor/assets/javascripts/ace/mode-c_cpp-uncompressed.js +0 -918
  134. data/vendor/assets/javascripts/ace/mode-clojure-noconflict.js +0 -1
  135. data/vendor/assets/javascripts/ace/mode-clojure-uncompressed-noconflict.js +0 -422
  136. data/vendor/assets/javascripts/ace/mode-clojure-uncompressed.js +0 -422
  137. data/vendor/assets/javascripts/ace/mode-coffee-noconflict.js +0 -1
  138. data/vendor/assets/javascripts/ace/mode-coffee-uncompressed-noconflict.js +0 -605
  139. data/vendor/assets/javascripts/ace/mode-coffee-uncompressed.js +0 -605
  140. data/vendor/assets/javascripts/ace/mode-coldfusion-noconflict.js +0 -1
  141. data/vendor/assets/javascripts/ace/mode-coldfusion-uncompressed-noconflict.js +0 -2391
  142. data/vendor/assets/javascripts/ace/mode-coldfusion-uncompressed.js +0 -2391
  143. data/vendor/assets/javascripts/ace/mode-csharp-noconflict.js +0 -1
  144. data/vendor/assets/javascripts/ace/mode-csharp-uncompressed-noconflict.js +0 -768
  145. data/vendor/assets/javascripts/ace/mode-csharp-uncompressed.js +0 -768
  146. data/vendor/assets/javascripts/ace/mode-css-noconflict.js +0 -1
  147. data/vendor/assets/javascripts/ace/mode-css-uncompressed-noconflict.js +0 -676
  148. data/vendor/assets/javascripts/ace/mode-css-uncompressed.js +0 -676
  149. data/vendor/assets/javascripts/ace/mode-groovy-noconflict.js +0 -1
  150. data/vendor/assets/javascripts/ace/mode-groovy-uncompressed-noconflict.js +0 -1298
  151. data/vendor/assets/javascripts/ace/mode-groovy-uncompressed.js +0 -1298
  152. data/vendor/assets/javascripts/ace/mode-haxe-noconflict.js +0 -1
  153. data/vendor/assets/javascripts/ace/mode-haxe-uncompressed-noconflict.js +0 -768
  154. data/vendor/assets/javascripts/ace/mode-haxe-uncompressed.js +0 -768
  155. data/vendor/assets/javascripts/ace/mode-html-noconflict.js +0 -1
  156. data/vendor/assets/javascripts/ace/mode-html-uncompressed-noconflict.js +0 -2407
  157. data/vendor/assets/javascripts/ace/mode-html-uncompressed.js +0 -2407
  158. data/vendor/assets/javascripts/ace/mode-java-noconflict.js +0 -1
  159. data/vendor/assets/javascripts/ace/mode-java-uncompressed-noconflict.js +0 -1300
  160. data/vendor/assets/javascripts/ace/mode-java-uncompressed.js +0 -1300
  161. data/vendor/assets/javascripts/ace/mode-javascript-noconflict.js +0 -1
  162. data/vendor/assets/javascripts/ace/mode-javascript-uncompressed-noconflict.js +0 -1131
  163. data/vendor/assets/javascripts/ace/mode-javascript-uncompressed.js +0 -1131
  164. data/vendor/assets/javascripts/ace/mode-json-noconflict.js +0 -1
  165. data/vendor/assets/javascripts/ace/mode-json-uncompressed-noconflict.js +0 -696
  166. data/vendor/assets/javascripts/ace/mode-json-uncompressed.js +0 -696
  167. data/vendor/assets/javascripts/ace/mode-latex-noconflict.js +0 -1
  168. data/vendor/assets/javascripts/ace/mode-latex-uncompressed-noconflict.js +0 -95
  169. data/vendor/assets/javascripts/ace/mode-latex-uncompressed.js +0 -95
  170. data/vendor/assets/javascripts/ace/mode-lua-noconflict.js +0 -1
  171. data/vendor/assets/javascripts/ace/mode-lua-uncompressed-noconflict.js +0 -523
  172. data/vendor/assets/javascripts/ace/mode-lua-uncompressed.js +0 -523
  173. data/vendor/assets/javascripts/ace/mode-markdown-noconflict.js +0 -1
  174. data/vendor/assets/javascripts/ace/mode-markdown-uncompressed-noconflict.js +0 -2849
  175. data/vendor/assets/javascripts/ace/mode-markdown-uncompressed.js +0 -2849
  176. data/vendor/assets/javascripts/ace/mode-ocaml-noconflict.js +0 -1
  177. data/vendor/assets/javascripts/ace/mode-ocaml-uncompressed-noconflict.js +0 -539
  178. data/vendor/assets/javascripts/ace/mode-ocaml-uncompressed.js +0 -539
  179. data/vendor/assets/javascripts/ace/mode-perl-noconflict.js +0 -1
  180. data/vendor/assets/javascripts/ace/mode-perl-uncompressed-noconflict.js +0 -573
  181. data/vendor/assets/javascripts/ace/mode-perl-uncompressed.js +0 -573
  182. data/vendor/assets/javascripts/ace/mode-pgsql-noconflict.js +0 -1
  183. data/vendor/assets/javascripts/ace/mode-pgsql-uncompressed-noconflict.js +0 -1107
  184. data/vendor/assets/javascripts/ace/mode-pgsql-uncompressed.js +0 -1107
  185. data/vendor/assets/javascripts/ace/mode-php-noconflict.js +0 -1
  186. data/vendor/assets/javascripts/ace/mode-php-uncompressed-noconflict.js +0 -1884
  187. data/vendor/assets/javascripts/ace/mode-php-uncompressed.js +0 -1884
  188. data/vendor/assets/javascripts/ace/mode-powershell-noconflict.js +0 -1
  189. data/vendor/assets/javascripts/ace/mode-powershell-uncompressed-noconflict.js +0 -706
  190. data/vendor/assets/javascripts/ace/mode-powershell-uncompressed.js +0 -706
  191. data/vendor/assets/javascripts/ace/mode-python-noconflict.js +0 -1
  192. data/vendor/assets/javascripts/ace/mode-python-uncompressed-noconflict.js +0 -506
  193. data/vendor/assets/javascripts/ace/mode-python-uncompressed.js +0 -506
  194. data/vendor/assets/javascripts/ace/mode-ruby-noconflict.js +0 -1
  195. data/vendor/assets/javascripts/ace/mode-ruby-uncompressed-noconflict.js +0 -391
  196. data/vendor/assets/javascripts/ace/mode-ruby-uncompressed.js +0 -391
  197. data/vendor/assets/javascripts/ace/mode-scad-noconflict.js +0 -1
  198. data/vendor/assets/javascripts/ace/mode-scad-uncompressed-noconflict.js +0 -906
  199. data/vendor/assets/javascripts/ace/mode-scad-uncompressed.js +0 -906
  200. data/vendor/assets/javascripts/ace/mode-scala-noconflict.js +0 -1
  201. data/vendor/assets/javascripts/ace/mode-scala-uncompressed-noconflict.js +0 -1300
  202. data/vendor/assets/javascripts/ace/mode-scala-uncompressed.js +0 -1300
  203. data/vendor/assets/javascripts/ace/mode-scss-noconflict.js +0 -1
  204. data/vendor/assets/javascripts/ace/mode-scss-uncompressed-noconflict.js +0 -678
  205. data/vendor/assets/javascripts/ace/mode-scss-uncompressed.js +0 -678
  206. data/vendor/assets/javascripts/ace/mode-sh-noconflict.js +0 -1
  207. data/vendor/assets/javascripts/ace/mode-sh-uncompressed-noconflict.js +0 -281
  208. data/vendor/assets/javascripts/ace/mode-sh-uncompressed.js +0 -281
  209. data/vendor/assets/javascripts/ace/mode-sql-noconflict.js +0 -1
  210. data/vendor/assets/javascripts/ace/mode-sql-uncompressed-noconflict.js +0 -159
  211. data/vendor/assets/javascripts/ace/mode-sql-uncompressed.js +0 -159
  212. data/vendor/assets/javascripts/ace/mode-svg-noconflict.js +0 -1
  213. data/vendor/assets/javascripts/ace/mode-svg-uncompressed-noconflict.js +0 -2034
  214. data/vendor/assets/javascripts/ace/mode-svg-uncompressed.js +0 -2034
  215. data/vendor/assets/javascripts/ace/mode-text-noconflict.js +0 -0
  216. data/vendor/assets/javascripts/ace/mode-text-uncompressed-noconflict.js +0 -0
  217. data/vendor/assets/javascripts/ace/mode-text-uncompressed.js +0 -0
  218. data/vendor/assets/javascripts/ace/mode-textile-noconflict.js +0 -1
  219. data/vendor/assets/javascripts/ace/mode-textile-uncompressed-noconflict.js +0 -254
  220. data/vendor/assets/javascripts/ace/mode-textile-uncompressed.js +0 -254
  221. data/vendor/assets/javascripts/ace/mode-xml-noconflict.js +0 -1
  222. data/vendor/assets/javascripts/ace/mode-xml-uncompressed-noconflict.js +0 -1001
  223. data/vendor/assets/javascripts/ace/mode-xml-uncompressed.js +0 -1001
  224. data/vendor/assets/javascripts/ace/mode-xquery-noconflict.js +0 -1
  225. data/vendor/assets/javascripts/ace/mode-xquery-uncompressed-noconflict.js +0 -538
  226. data/vendor/assets/javascripts/ace/mode-xquery-uncompressed.js +0 -538
  227. data/vendor/assets/javascripts/ace/theme-chrome-noconflict.js +0 -1
  228. data/vendor/assets/javascripts/ace/theme-chrome-uncompressed-noconflict.js +0 -212
  229. data/vendor/assets/javascripts/ace/theme-chrome-uncompressed.js +0 -212
  230. data/vendor/assets/javascripts/ace/theme-clouds-noconflict.js +0 -1
  231. data/vendor/assets/javascripts/ace/theme-clouds-uncompressed-noconflict.js +0 -155
  232. data/vendor/assets/javascripts/ace/theme-clouds-uncompressed.js +0 -155
  233. data/vendor/assets/javascripts/ace/theme-clouds_midnight-noconflict.js +0 -1
  234. data/vendor/assets/javascripts/ace/theme-clouds_midnight-uncompressed-noconflict.js +0 -156
  235. data/vendor/assets/javascripts/ace/theme-clouds_midnight-uncompressed.js +0 -156
  236. data/vendor/assets/javascripts/ace/theme-cobalt-noconflict.js +0 -1
  237. data/vendor/assets/javascripts/ace/theme-cobalt-uncompressed-noconflict.js +0 -174
  238. data/vendor/assets/javascripts/ace/theme-cobalt-uncompressed.js +0 -174
  239. data/vendor/assets/javascripts/ace/theme-crimson_editor-noconflict.js +0 -1
  240. data/vendor/assets/javascripts/ace/theme-crimson_editor-uncompressed-noconflict.js +0 -198
  241. data/vendor/assets/javascripts/ace/theme-crimson_editor-uncompressed.js +0 -198
  242. data/vendor/assets/javascripts/ace/theme-dawn-noconflict.js +0 -1
  243. data/vendor/assets/javascripts/ace/theme-dawn-uncompressed-noconflict.js +0 -178
  244. data/vendor/assets/javascripts/ace/theme-dawn-uncompressed.js +0 -178
  245. data/vendor/assets/javascripts/ace/theme-dreamweaver-noconflict.js +0 -1
  246. data/vendor/assets/javascripts/ace/theme-dreamweaver-uncompressed-noconflict.js +0 -227
  247. data/vendor/assets/javascripts/ace/theme-dreamweaver-uncompressed.js +0 -227
  248. data/vendor/assets/javascripts/ace/theme-eclipse-noconflict.js +0 -1
  249. data/vendor/assets/javascripts/ace/theme-eclipse-uncompressed-noconflict.js +0 -147
  250. data/vendor/assets/javascripts/ace/theme-eclipse-uncompressed.js +0 -147
  251. data/vendor/assets/javascripts/ace/theme-idle_fingers-noconflict.js +0 -1
  252. data/vendor/assets/javascripts/ace/theme-idle_fingers-uncompressed-noconflict.js +0 -166
  253. data/vendor/assets/javascripts/ace/theme-idle_fingers-uncompressed.js +0 -166
  254. data/vendor/assets/javascripts/ace/theme-kr_theme-noconflict.js +0 -1
  255. data/vendor/assets/javascripts/ace/theme-kr_theme-uncompressed-noconflict.js +0 -169
  256. data/vendor/assets/javascripts/ace/theme-kr_theme-uncompressed.js +0 -169
  257. data/vendor/assets/javascripts/ace/theme-kr_theme.js +0 -1
  258. data/vendor/assets/javascripts/ace/theme-merbivore-noconflict.js +0 -1
  259. data/vendor/assets/javascripts/ace/theme-merbivore-uncompressed-noconflict.js +0 -169
  260. data/vendor/assets/javascripts/ace/theme-merbivore-uncompressed.js +0 -169
  261. data/vendor/assets/javascripts/ace/theme-merbivore_soft-noconflict.js +0 -1
  262. data/vendor/assets/javascripts/ace/theme-merbivore_soft-uncompressed-noconflict.js +0 -175
  263. data/vendor/assets/javascripts/ace/theme-merbivore_soft-uncompressed.js +0 -175
  264. data/vendor/assets/javascripts/ace/theme-mono_industrial-noconflict.js +0 -1
  265. data/vendor/assets/javascripts/ace/theme-mono_industrial-uncompressed-noconflict.js +0 -177
  266. data/vendor/assets/javascripts/ace/theme-mono_industrial-uncompressed.js +0 -177
  267. data/vendor/assets/javascripts/ace/theme-monokai-noconflict.js +0 -1
  268. data/vendor/assets/javascripts/ace/theme-monokai-uncompressed-noconflict.js +0 -183
  269. data/vendor/assets/javascripts/ace/theme-monokai-uncompressed.js +0 -183
  270. data/vendor/assets/javascripts/ace/theme-pastel_on_dark-noconflict.js +0 -1
  271. data/vendor/assets/javascripts/ace/theme-pastel_on_dark-uncompressed-noconflict.js +0 -179
  272. data/vendor/assets/javascripts/ace/theme-pastel_on_dark-uncompressed.js +0 -179
  273. data/vendor/assets/javascripts/ace/theme-solarized_dark-noconflict.js +0 -1
  274. data/vendor/assets/javascripts/ace/theme-solarized_dark-uncompressed-noconflict.js +0 -168
  275. data/vendor/assets/javascripts/ace/theme-solarized_dark-uncompressed.js +0 -168
  276. data/vendor/assets/javascripts/ace/theme-solarized_light-noconflict.js +0 -1
  277. data/vendor/assets/javascripts/ace/theme-solarized_light-uncompressed-noconflict.js +0 -167
  278. data/vendor/assets/javascripts/ace/theme-solarized_light-uncompressed.js +0 -167
  279. data/vendor/assets/javascripts/ace/theme-textmate-noconflict.js +0 -0
  280. data/vendor/assets/javascripts/ace/theme-textmate-uncompressed-noconflict.js +0 -0
  281. data/vendor/assets/javascripts/ace/theme-textmate-uncompressed.js +0 -0
  282. data/vendor/assets/javascripts/ace/theme-tomorrow-noconflict.js +0 -1
  283. data/vendor/assets/javascripts/ace/theme-tomorrow-uncompressed-noconflict.js +0 -201
  284. data/vendor/assets/javascripts/ace/theme-tomorrow-uncompressed.js +0 -201
  285. data/vendor/assets/javascripts/ace/theme-tomorrow_night-noconflict.js +0 -1
  286. data/vendor/assets/javascripts/ace/theme-tomorrow_night-uncompressed-noconflict.js +0 -201
  287. data/vendor/assets/javascripts/ace/theme-tomorrow_night-uncompressed.js +0 -201
  288. data/vendor/assets/javascripts/ace/theme-tomorrow_night_blue-noconflict.js +0 -1
  289. data/vendor/assets/javascripts/ace/theme-tomorrow_night_blue-uncompressed-noconflict.js +0 -201
  290. data/vendor/assets/javascripts/ace/theme-tomorrow_night_blue-uncompressed.js +0 -201
  291. data/vendor/assets/javascripts/ace/theme-tomorrow_night_bright-noconflict.js +0 -1
  292. data/vendor/assets/javascripts/ace/theme-tomorrow_night_bright-uncompressed-noconflict.js +0 -201
  293. data/vendor/assets/javascripts/ace/theme-tomorrow_night_bright-uncompressed.js +0 -201
  294. data/vendor/assets/javascripts/ace/theme-tomorrow_night_eighties-noconflict.js +0 -1
  295. data/vendor/assets/javascripts/ace/theme-tomorrow_night_eighties-uncompressed-noconflict.js +0 -197
  296. data/vendor/assets/javascripts/ace/theme-tomorrow_night_eighties-uncompressed.js +0 -197
  297. data/vendor/assets/javascripts/ace/theme-twilight-noconflict.js +0 -1
  298. data/vendor/assets/javascripts/ace/theme-twilight-uncompressed-noconflict.js +0 -191
  299. data/vendor/assets/javascripts/ace/theme-twilight-uncompressed.js +0 -191
  300. data/vendor/assets/javascripts/ace/theme-vibrant_ink-noconflict.js +0 -1
  301. data/vendor/assets/javascripts/ace/theme-vibrant_ink-uncompressed-noconflict.js +0 -170
  302. data/vendor/assets/javascripts/ace/theme-vibrant_ink-uncompressed.js +0 -170
  303. data/vendor/assets/javascripts/aced-api.js.coffee +0 -116
  304. data/vendor/assets/javascripts/jquery.random.js +0 -31
@@ -1,1131 +0,0 @@
1
- /* ***** BEGIN LICENSE BLOCK *****
2
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
3
- *
4
- * The contents of this file are subject to the Mozilla Public License Version
5
- * 1.1 (the "License"); you may not use this file except in compliance with
6
- * the License. You may obtain a copy of the License at
7
- * http://www.mozilla.org/MPL/
8
- *
9
- * Software distributed under the License is distributed on an "AS IS" basis,
10
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11
- * for the specific language governing rights and limitations under the
12
- * License.
13
- *
14
- * The Original Code is Ajax.org Code Editor (ACE).
15
- *
16
- * The Initial Developer of the Original Code is
17
- * Ajax.org B.V.
18
- * Portions created by the Initial Developer are Copyright (C) 2010
19
- * the Initial Developer. All Rights Reserved.
20
- *
21
- * Contributor(s):
22
- * Fabian Jakobs <fabian AT ajax DOT org>
23
- *
24
- * Alternatively, the contents of this file may be used under the terms of
25
- * either the GNU General Public License Version 2 or later (the "GPL"), or
26
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27
- * in which case the provisions of the GPL or the LGPL are applicable instead
28
- * of those above. If you wish to allow use of your version of this file only
29
- * under the terms of either the GPL or the LGPL, and not to allow others to
30
- * use your version of this file under the terms of the MPL, indicate your
31
- * decision by deleting the provisions above and replace them with the notice
32
- * and other provisions required by the GPL or the LGPL. If you do not delete
33
- * the provisions above, a recipient may use your version of this file under
34
- * the terms of any one of the MPL, the GPL or the LGPL.
35
- *
36
- * ***** END LICENSE BLOCK ***** */
37
-
38
- define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) {
39
- "use strict";
40
-
41
- var oop = require("../lib/oop");
42
- var TextMode = require("./text").Mode;
43
- var Tokenizer = require("../tokenizer").Tokenizer;
44
- var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
45
- var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
46
- var Range = require("../range").Range;
47
- var WorkerClient = require("../worker/worker_client").WorkerClient;
48
- var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
49
- var CStyleFoldMode = require("./folding/cstyle").FoldMode;
50
-
51
- var Mode = function() {
52
- this.$tokenizer = new Tokenizer(new JavaScriptHighlightRules().getRules());
53
- this.$outdent = new MatchingBraceOutdent();
54
- this.$behaviour = new CstyleBehaviour();
55
- this.foldingRules = new CStyleFoldMode();
56
- };
57
- oop.inherits(Mode, TextMode);
58
-
59
- (function() {
60
-
61
-
62
- this.toggleCommentLines = function(state, doc, startRow, endRow) {
63
- var outdent = true;
64
- var re = /^(\s*)\/\//;
65
-
66
- for (var i=startRow; i<= endRow; i++) {
67
- if (!re.test(doc.getLine(i))) {
68
- outdent = false;
69
- break;
70
- }
71
- }
72
-
73
- if (outdent) {
74
- var deleteRange = new Range(0, 0, 0, 0);
75
- for (var i=startRow; i<= endRow; i++)
76
- {
77
- var line = doc.getLine(i);
78
- var m = line.match(re);
79
- deleteRange.start.row = i;
80
- deleteRange.end.row = i;
81
- deleteRange.end.column = m[0].length;
82
- doc.replace(deleteRange, m[1]);
83
- }
84
- }
85
- else {
86
- doc.indentRows(startRow, endRow, "//");
87
- }
88
- };
89
-
90
- this.getNextLineIndent = function(state, line, tab) {
91
- var indent = this.$getIndent(line);
92
-
93
- var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
94
- var tokens = tokenizedLine.tokens;
95
- var endState = tokenizedLine.state;
96
-
97
- if (tokens.length && tokens[tokens.length-1].type == "comment") {
98
- return indent;
99
- }
100
-
101
- if (state == "start" || state == "regex_allowed") {
102
- var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
103
- if (match) {
104
- indent += tab;
105
- }
106
- } else if (state == "doc-start") {
107
- if (endState == "start" || state == "regex_allowed") {
108
- return "";
109
- }
110
- var match = line.match(/^\s*(\/?)\*/);
111
- if (match) {
112
- if (match[1]) {
113
- indent += " ";
114
- }
115
- indent += "* ";
116
- }
117
- }
118
-
119
- return indent;
120
- };
121
-
122
- this.checkOutdent = function(state, line, input) {
123
- return this.$outdent.checkOutdent(line, input);
124
- };
125
-
126
- this.autoOutdent = function(state, doc, row) {
127
- this.$outdent.autoOutdent(doc, row);
128
- };
129
-
130
- this.createWorker = function(session) {
131
- var worker = new WorkerClient(["ace"], "worker-javascript.js", "ace/mode/javascript_worker", "JavaScriptWorker");
132
- worker.attachToDocument(session.getDocument());
133
-
134
- worker.on("jslint", function(results) {
135
- var errors = [];
136
- for (var i=0; i<results.data.length; i++) {
137
- var error = results.data[i];
138
- if (error)
139
- errors.push({
140
- row: error.line-1,
141
- column: error.character-1,
142
- text: error.reason,
143
- type: "warning",
144
- lint: error
145
- });
146
- }
147
- session.setAnnotations(errors);
148
- });
149
-
150
- worker.on("narcissus", function(e) {
151
- session.setAnnotations([e.data]);
152
- });
153
-
154
- worker.on("terminate", function() {
155
- session.clearAnnotations();
156
- });
157
-
158
- return worker;
159
- };
160
-
161
- }).call(Mode.prototype);
162
-
163
- exports.Mode = Mode;
164
- });
165
- /* ***** BEGIN LICENSE BLOCK *****
166
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
167
- *
168
- * The contents of this file are subject to the Mozilla Public License Version
169
- * 1.1 (the "License"); you may not use this file except in compliance with
170
- * the License. You may obtain a copy of the License at
171
- * http://www.mozilla.org/MPL/
172
- *
173
- * Software distributed under the License is distributed on an "AS IS" basis,
174
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
175
- * for the specific language governing rights and limitations under the
176
- * License.
177
- *
178
- * The Original Code is Ajax.org Code Editor (ACE).
179
- *
180
- * The Initial Developer of the Original Code is
181
- * Ajax.org B.V.
182
- * Portions created by the Initial Developer are Copyright (C) 2010
183
- * the Initial Developer. All Rights Reserved.
184
- *
185
- * Contributor(s):
186
- * Fabian Jakobs <fabian AT ajax DOT org>
187
- * Mihai Sucan <mihai DOT sucan AT gmail DOT com>
188
- *
189
- * Alternatively, the contents of this file may be used under the terms of
190
- * either the GNU General Public License Version 2 or later (the "GPL"), or
191
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
192
- * in which case the provisions of the GPL or the LGPL are applicable instead
193
- * of those above. If you wish to allow use of your version of this file only
194
- * under the terms of either the GPL or the LGPL, and not to allow others to
195
- * use your version of this file under the terms of the MPL, indicate your
196
- * decision by deleting the provisions above and replace them with the notice
197
- * and other provisions required by the GPL or the LGPL. If you do not delete
198
- * the provisions above, a recipient may use your version of this file under
199
- * the terms of any one of the MPL, the GPL or the LGPL.
200
- *
201
- * ***** END LICENSE BLOCK ***** */
202
-
203
- define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/unicode', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
204
- "use strict";
205
-
206
- var oop = require("../lib/oop");
207
- var lang = require("../lib/lang");
208
- var unicode = require("../unicode");
209
- var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
210
- var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
211
-
212
- var JavaScriptHighlightRules = function() {
213
-
214
- // see: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects
215
- var globals = lang.arrayToMap(
216
- // Constructors
217
- ("Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" +
218
- // E4X
219
- "Namespace|QName|XML|XMLList|" +
220
- "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
221
- "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
222
- // Errors
223
- "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" +
224
- "SyntaxError|TypeError|URIError|" +
225
- // Non-constructor functions
226
- "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" +
227
- "isNaN|parseFloat|parseInt|" +
228
- // Other
229
- "JSON|Math|" +
230
- // Pseudo
231
- "this|arguments|prototype|window|document"
232
- ).split("|")
233
- );
234
-
235
- var keywords = lang.arrayToMap(
236
- ("break|case|catch|continue|default|delete|do|else|finally|for|function|" +
237
- "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|" +
238
- "const|yield|import|get|set").split("|")
239
- );
240
-
241
- // keywords which can be followed by regular expressions
242
- var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield";
243
-
244
- var deprecated = lang.arrayToMap(
245
- ("__parent__|__count__|escape|unescape|with|__proto__").split("|")
246
- );
247
-
248
- var definitions = lang.arrayToMap(("const|let|var|function").split("|"));
249
-
250
- var buildinConstants = lang.arrayToMap(
251
- ("null|Infinity|NaN|undefined").split("|")
252
- );
253
-
254
- var futureReserved = lang.arrayToMap(
255
- ("class|enum|extends|super|export|implements|private|" +
256
- "public|interface|package|protected|static").split("|")
257
- );
258
-
259
- // TODO: Unicode escape sequences
260
- var identifierRe = "[" + unicode.packages.L + "\\$_]["
261
- + unicode.packages.L
262
- + unicode.packages.Mn + unicode.packages.Mc
263
- + unicode.packages.Nd
264
- + unicode.packages.Pc + "\\$_]*\\b";
265
-
266
- var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
267
- "u[0-9a-fA-F]{4}|" + // unicode
268
- "[0-2][0-7]{0,2}|" + // oct
269
- "3[0-6][0-7]?|" + // oct
270
- "37[0-7]?|" + // oct
271
- "[4-7][0-7]?|" + //oct
272
- ".)";
273
-
274
- // regexp must not have capturing parentheses. Use (?:) instead.
275
- // regexps are ordered -> the first match is used
276
-
277
- this.$rules = {
278
- "start" : [
279
- {
280
- token : "comment",
281
- regex : "\\/\\/.*$"
282
- },
283
- new DocCommentHighlightRules().getStartRule("doc-start"),
284
- {
285
- token : "comment", // multi line comment
286
- merge : true,
287
- regex : "\\/\\*",
288
- next : "comment"
289
- }, {
290
- token : "string",
291
- regex : "'",
292
- next : "qstring"
293
- }, {
294
- token : "string",
295
- regex : '"',
296
- next : "qqstring"
297
- }, {
298
- token : "constant.numeric", // hex
299
- regex : "0[xX][0-9a-fA-F]+\\b"
300
- }, {
301
- token : "constant.numeric", // float
302
- regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
303
- }, { // match stuff like: Sound.prototype.play = function() { }
304
- token : ["storage.type", "punctuation.operator", "support.function", "punctuation.operator", "entity.name.function", "text", "keyword.operator", "text", "storage.type", "text", "paren.lparen", "variable.parameter", "paren.rparen"],
305
- regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)?(\\s*)(\\()(.*?)(\\))"
306
- }, { // match stuff like: Sound.prototype.play = myfunc
307
- token : ["storage.type", "punctuation.operator", "support.function", "punctuation.operator", "entity.name.function", "text", "keyword.operator", "text"],
308
- regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
309
- }, { // match stuff like: Sound.play = function() { }
310
- token : ["storage.type", "punctuation.operator", "entity.name.function", "text", "keyword.operator", "text", "storage.type", "text", "paren.lparen", "variable.parameter", "paren.rparen"],
311
- regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)?(\\s*)(\\()(.*?)(\\))"
312
- }, { // match stuff like: play = function() { }
313
- token : ["entity.name.function", "text", "keyword.operator", "text", "storage.type", "text", "paren.lparen", "variable.parameter", "paren.rparen"],
314
- regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)?(\\s*)(\\()(.*?)(\\))"
315
- }, { // match regular function like: function myFunc(arg) { }
316
- token : ["storage.type", "text", "entity.name.function", "text", "paren.lparen", "variable.parameter", "paren.rparen"],
317
- regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
318
- }, { // match stuff like: foobar: function() { }
319
- token : ["entity.name.function", "text", "punctuation.operator", "text", "storage.type", "text", "paren.lparen", "variable.parameter", "paren.rparen"],
320
- regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)?(\\s*)(\\()(.*?)(\\))"
321
- }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
322
- token : ["text", "text", "storage.type", "text", "paren.lparen", "variable.parameter", "paren.rparen"],
323
- regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
324
- }, {
325
- token : "constant.language.boolean",
326
- regex : "(?:true|false)\\b"
327
- }, {
328
- token : "keyword",
329
- regex : "(?:" + kwBeforeRe + ")\\b",
330
- next : "regex_allowed"
331
- }, {
332
- token : "support.function",
333
- regex : "\\b(?:s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\\b(?=\\()"
334
- }, {
335
- token : "support.function.dom",
336
- regex : "\\b(?:s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\\b(?=\\()"
337
- }, {
338
- token : "support.function.constant",
339
- regex : "\\b(?:s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\\b"
340
- }, {
341
- token : ["punctuation.operator", "support.function.firebug"],
342
- regex : "(\\.)(warn|info|log|error|time|timeEnd|assert)\\b"
343
-
344
- }, {
345
- token : function(value) {
346
- if (globals.hasOwnProperty(value))
347
- return "variable.language";
348
- else if (deprecated.hasOwnProperty(value))
349
- return "invalid.deprecated";
350
- else if (definitions.hasOwnProperty(value))
351
- return "storage.type";
352
- else if (keywords.hasOwnProperty(value))
353
- return "keyword";
354
- else if (buildinConstants.hasOwnProperty(value))
355
- return "constant.language";
356
- else if (futureReserved.hasOwnProperty(value))
357
- return "invalid.illegal";
358
- else if (value == "debugger")
359
- return "invalid.deprecated";
360
- else
361
- return "identifier";
362
- },
363
- regex : identifierRe
364
- }, {
365
- token : "keyword.operator",
366
- regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)",
367
- next : "regex_allowed"
368
- }, {
369
- token : "punctuation.operator",
370
- regex : "\\?|\\:|\\,|\\;|\\.",
371
- next : "regex_allowed"
372
- }, {
373
- token : "paren.lparen",
374
- regex : "[[({]",
375
- next : "regex_allowed"
376
- }, {
377
- token : "paren.rparen",
378
- regex : "[\\])}]"
379
- }, {
380
- token : "keyword.operator",
381
- regex : "\\/=?",
382
- next : "regex_allowed"
383
- }, {
384
- token: "comment",
385
- regex: "^#!.*$"
386
- }, {
387
- token : "text",
388
- regex : "\\s+"
389
- }
390
- ],
391
- // regular expressions are only allowed after certain tokens. This
392
- // makes sure we don't mix up regexps with the divison operator
393
- "regex_allowed": [
394
- {
395
- token : "comment", // multi line comment
396
- merge : true,
397
- regex : "\\/\\*",
398
- next : "comment_regex_allowed"
399
- }, {
400
- token : "comment",
401
- regex : "\\/\\/.*$"
402
- }, {
403
- token: "string.regexp",
404
- regex: "\\/",
405
- next: "regex",
406
- merge: true
407
- }, {
408
- token : "text",
409
- regex : "\\s+"
410
- }, {
411
- // immediately return to the start mode without matching
412
- // anything
413
- token: "empty",
414
- regex: "",
415
- next: "start"
416
- }
417
- ],
418
- "regex": [
419
- {
420
- token: "regexp.keyword.operator",
421
- regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
422
- next: "regex"
423
- }, {
424
- // flag
425
- token: "string.regexp",
426
- regex: "/\\w*",
427
- next: "start",
428
- merge: true
429
- }, {
430
- token: "string.regexp",
431
- regex: "[^\\\\/\\[]+",
432
- next: "regex",
433
- merge: true
434
- }, {
435
- token: "string.regexp.charachterclass",
436
- regex: "\\[",
437
- next: "regex_character_class",
438
- merge: true
439
- }, {
440
- token: "empty",
441
- regex: "",
442
- next: "start"
443
- }
444
- ],
445
- "regex_character_class": [
446
- {
447
- token: "regexp.keyword.operator",
448
- regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
449
- next: "regex_character_class"
450
- }, {
451
- token: "string.regexp.charachterclass",
452
- regex: "]",
453
- next: "regex",
454
- merge: true
455
- }, {
456
- token: "string.regexp.charachterclass",
457
- regex: "[^\\\\\\]]+",
458
- next: "regex_character_class",
459
- merge: true
460
- }, {
461
- token: "empty",
462
- regex: "",
463
- next: "start"
464
- }
465
- ],
466
- "comment_regex_allowed" : [
467
- {
468
- token : "comment", // closing comment
469
- regex : ".*?\\*\\/",
470
- merge : true,
471
- next : "regex_allowed"
472
- }, {
473
- token : "comment", // comment spanning whole line
474
- merge : true,
475
- regex : ".+"
476
- }
477
- ],
478
- "comment" : [
479
- {
480
- token : "comment", // closing comment
481
- regex : ".*?\\*\\/",
482
- merge : true,
483
- next : "start"
484
- }, {
485
- token : "comment", // comment spanning whole line
486
- merge : true,
487
- regex : ".+"
488
- }
489
- ],
490
- "qqstring" : [
491
- {
492
- token : "constant.language.escape",
493
- regex : escapedRe
494
- }, {
495
- token : "string",
496
- regex : '[^"\\\\]+'
497
- }, {
498
- token : "string",
499
- regex : '"',
500
- next : "start"
501
- }
502
- ],
503
- "qstring" : [
504
- {
505
- token : "constant.language.escape",
506
- regex : escapedRe
507
- }, {
508
- token : "string",
509
- regex : "[^'\\\\]+"
510
- }, {
511
- token : "string",
512
- regex : "'",
513
- next : "start"
514
- }
515
- ]
516
- };
517
-
518
- this.embedRules(DocCommentHighlightRules, "doc-",
519
- [ new DocCommentHighlightRules().getEndRule("start") ]);
520
- };
521
-
522
- oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
523
-
524
- exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
525
- });
526
- /* ***** BEGIN LICENSE BLOCK *****
527
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
528
- *
529
- * The contents of this file are subject to the Mozilla Public License Version
530
- * 1.1 (the "License"); you may not use this file except in compliance with
531
- * the License. You may obtain a copy of the License at
532
- * http://www.mozilla.org/MPL/
533
- *
534
- * Software distributed under the License is distributed on an "AS IS" basis,
535
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
536
- * for the specific language governing rights and limitations under the
537
- * License.
538
- *
539
- * The Original Code is Ajax.org Code Editor (ACE).
540
- *
541
- * The Initial Developer of the Original Code is
542
- * Ajax.org B.V.
543
- * Portions created by the Initial Developer are Copyright (C) 2010
544
- * the Initial Developer. All Rights Reserved.
545
- *
546
- * Contributor(s):
547
- * Fabian Jakobs <fabian AT ajax DOT org>
548
- *
549
- * Alternatively, the contents of this file may be used under the terms of
550
- * either the GNU General Public License Version 2 or later (the "GPL"), or
551
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
552
- * in which case the provisions of the GPL or the LGPL are applicable instead
553
- * of those above. If you wish to allow use of your version of this file only
554
- * under the terms of either the GPL or the LGPL, and not to allow others to
555
- * use your version of this file under the terms of the MPL, indicate your
556
- * decision by deleting the provisions above and replace them with the notice
557
- * and other provisions required by the GPL or the LGPL. If you do not delete
558
- * the provisions above, a recipient may use your version of this file under
559
- * the terms of any one of the MPL, the GPL or the LGPL.
560
- *
561
- * ***** END LICENSE BLOCK ***** */
562
-
563
- define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
564
- "use strict";
565
-
566
- var oop = require("../lib/oop");
567
- var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
568
-
569
- var DocCommentHighlightRules = function() {
570
-
571
- this.$rules = {
572
- "start" : [ {
573
- token : "comment.doc.tag",
574
- regex : "@[\\w\\d_]+" // TODO: fix email addresses
575
- }, {
576
- token : "comment.doc",
577
- merge : true,
578
- regex : "\\s+"
579
- }, {
580
- token : "comment.doc",
581
- merge : true,
582
- regex : "TODO"
583
- }, {
584
- token : "comment.doc",
585
- merge : true,
586
- regex : "[^@\\*]+"
587
- }, {
588
- token : "comment.doc",
589
- merge : true,
590
- regex : "."
591
- }]
592
- };
593
- };
594
-
595
- oop.inherits(DocCommentHighlightRules, TextHighlightRules);
596
-
597
- (function() {
598
-
599
- this.getStartRule = function(start) {
600
- return {
601
- token : "comment.doc", // doc comment
602
- merge : true,
603
- regex : "\\/\\*(?=\\*)",
604
- next : start
605
- };
606
- };
607
-
608
- this.getEndRule = function (start) {
609
- return {
610
- token : "comment.doc", // closing comment
611
- merge : true,
612
- regex : "\\*\\/",
613
- next : start
614
- };
615
- };
616
-
617
- }).call(DocCommentHighlightRules.prototype);
618
-
619
- exports.DocCommentHighlightRules = DocCommentHighlightRules;
620
-
621
- });
622
- /* ***** BEGIN LICENSE BLOCK *****
623
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
624
- *
625
- * The contents of this file are subject to the Mozilla Public License Version
626
- * 1.1 (the "License"); you may not use this file except in compliance with
627
- * the License. You may obtain a copy of the License at
628
- * http://www.mozilla.org/MPL/
629
- *
630
- * Software distributed under the License is distributed on an "AS IS" basis,
631
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
632
- * for the specific language governing rights and limitations under the
633
- * License.
634
- *
635
- * The Original Code is Ajax.org Code Editor (ACE).
636
- *
637
- * The Initial Developer of the Original Code is
638
- * Ajax.org B.V.
639
- * Portions created by the Initial Developer are Copyright (C) 2010
640
- * the Initial Developer. All Rights Reserved.
641
- *
642
- * Contributor(s):
643
- * Fabian Jakobs <fabian AT ajax DOT org>
644
- *
645
- * Alternatively, the contents of this file may be used under the terms of
646
- * either the GNU General Public License Version 2 or later (the "GPL"), or
647
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
648
- * in which case the provisions of the GPL or the LGPL are applicable instead
649
- * of those above. If you wish to allow use of your version of this file only
650
- * under the terms of either the GPL or the LGPL, and not to allow others to
651
- * use your version of this file under the terms of the MPL, indicate your
652
- * decision by deleting the provisions above and replace them with the notice
653
- * and other provisions required by the GPL or the LGPL. If you do not delete
654
- * the provisions above, a recipient may use your version of this file under
655
- * the terms of any one of the MPL, the GPL or the LGPL.
656
- *
657
- * ***** END LICENSE BLOCK ***** */
658
-
659
- define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
660
- "use strict";
661
-
662
- var Range = require("../range").Range;
663
-
664
- var MatchingBraceOutdent = function() {};
665
-
666
- (function() {
667
-
668
- this.checkOutdent = function(line, input) {
669
- if (! /^\s+$/.test(line))
670
- return false;
671
-
672
- return /^\s*\}/.test(input);
673
- };
674
-
675
- this.autoOutdent = function(doc, row) {
676
- var line = doc.getLine(row);
677
- var match = line.match(/^(\s*\})/);
678
-
679
- if (!match) return 0;
680
-
681
- var column = match[1].length;
682
- var openBracePos = doc.findMatchingBracket({row: row, column: column});
683
-
684
- if (!openBracePos || openBracePos.row == row) return 0;
685
-
686
- var indent = this.$getIndent(doc.getLine(openBracePos.row));
687
- doc.replace(new Range(row, 0, row, column-1), indent);
688
- };
689
-
690
- this.$getIndent = function(line) {
691
- var match = line.match(/^(\s+)/);
692
- if (match) {
693
- return match[1];
694
- }
695
-
696
- return "";
697
- };
698
-
699
- }).call(MatchingBraceOutdent.prototype);
700
-
701
- exports.MatchingBraceOutdent = MatchingBraceOutdent;
702
- });
703
- /* vim:ts=4:sts=4:sw=4:
704
- * ***** BEGIN LICENSE BLOCK *****
705
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
706
- *
707
- * The contents of this file are subject to the Mozilla Public License Version
708
- * 1.1 (the "License"); you may not use this file except in compliance with
709
- * the License. You may obtain a copy of the License at
710
- * http://www.mozilla.org/MPL/
711
- *
712
- * Software distributed under the License is distributed on an "AS IS" basis,
713
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
714
- * for the specific language governing rights and limitations under the
715
- * License.
716
- *
717
- * The Original Code is Ajax.org Code Editor (ACE).
718
- *
719
- * The Initial Developer of the Original Code is
720
- * Ajax.org B.V.
721
- * Portions created by the Initial Developer are Copyright (C) 2010
722
- * the Initial Developer. All Rights Reserved.
723
- *
724
- * Contributor(s):
725
- * Chris Spencer <chris.ag.spencer AT googlemail DOT com>
726
- *
727
- * Alternatively, the contents of this file may be used under the terms of
728
- * either the GNU General Public License Version 2 or later (the "GPL"), or
729
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
730
- * in which case the provisions of the GPL or the LGPL are applicable instead
731
- * of those above. If you wish to allow use of your version of this file only
732
- * under the terms of either the GPL or the LGPL, and not to allow others to
733
- * use your version of this file under the terms of the MPL, indicate your
734
- * decision by deleting the provisions above and replace them with the notice
735
- * and other provisions required by the GPL or the LGPL. If you do not delete
736
- * the provisions above, a recipient may use your version of this file under
737
- * the terms of any one of the MPL, the GPL or the LGPL.
738
- *
739
- * ***** END LICENSE BLOCK ***** */
740
-
741
- define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
742
- "use strict";
743
-
744
- var oop = require("../../lib/oop");
745
- var Behaviour = require('../behaviour').Behaviour;
746
-
747
- var CstyleBehaviour = function () {
748
-
749
- this.add("braces", "insertion", function (state, action, editor, session, text) {
750
- if (text == '{') {
751
- var selection = editor.getSelectionRange();
752
- var selected = session.doc.getTextRange(selection);
753
- if (selected !== "") {
754
- return {
755
- text: '{' + selected + '}',
756
- selection: false
757
- }
758
- } else {
759
- return {
760
- text: '{}',
761
- selection: [1, 1]
762
- }
763
- }
764
- } else if (text == '}') {
765
- var cursor = editor.getCursorPosition();
766
- var line = session.doc.getLine(cursor.row);
767
- var rightChar = line.substring(cursor.column, cursor.column + 1);
768
- if (rightChar == '}') {
769
- var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
770
- if (matching !== null) {
771
- return {
772
- text: '',
773
- selection: [1, 1]
774
- }
775
- }
776
- }
777
- } else if (text == "\n") {
778
- var cursor = editor.getCursorPosition();
779
- var line = session.doc.getLine(cursor.row);
780
- var rightChar = line.substring(cursor.column, cursor.column + 1);
781
- if (rightChar == '}') {
782
- var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
783
- if (!openBracePos)
784
- return null;
785
-
786
- var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
787
- var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
788
-
789
- return {
790
- text: '\n' + indent + '\n' + next_indent,
791
- selection: [1, indent.length, 1, indent.length]
792
- }
793
- }
794
- }
795
- });
796
-
797
- this.add("braces", "deletion", function (state, action, editor, session, range) {
798
- var selected = session.doc.getTextRange(range);
799
- if (!range.isMultiLine() && selected == '{') {
800
- var line = session.doc.getLine(range.start.row);
801
- var rightChar = line.substring(range.end.column, range.end.column + 1);
802
- if (rightChar == '}') {
803
- range.end.column++;
804
- return range;
805
- }
806
- }
807
- });
808
-
809
- this.add("parens", "insertion", function (state, action, editor, session, text) {
810
- if (text == '(') {
811
- var selection = editor.getSelectionRange();
812
- var selected = session.doc.getTextRange(selection);
813
- if (selected !== "") {
814
- return {
815
- text: '(' + selected + ')',
816
- selection: false
817
- }
818
- } else {
819
- return {
820
- text: '()',
821
- selection: [1, 1]
822
- }
823
- }
824
- } else if (text == ')') {
825
- var cursor = editor.getCursorPosition();
826
- var line = session.doc.getLine(cursor.row);
827
- var rightChar = line.substring(cursor.column, cursor.column + 1);
828
- if (rightChar == ')') {
829
- var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
830
- if (matching !== null) {
831
- return {
832
- text: '',
833
- selection: [1, 1]
834
- }
835
- }
836
- }
837
- }
838
- });
839
-
840
- this.add("parens", "deletion", function (state, action, editor, session, range) {
841
- var selected = session.doc.getTextRange(range);
842
- if (!range.isMultiLine() && selected == '(') {
843
- var line = session.doc.getLine(range.start.row);
844
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
845
- if (rightChar == ')') {
846
- range.end.column++;
847
- return range;
848
- }
849
- }
850
- });
851
-
852
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
853
- if (text == '"') {
854
- var selection = editor.getSelectionRange();
855
- var selected = session.doc.getTextRange(selection);
856
- if (selected !== "") {
857
- return {
858
- text: '"' + selected + '"',
859
- selection: false
860
- }
861
- } else {
862
- var cursor = editor.getCursorPosition();
863
- var line = session.doc.getLine(cursor.row);
864
- var leftChar = line.substring(cursor.column-1, cursor.column);
865
-
866
- // We're escaped.
867
- if (leftChar == '\\') {
868
- return null;
869
- }
870
-
871
- // Find what token we're inside.
872
- var tokens = session.getTokens(selection.start.row, selection.start.row)[0].tokens;
873
- var col = 0, token;
874
- var quotepos = -1; // Track whether we're inside an open quote.
875
-
876
- for (var x = 0; x < tokens.length; x++) {
877
- token = tokens[x];
878
- if (token.type == "string") {
879
- quotepos = -1;
880
- } else if (quotepos < 0) {
881
- quotepos = token.value.indexOf('"');
882
- }
883
- if ((token.value.length + col) > selection.start.column) {
884
- break;
885
- }
886
- col += tokens[x].value.length;
887
- }
888
-
889
- // Try and be smart about when we auto insert.
890
- if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf('"') === token.value.length-1)))) {
891
- return {
892
- text: '""',
893
- selection: [1,1]
894
- }
895
- } else if (token && token.type === "string") {
896
- // Ignore input and move right one if we're typing over the closing quote.
897
- var rightChar = line.substring(cursor.column, cursor.column + 1);
898
- if (rightChar == '"') {
899
- return {
900
- text: '',
901
- selection: [1, 1]
902
- }
903
- }
904
- }
905
- }
906
- }
907
- });
908
-
909
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
910
- var selected = session.doc.getTextRange(range);
911
- if (!range.isMultiLine() && selected == '"') {
912
- var line = session.doc.getLine(range.start.row);
913
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
914
- if (rightChar == '"') {
915
- range.end.column++;
916
- return range;
917
- }
918
- }
919
- });
920
-
921
- }
922
- oop.inherits(CstyleBehaviour, Behaviour);
923
-
924
- exports.CstyleBehaviour = CstyleBehaviour;
925
- });/* ***** BEGIN LICENSE BLOCK *****
926
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
927
- *
928
- * The contents of this file are subject to the Mozilla Public License Version
929
- * 1.1 (the "License"); you may not use this file except in compliance with
930
- * the License. You may obtain a copy of the License at
931
- * http://www.mozilla.org/MPL/
932
- *
933
- * Software distributed under the License is distributed on an "AS IS" basis,
934
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
935
- * for the specific language governing rights and limitations under the
936
- * License.
937
- *
938
- * The Original Code is Ajax.org Code Editor (ACE).
939
- *
940
- * The Initial Developer of the Original Code is
941
- * Ajax.org B.V.
942
- * Portions created by the Initial Developer are Copyright (C) 2010
943
- * the Initial Developer. All Rights Reserved.
944
- *
945
- * Contributor(s):
946
- * Fabian Jakobs <fabian AT ajax DOT org>
947
- *
948
- * Alternatively, the contents of this file may be used under the terms of
949
- * either the GNU General Public License Version 2 or later (the "GPL"), or
950
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
951
- * in which case the provisions of the GPL or the LGPL are applicable instead
952
- * of those above. If you wish to allow use of your version of this file only
953
- * under the terms of either the GPL or the LGPL, and not to allow others to
954
- * use your version of this file under the terms of the MPL, indicate your
955
- * decision by deleting the provisions above and replace them with the notice
956
- * and other provisions required by the GPL or the LGPL. If you do not delete
957
- * the provisions above, a recipient may use your version of this file under
958
- * the terms of any one of the MPL, the GPL or the LGPL.
959
- *
960
- * ***** END LICENSE BLOCK ***** */
961
-
962
- define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
963
- "use strict";
964
-
965
- var oop = require("../../lib/oop");
966
- var Range = require("../../range").Range;
967
- var BaseFoldMode = require("./fold_mode").FoldMode;
968
-
969
- var FoldMode = exports.FoldMode = function() {};
970
- oop.inherits(FoldMode, BaseFoldMode);
971
-
972
- (function() {
973
-
974
- this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
975
- this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
976
-
977
- this.getFoldWidgetRange = function(session, foldStyle, row) {
978
- var line = session.getLine(row);
979
- var match = line.match(this.foldingStartMarker);
980
- if (match) {
981
- var i = match.index;
982
-
983
- if (match[1])
984
- return this.openingBracketBlock(session, match[1], row, i);
985
-
986
- var range = session.getCommentFoldRange(row, i + match[0].length);
987
- range.end.column -= 2;
988
- return range;
989
- }
990
-
991
- if (foldStyle !== "markbeginend")
992
- return;
993
-
994
- var match = line.match(this.foldingStopMarker);
995
- if (match) {
996
- var i = match.index + match[0].length;
997
-
998
- if (match[2]) {
999
- var range = session.getCommentFoldRange(row, i);
1000
- range.end.column -= 2;
1001
- return range;
1002
- }
1003
-
1004
- var end = {row: row, column: i};
1005
- var start = session.$findOpeningBracket(match[1], end);
1006
-
1007
- if (!start)
1008
- return;
1009
-
1010
- start.column++;
1011
- end.column--;
1012
-
1013
- return Range.fromPoints(start, end);
1014
- }
1015
- };
1016
-
1017
- }).call(FoldMode.prototype);
1018
-
1019
- });/* ***** BEGIN LICENSE BLOCK *****
1020
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1021
- *
1022
- * The contents of this file are subject to the Mozilla Public License Version
1023
- * 1.1 (the "License"); you may not use this file except in compliance with
1024
- * the License. You may obtain a copy of the License at
1025
- * http://www.mozilla.org/MPL/
1026
- *
1027
- * Software distributed under the License is distributed on an "AS IS" basis,
1028
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1029
- * for the specific language governing rights and limitations under the
1030
- * License.
1031
- *
1032
- * The Original Code is Ajax.org Code Editor (ACE).
1033
- *
1034
- * The Initial Developer of the Original Code is
1035
- * Ajax.org B.V.
1036
- * Portions created by the Initial Developer are Copyright (C) 2010
1037
- * the Initial Developer. All Rights Reserved.
1038
- *
1039
- * Contributor(s):
1040
- * Fabian Jakobs <fabian AT ajax DOT org>
1041
- *
1042
- * Alternatively, the contents of this file may be used under the terms of
1043
- * either the GNU General Public License Version 2 or later (the "GPL"), or
1044
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1045
- * in which case the provisions of the GPL or the LGPL are applicable instead
1046
- * of those above. If you wish to allow use of your version of this file only
1047
- * under the terms of either the GPL or the LGPL, and not to allow others to
1048
- * use your version of this file under the terms of the MPL, indicate your
1049
- * decision by deleting the provisions above and replace them with the notice
1050
- * and other provisions required by the GPL or the LGPL. If you do not delete
1051
- * the provisions above, a recipient may use your version of this file under
1052
- * the terms of any one of the MPL, the GPL or the LGPL.
1053
- *
1054
- * ***** END LICENSE BLOCK ***** */
1055
-
1056
- define('ace/mode/folding/fold_mode', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
1057
- "use strict";
1058
-
1059
- var Range = require("../../range").Range;
1060
-
1061
- var FoldMode = exports.FoldMode = function() {};
1062
-
1063
- (function() {
1064
-
1065
- this.foldingStartMarker = null;
1066
- this.foldingStopMarker = null;
1067
-
1068
- // must return "" if there's no fold, to enable caching
1069
- this.getFoldWidget = function(session, foldStyle, row) {
1070
- var line = session.getLine(row);
1071
- if (this.foldingStartMarker.test(line))
1072
- return "start";
1073
- if (foldStyle == "markbeginend"
1074
- && this.foldingStopMarker
1075
- && this.foldingStopMarker.test(line))
1076
- return "end";
1077
- return "";
1078
- };
1079
-
1080
- this.getFoldWidgetRange = function(session, foldStyle, row) {
1081
- return null;
1082
- };
1083
-
1084
- this.indentationBlock = function(session, row, column) {
1085
- var re = /^\s*/;
1086
- var startRow = row;
1087
- var endRow = row;
1088
- var line = session.getLine(row);
1089
- var startColumn = column || line.length;
1090
- var startLevel = line.match(re)[0].length;
1091
- var maxRow = session.getLength()
1092
-
1093
- while (++row < maxRow) {
1094
- line = session.getLine(row);
1095
- var level = line.match(re)[0].length;
1096
-
1097
- if (level == line.length)
1098
- continue;
1099
-
1100
- if (level <= startLevel)
1101
- break;
1102
-
1103
- endRow = row;
1104
- }
1105
-
1106
- if (endRow > startRow) {
1107
- var endColumn = session.getLine(endRow).length;
1108
- return new Range(startRow, startColumn, endRow, endColumn);
1109
- }
1110
- };
1111
-
1112
- this.openingBracketBlock = function(session, bracket, row, column) {
1113
- var start = {row: row, column: column + 1};
1114
- var end = session.$findClosingBracket(bracket, start);
1115
- if (!end)
1116
- return;
1117
-
1118
- var fw = session.foldWidgets[end.row];
1119
- if (fw == null)
1120
- fw = this.getFoldWidget(session, end.row);
1121
-
1122
- if (fw == "start") {
1123
- end.row --;
1124
- end.column = session.getLine(end.row).length;
1125
- }
1126
- return Range.fromPoints(start, end);
1127
- };
1128
-
1129
- }).call(FoldMode.prototype);
1130
-
1131
- });