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,2391 +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
- ace.define('ace/mode/coldfusion', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml', 'ace/mode/javascript', 'ace/mode/css', 'ace/tokenizer', 'ace/mode/coldfusion_highlight_rules'], function(require, exports, module) {
39
- "use strict";
40
-
41
- var oop = require("../lib/oop");
42
- var XmlMode = require("./xml").Mode;
43
- var JavaScriptMode = require("./javascript").Mode;
44
- var CssMode = require("./css").Mode;
45
- var Tokenizer = require("../tokenizer").Tokenizer;
46
- var ColdfusionHighlightRules = require("./coldfusion_highlight_rules").ColdfusionHighlightRules;
47
-
48
- var Mode = function() {
49
- XmlMode.call(this);
50
-
51
- var highlighter = new ColdfusionHighlightRules();
52
- this.$tokenizer = new Tokenizer(highlighter.getRules());
53
-
54
- this.$embeds = highlighter.getEmbeds();
55
- this.createModeDelegates({
56
- "js-": JavaScriptMode,
57
- "css-": CssMode
58
- });
59
- };
60
- oop.inherits(Mode, XmlMode);
61
-
62
- (function() {
63
-
64
- this.getNextLineIndent = function(state, line, tab) {
65
- return this.$getIndent(line);
66
- };
67
-
68
- }).call(Mode.prototype);
69
-
70
- exports.Mode = Mode;
71
- });
72
- /* ***** BEGIN LICENSE BLOCK *****
73
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
74
- *
75
- * The contents of this file are subject to the Mozilla Public License Version
76
- * 1.1 (the "License"); you may not use this file except in compliance with
77
- * the License. You may obtain a copy of the License at
78
- * http://www.mozilla.org/MPL/
79
- *
80
- * Software distributed under the License is distributed on an "AS IS" basis,
81
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
82
- * for the specific language governing rights and limitations under the
83
- * License.
84
- *
85
- * The Original Code is Ajax.org Code Editor (ACE).
86
- *
87
- * The Initial Developer of the Original Code is
88
- * Ajax.org B.V.
89
- * Portions created by the Initial Developer are Copyright (C) 2010
90
- * the Initial Developer. All Rights Reserved.
91
- *
92
- * Contributor(s):
93
- * Fabian Jakobs <fabian AT ajax DOT org>
94
- *
95
- * Alternatively, the contents of this file may be used under the terms of
96
- * either the GNU General Public License Version 2 or later (the "GPL"), or
97
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
98
- * in which case the provisions of the GPL or the LGPL are applicable instead
99
- * of those above. If you wish to allow use of your version of this file only
100
- * under the terms of either the GPL or the LGPL, and not to allow others to
101
- * use your version of this file under the terms of the MPL, indicate your
102
- * decision by deleting the provisions above and replace them with the notice
103
- * and other provisions required by the GPL or the LGPL. If you do not delete
104
- * the provisions above, a recipient may use your version of this file under
105
- * the terms of any one of the MPL, the GPL or the LGPL.
106
- *
107
- * ***** END LICENSE BLOCK ***** */
108
-
109
- ace.define('ace/mode/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/xml_highlight_rules', 'ace/mode/behaviour/xml', 'ace/mode/folding/xml'], function(require, exports, module) {
110
- "use strict";
111
-
112
- var oop = require("../lib/oop");
113
- var TextMode = require("./text").Mode;
114
- var Tokenizer = require("../tokenizer").Tokenizer;
115
- var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
116
- var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
117
- var XmlFoldMode = require("./folding/xml").FoldMode;
118
-
119
- var Mode = function() {
120
- this.$tokenizer = new Tokenizer(new XmlHighlightRules().getRules());
121
- this.$behaviour = new XmlBehaviour();
122
- this.foldingRules = new XmlFoldMode();
123
- };
124
-
125
- oop.inherits(Mode, TextMode);
126
-
127
- (function() {
128
-
129
- this.getNextLineIndent = function(state, line, tab) {
130
- return this.$getIndent(line);
131
- };
132
-
133
- }).call(Mode.prototype);
134
-
135
- exports.Mode = Mode;
136
- });
137
- /* ***** BEGIN LICENSE BLOCK *****
138
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
139
- *
140
- * The contents of this file are subject to the Mozilla Public License Version
141
- * 1.1 (the "License"); you may not use this file except in compliance with
142
- * the License. You may obtain a copy of the License at
143
- * http://www.mozilla.org/MPL/
144
- *
145
- * Software distributed under the License is distributed on an "AS IS" basis,
146
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
147
- * for the specific language governing rights and limitations under the
148
- * License.
149
- *
150
- * The Original Code is Ajax.org Code Editor (ACE).
151
- *
152
- * The Initial Developer of the Original Code is
153
- * Ajax.org B.V.
154
- * Portions created by the Initial Developer are Copyright (C) 2010
155
- * the Initial Developer. All Rights Reserved.
156
- *
157
- * Contributor(s):
158
- * Fabian Jakobs <fabian AT ajax DOT org>
159
- *
160
- * Alternatively, the contents of this file may be used under the terms of
161
- * either the GNU General Public License Version 2 or later (the "GPL"), or
162
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
163
- * in which case the provisions of the GPL or the LGPL are applicable instead
164
- * of those above. If you wish to allow use of your version of this file only
165
- * under the terms of either the GPL or the LGPL, and not to allow others to
166
- * use your version of this file under the terms of the MPL, indicate your
167
- * decision by deleting the provisions above and replace them with the notice
168
- * and other provisions required by the GPL or the LGPL. If you do not delete
169
- * the provisions above, a recipient may use your version of this file under
170
- * the terms of any one of the MPL, the GPL or the LGPL.
171
- *
172
- * ***** END LICENSE BLOCK ***** */
173
-
174
- ace.define('ace/mode/xml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
175
- "use strict";
176
-
177
- var oop = require("../lib/oop");
178
- var xmlUtil = require("./xml_util");
179
- var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
180
-
181
- var XmlHighlightRules = function() {
182
-
183
- // regexp must not have capturing parentheses
184
- // regexps are ordered -> the first match is used
185
- this.$rules = {
186
- start : [{
187
- token : "text",
188
- regex : "<\\!\\[CDATA\\[",
189
- next : "cdata"
190
- }, {
191
- token : "xml_pe",
192
- regex : "<\\?.*?\\?>"
193
- }, {
194
- token : "comment",
195
- merge : true,
196
- regex : "<\\!--",
197
- next : "comment"
198
- }, {
199
- token : "meta.tag", // opening tag
200
- regex : "<\\/?",
201
- next : "tag"
202
- }, {
203
- token : "text",
204
- regex : "\\s+"
205
- }, {
206
- token : "text",
207
- regex : "[^<]+"
208
- }],
209
-
210
- cdata : [{
211
- token : "text",
212
- regex : "\\]\\]>",
213
- next : "start"
214
- }, {
215
- token : "text",
216
- regex : "\\s+"
217
- }, {
218
- token : "text",
219
- regex : "(?:[^\\]]|\\](?!\\]>))+"
220
- }],
221
-
222
- comment : [{
223
- token : "comment",
224
- regex : ".*?-->",
225
- next : "start"
226
- }, {
227
- token : "comment",
228
- merge : true,
229
- regex : ".+"
230
- }]
231
- };
232
-
233
- xmlUtil.tag(this.$rules, "tag", "start");
234
- };
235
-
236
- oop.inherits(XmlHighlightRules, TextHighlightRules);
237
-
238
- exports.XmlHighlightRules = XmlHighlightRules;
239
- });
240
- /* ***** BEGIN LICENSE BLOCK *****
241
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
242
- *
243
- * The contents of this file are subject to the Mozilla Public License Version
244
- * 1.1 (the "License"); you may not use this file except in compliance with
245
- * the License. You may obtain a copy of the License at
246
- * http://www.mozilla.org/MPL/
247
- *
248
- * Software distributed under the License is distributed on an "AS IS" basis,
249
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
250
- * for the specific language governing rights and limitations under the
251
- * License.
252
- *
253
- * The Original Code is Ajax.org Code Editor (ACE).
254
- *
255
- * The Initial Developer of the Original Code is
256
- * Ajax.org B.V.
257
- * Portions created by the Initial Developer are Copyright (C) 2010
258
- * the Initial Developer. All Rights Reserved.
259
- *
260
- * Contributor(s):
261
- * Fabian Jakobs <fabian AT ajax DOT org>
262
- *
263
- * Alternatively, the contents of this file may be used under the terms of
264
- * either the GNU General Public License Version 2 or later (the "GPL"), or
265
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
266
- * in which case the provisions of the GPL or the LGPL are applicable instead
267
- * of those above. If you wish to allow use of your version of this file only
268
- * under the terms of either the GPL or the LGPL, and not to allow others to
269
- * use your version of this file under the terms of the MPL, indicate your
270
- * decision by deleting the provisions above and replace them with the notice
271
- * and other provisions required by the GPL or the LGPL. If you do not delete
272
- * the provisions above, a recipient may use your version of this file under
273
- * the terms of any one of the MPL, the GPL or the LGPL.
274
- *
275
- * ***** END LICENSE BLOCK ***** */
276
-
277
- ace.define('ace/mode/xml_util', ['require', 'exports', 'module' , 'ace/lib/lang'], function(require, exports, module) {
278
- "use strict";
279
-
280
- var lang = require("../lib/lang");
281
-
282
- var formTags = lang.arrayToMap(
283
- ("button|form|input|label|select|textarea").split("|")
284
- );
285
-
286
- var tableTags = lang.arrayToMap(
287
- ("table|tbody|td|tfoot|th|tr").split("|")
288
- );
289
-
290
- function string(state) {
291
- return [{
292
- token : "string",
293
- regex : '".*?"'
294
- }, {
295
- token : "string", // multi line string start
296
- merge : true,
297
- regex : '["].*',
298
- next : state + "_qqstring"
299
- }, {
300
- token : "string",
301
- regex : "'.*?'"
302
- }, {
303
- token : "string", // multi line string start
304
- merge : true,
305
- regex : "['].*",
306
- next : state + "_qstring"
307
- }];
308
- }
309
-
310
- function multiLineString(quote, state) {
311
- return [{
312
- token : "string",
313
- merge : true,
314
- regex : ".*?" + quote,
315
- next : state
316
- }, {
317
- token : "string",
318
- merge : true,
319
- regex : '.+'
320
- }];
321
- }
322
-
323
- exports.tag = function(states, name, nextState) {
324
- states[name] = [{
325
- token : "text",
326
- regex : "\\s+"
327
- }, {
328
- //token : "meta.tag",
329
-
330
- token : function(value) {
331
- if ( value==='a' ) {
332
- return "meta.tag.anchor";
333
- }
334
- else if ( value==='img' ) {
335
- return "meta.tag.image";
336
- }
337
- else if ( value==='script' ) {
338
- return "meta.tag.script";
339
- }
340
- else if ( value==='style' ) {
341
- return "meta.tag.style";
342
- }
343
- else if (formTags.hasOwnProperty(value.toLowerCase())) {
344
- return "meta.tag.form";
345
- }
346
- else if (tableTags.hasOwnProperty(value.toLowerCase())) {
347
- return "meta.tag.table";
348
- }
349
- else {
350
- return "meta.tag";
351
- }
352
- },
353
- merge : true,
354
- regex : "[-_a-zA-Z0-9:!]+",
355
- next : name + "_embed_attribute_list"
356
- }, {
357
- token: "empty",
358
- regex: "",
359
- next : name + "_embed_attribute_list"
360
- }];
361
-
362
- states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list");
363
- states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list");
364
-
365
- states[name + "_embed_attribute_list"] = [{
366
- token : "meta.tag",
367
- merge : true,
368
- regex : "\/?>",
369
- next : nextState
370
- }, {
371
- token : "keyword.operator",
372
- regex : "="
373
- }, {
374
- token : "entity.other.attribute-name",
375
- regex : "[-_a-zA-Z0-9:]+"
376
- }, {
377
- token : "constant.numeric", // float
378
- regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
379
- }, {
380
- token : "text",
381
- regex : "\\s+"
382
- }].concat(string(name));
383
- };
384
-
385
- });
386
- /* vim:ts=4:sts=4:sw=4:
387
- * ***** BEGIN LICENSE BLOCK *****
388
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
389
- *
390
- * The contents of this file are subject to the Mozilla Public License Version
391
- * 1.1 (the "License"); you may not use this file except in compliance with
392
- * the License. You may obtain a copy of the License at
393
- * http://www.mozilla.org/MPL/
394
- *
395
- * Software distributed under the License is distributed on an "AS IS" basis,
396
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
397
- * for the specific language governing rights and limitations under the
398
- * License.
399
- *
400
- * The Original Code is Ajax.org Code Editor (ACE).
401
- *
402
- * The Initial Developer of the Original Code is
403
- * Ajax.org B.V.
404
- * Portions created by the Initial Developer are Copyright (C) 2010
405
- * the Initial Developer. All Rights Reserved.
406
- *
407
- * Contributor(s):
408
- * Chris Spencer <chris.ag.spencer AT googlemail DOT com>
409
- *
410
- * Alternatively, the contents of this file may be used under the terms of
411
- * either the GNU General Public License Version 2 or later (the "GPL"), or
412
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
413
- * in which case the provisions of the GPL or the LGPL are applicable instead
414
- * of those above. If you wish to allow use of your version of this file only
415
- * under the terms of either the GPL or the LGPL, and not to allow others to
416
- * use your version of this file under the terms of the MPL, indicate your
417
- * decision by deleting the provisions above and replace them with the notice
418
- * and other provisions required by the GPL or the LGPL. If you do not delete
419
- * the provisions above, a recipient may use your version of this file under
420
- * the terms of any one of the MPL, the GPL or the LGPL.
421
- *
422
- * ***** END LICENSE BLOCK ***** */
423
-
424
- ace.define('ace/mode/behaviour/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle'], function(require, exports, module) {
425
- "use strict";
426
-
427
- var oop = require("../../lib/oop");
428
- var Behaviour = require("../behaviour").Behaviour;
429
- var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
430
-
431
- var XmlBehaviour = function () {
432
-
433
- this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour
434
-
435
- this.add("brackets", "insertion", function (state, action, editor, session, text) {
436
- if (text == '<') {
437
- var selection = editor.getSelectionRange();
438
- var selected = session.doc.getTextRange(selection);
439
- if (selected !== "") {
440
- return false;
441
- } else {
442
- return {
443
- text: '<>',
444
- selection: [1, 1]
445
- }
446
- }
447
- } else if (text == '>') {
448
- var cursor = editor.getCursorPosition();
449
- var line = session.doc.getLine(cursor.row);
450
- var rightChar = line.substring(cursor.column, cursor.column + 1);
451
- if (rightChar == '>') { // need some kind of matching check here
452
- return {
453
- text: '',
454
- selection: [1, 1]
455
- }
456
- }
457
- } else if (text == "\n") {
458
- var cursor = editor.getCursorPosition();
459
- var line = session.doc.getLine(cursor.row);
460
- var rightChars = line.substring(cursor.column, cursor.column + 2);
461
- if (rightChars == '</') {
462
- var indent = this.$getIndent(session.doc.getLine(cursor.row)) + session.getTabString();
463
- var next_indent = this.$getIndent(session.doc.getLine(cursor.row));
464
-
465
- return {
466
- text: '\n' + indent + '\n' + next_indent,
467
- selection: [1, indent.length, 1, indent.length]
468
- }
469
- }
470
- }
471
- });
472
-
473
- }
474
- oop.inherits(XmlBehaviour, Behaviour);
475
-
476
- exports.XmlBehaviour = XmlBehaviour;
477
- });/* vim:ts=4:sts=4:sw=4:
478
- * ***** BEGIN LICENSE BLOCK *****
479
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
480
- *
481
- * The contents of this file are subject to the Mozilla Public License Version
482
- * 1.1 (the "License"); you may not use this file except in compliance with
483
- * the License. You may obtain a copy of the License at
484
- * http://www.mozilla.org/MPL/
485
- *
486
- * Software distributed under the License is distributed on an "AS IS" basis,
487
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
488
- * for the specific language governing rights and limitations under the
489
- * License.
490
- *
491
- * The Original Code is Ajax.org Code Editor (ACE).
492
- *
493
- * The Initial Developer of the Original Code is
494
- * Ajax.org B.V.
495
- * Portions created by the Initial Developer are Copyright (C) 2010
496
- * the Initial Developer. All Rights Reserved.
497
- *
498
- * Contributor(s):
499
- * Chris Spencer <chris.ag.spencer AT googlemail DOT com>
500
- *
501
- * Alternatively, the contents of this file may be used under the terms of
502
- * either the GNU General Public License Version 2 or later (the "GPL"), or
503
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
504
- * in which case the provisions of the GPL or the LGPL are applicable instead
505
- * of those above. If you wish to allow use of your version of this file only
506
- * under the terms of either the GPL or the LGPL, and not to allow others to
507
- * use your version of this file under the terms of the MPL, indicate your
508
- * decision by deleting the provisions above and replace them with the notice
509
- * and other provisions required by the GPL or the LGPL. If you do not delete
510
- * the provisions above, a recipient may use your version of this file under
511
- * the terms of any one of the MPL, the GPL or the LGPL.
512
- *
513
- * ***** END LICENSE BLOCK ***** */
514
-
515
- ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
516
- "use strict";
517
-
518
- var oop = require("../../lib/oop");
519
- var Behaviour = require('../behaviour').Behaviour;
520
-
521
- var CstyleBehaviour = function () {
522
-
523
- this.add("braces", "insertion", function (state, action, editor, session, text) {
524
- if (text == '{') {
525
- var selection = editor.getSelectionRange();
526
- var selected = session.doc.getTextRange(selection);
527
- if (selected !== "") {
528
- return {
529
- text: '{' + selected + '}',
530
- selection: false
531
- }
532
- } else {
533
- return {
534
- text: '{}',
535
- selection: [1, 1]
536
- }
537
- }
538
- } else if (text == '}') {
539
- var cursor = editor.getCursorPosition();
540
- var line = session.doc.getLine(cursor.row);
541
- var rightChar = line.substring(cursor.column, cursor.column + 1);
542
- if (rightChar == '}') {
543
- var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
544
- if (matching !== null) {
545
- return {
546
- text: '',
547
- selection: [1, 1]
548
- }
549
- }
550
- }
551
- } else if (text == "\n") {
552
- var cursor = editor.getCursorPosition();
553
- var line = session.doc.getLine(cursor.row);
554
- var rightChar = line.substring(cursor.column, cursor.column + 1);
555
- if (rightChar == '}') {
556
- var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
557
- if (!openBracePos)
558
- return null;
559
-
560
- var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
561
- var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
562
-
563
- return {
564
- text: '\n' + indent + '\n' + next_indent,
565
- selection: [1, indent.length, 1, indent.length]
566
- }
567
- }
568
- }
569
- });
570
-
571
- this.add("braces", "deletion", function (state, action, editor, session, range) {
572
- var selected = session.doc.getTextRange(range);
573
- if (!range.isMultiLine() && selected == '{') {
574
- var line = session.doc.getLine(range.start.row);
575
- var rightChar = line.substring(range.end.column, range.end.column + 1);
576
- if (rightChar == '}') {
577
- range.end.column++;
578
- return range;
579
- }
580
- }
581
- });
582
-
583
- this.add("parens", "insertion", function (state, action, editor, session, text) {
584
- if (text == '(') {
585
- var selection = editor.getSelectionRange();
586
- var selected = session.doc.getTextRange(selection);
587
- if (selected !== "") {
588
- return {
589
- text: '(' + selected + ')',
590
- selection: false
591
- }
592
- } else {
593
- return {
594
- text: '()',
595
- selection: [1, 1]
596
- }
597
- }
598
- } else if (text == ')') {
599
- var cursor = editor.getCursorPosition();
600
- var line = session.doc.getLine(cursor.row);
601
- var rightChar = line.substring(cursor.column, cursor.column + 1);
602
- if (rightChar == ')') {
603
- var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
604
- if (matching !== null) {
605
- return {
606
- text: '',
607
- selection: [1, 1]
608
- }
609
- }
610
- }
611
- }
612
- });
613
-
614
- this.add("parens", "deletion", function (state, action, editor, session, range) {
615
- var selected = session.doc.getTextRange(range);
616
- if (!range.isMultiLine() && selected == '(') {
617
- var line = session.doc.getLine(range.start.row);
618
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
619
- if (rightChar == ')') {
620
- range.end.column++;
621
- return range;
622
- }
623
- }
624
- });
625
-
626
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
627
- if (text == '"') {
628
- var selection = editor.getSelectionRange();
629
- var selected = session.doc.getTextRange(selection);
630
- if (selected !== "") {
631
- return {
632
- text: '"' + selected + '"',
633
- selection: false
634
- }
635
- } else {
636
- var cursor = editor.getCursorPosition();
637
- var line = session.doc.getLine(cursor.row);
638
- var leftChar = line.substring(cursor.column-1, cursor.column);
639
-
640
- // We're escaped.
641
- if (leftChar == '\\') {
642
- return null;
643
- }
644
-
645
- // Find what token we're inside.
646
- var tokens = session.getTokens(selection.start.row, selection.start.row)[0].tokens;
647
- var col = 0, token;
648
- var quotepos = -1; // Track whether we're inside an open quote.
649
-
650
- for (var x = 0; x < tokens.length; x++) {
651
- token = tokens[x];
652
- if (token.type == "string") {
653
- quotepos = -1;
654
- } else if (quotepos < 0) {
655
- quotepos = token.value.indexOf('"');
656
- }
657
- if ((token.value.length + col) > selection.start.column) {
658
- break;
659
- }
660
- col += tokens[x].value.length;
661
- }
662
-
663
- // Try and be smart about when we auto insert.
664
- 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)))) {
665
- return {
666
- text: '""',
667
- selection: [1,1]
668
- }
669
- } else if (token && token.type === "string") {
670
- // Ignore input and move right one if we're typing over the closing quote.
671
- var rightChar = line.substring(cursor.column, cursor.column + 1);
672
- if (rightChar == '"') {
673
- return {
674
- text: '',
675
- selection: [1, 1]
676
- }
677
- }
678
- }
679
- }
680
- }
681
- });
682
-
683
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
684
- var selected = session.doc.getTextRange(range);
685
- if (!range.isMultiLine() && selected == '"') {
686
- var line = session.doc.getLine(range.start.row);
687
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
688
- if (rightChar == '"') {
689
- range.end.column++;
690
- return range;
691
- }
692
- }
693
- });
694
-
695
- }
696
- oop.inherits(CstyleBehaviour, Behaviour);
697
-
698
- exports.CstyleBehaviour = CstyleBehaviour;
699
- });/* ***** BEGIN LICENSE BLOCK *****
700
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
701
- *
702
- * The contents of this file are subject to the Mozilla Public License Version
703
- * 1.1 (the "License"); you may not use this file except in compliance with
704
- * the License. You may obtain a copy of the License at
705
- * http://www.mozilla.org/MPL/
706
- *
707
- * Software distributed under the License is distributed on an "AS IS" basis,
708
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
709
- * for the specific language governing rights and limitations under the
710
- * License.
711
- *
712
- * The Original Code is Ajax.org Code Editor (ACE).
713
- *
714
- * The Initial Developer of the Original Code is
715
- * Ajax.org B.V.
716
- * Portions created by the Initial Developer are Copyright (C) 2010
717
- * the Initial Developer. All Rights Reserved.
718
- *
719
- * Contributor(s):
720
- * Fabian Jakobs <fabian AT ajax DOT org>
721
- *
722
- * Alternatively, the contents of this file may be used under the terms of
723
- * either the GNU General Public License Version 2 or later (the "GPL"), or
724
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
725
- * in which case the provisions of the GPL or the LGPL are applicable instead
726
- * of those above. If you wish to allow use of your version of this file only
727
- * under the terms of either the GPL or the LGPL, and not to allow others to
728
- * use your version of this file under the terms of the MPL, indicate your
729
- * decision by deleting the provisions above and replace them with the notice
730
- * and other provisions required by the GPL or the LGPL. If you do not delete
731
- * the provisions above, a recipient may use your version of this file under
732
- * the terms of any one of the MPL, the GPL or the LGPL.
733
- *
734
- * ***** END LICENSE BLOCK ***** */
735
-
736
- ace.define('ace/mode/folding/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/range', 'ace/mode/folding/fold_mode', 'ace/token_iterator'], function(require, exports, module) {
737
- "use strict";
738
-
739
- var oop = require("../../lib/oop");
740
- var lang = require("../../lib/lang");
741
- var Range = require("../../range").Range;
742
- var BaseFoldMode = require("./fold_mode").FoldMode;
743
- var TokenIterator = require("../../token_iterator").TokenIterator;
744
-
745
- var FoldMode = exports.FoldMode = function(voidElements) {
746
- BaseFoldMode.call(this);
747
- this.voidElements = voidElements || {};
748
- };
749
- oop.inherits(FoldMode, BaseFoldMode);
750
-
751
- (function() {
752
-
753
- this.getFoldWidget = function(session, foldStyle, row) {
754
- var tag = this._getFirstTagInLine(session, row);
755
-
756
- if (tag.closing)
757
- return foldStyle == "markbeginend" ? "end" : "";
758
-
759
- if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()])
760
- return "";
761
-
762
- if (tag.selfClosing)
763
- return "";
764
-
765
- if (tag.value.indexOf("/" + tag.tagName) !== -1)
766
- return "";
767
-
768
- return "start";
769
- };
770
-
771
- this._getFirstTagInLine = function(session, row) {
772
- var tokens = session.getTokens(row, row)[0].tokens;
773
- var value = "";
774
- for (var i = 0; i < tokens.length; i++) {
775
- var token = tokens[i];
776
- if (token.type.indexOf("meta.tag") === 0)
777
- value += token.value;
778
- else
779
- value += lang.stringRepeat(" ", token.value.length);
780
- }
781
-
782
- return this._parseTag(value);
783
- };
784
-
785
- this.tagRe = /^(\s*)(<?(\/?)([-_a-zA-Z0-9:!]*)\s*(\/?)>?)/;
786
- this._parseTag = function(tag) {
787
-
788
- var match = this.tagRe.exec(tag);
789
- var column = this.tagRe.lastIndex || 0;
790
- this.tagRe.lastIndex = 0;
791
-
792
- return {
793
- value: tag,
794
- match: match ? match[2] : "",
795
- closing: match ? !!match[3] : false,
796
- selfClosing: match ? !!match[5] || match[2] == "/>" : false,
797
- tagName: match ? match[4] : "",
798
- column: match[1] ? column + match[1].length : column
799
- };
800
- };
801
-
802
- /**
803
- * reads a full tag and places the iterator after the tag
804
- */
805
- this._readTagForward = function(iterator) {
806
- var token = iterator.getCurrentToken();
807
- if (!token)
808
- return null;
809
-
810
- var value = "";
811
- var start;
812
-
813
- do {
814
- if (token.type.indexOf("meta.tag") === 0) {
815
- if (!start) {
816
- var start = {
817
- row: iterator.getCurrentTokenRow(),
818
- column: iterator.getCurrentTokenColumn()
819
- };
820
- }
821
- value += token.value;
822
- if (value.indexOf(">") !== -1) {
823
- var tag = this._parseTag(value);
824
- tag.start = start;
825
- tag.end = {
826
- row: iterator.getCurrentTokenRow(),
827
- column: iterator.getCurrentTokenColumn() + token.value.length
828
- };
829
- iterator.stepForward();
830
- return tag;
831
- }
832
- }
833
- } while(token = iterator.stepForward());
834
-
835
- return null;
836
- };
837
-
838
- this._readTagBackward = function(iterator) {
839
- var token = iterator.getCurrentToken();
840
- if (!token)
841
- return null;
842
-
843
- var value = "";
844
- var end;
845
-
846
- do {
847
- if (token.type.indexOf("meta.tag") === 0) {
848
- if (!end) {
849
- end = {
850
- row: iterator.getCurrentTokenRow(),
851
- column: iterator.getCurrentTokenColumn() + token.value.length
852
- };
853
- }
854
- value = token.value + value;
855
- if (value.indexOf("<") !== -1) {
856
- var tag = this._parseTag(value);
857
- tag.end = end;
858
- tag.start = {
859
- row: iterator.getCurrentTokenRow(),
860
- column: iterator.getCurrentTokenColumn()
861
- };
862
- iterator.stepBackward();
863
- return tag;
864
- }
865
- }
866
- } while(token = iterator.stepBackward());
867
-
868
- return null;
869
- };
870
-
871
- this._pop = function(stack, tag) {
872
- while (stack.length) {
873
-
874
- var top = stack[stack.length-1];
875
- if (!tag || top.tagName == tag.tagName) {
876
- return stack.pop();
877
- }
878
- else if (this.voidElements[tag.tagName]) {
879
- return;
880
- }
881
- else if (this.voidElements[top.tagName]) {
882
- stack.pop();
883
- continue;
884
- } else {
885
- return null;
886
- }
887
- }
888
- };
889
-
890
- this.getFoldWidgetRange = function(session, foldStyle, row) {
891
- var firstTag = this._getFirstTagInLine(session, row);
892
-
893
- if (!firstTag.match)
894
- return null;
895
-
896
- var isBackward = firstTag.closing || firstTag.selfClosing;
897
- var stack = [];
898
- var tag;
899
-
900
- if (!isBackward) {
901
- var iterator = new TokenIterator(session, row, firstTag.column);
902
- var start = {
903
- row: row,
904
- column: firstTag.column + firstTag.tagName.length + 2
905
- };
906
- while (tag = this._readTagForward(iterator)) {
907
- if (tag.selfClosing) {
908
- if (!stack.length) {
909
- tag.start.column += tag.tagName.length + 2;
910
- tag.end.column -= 2;
911
- return Range.fromPoints(tag.start, tag.end);
912
- } else
913
- continue;
914
- }
915
-
916
- if (tag.closing) {
917
- this._pop(stack, tag);
918
- if (stack.length == 0)
919
- return Range.fromPoints(start, tag.start);
920
- }
921
- else {
922
- stack.push(tag)
923
- }
924
- }
925
- }
926
- else {
927
- var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length);
928
- var end = {
929
- row: row,
930
- column: firstTag.column
931
- };
932
-
933
- while (tag = this._readTagBackward(iterator)) {
934
- if (tag.selfClosing) {
935
- if (!stack.length) {
936
- tag.start.column += tag.tagName.length + 2;
937
- tag.end.column -= 2;
938
- return Range.fromPoints(tag.start, tag.end);
939
- } else
940
- continue;
941
- }
942
-
943
- if (!tag.closing) {
944
- this._pop(stack, tag);
945
- if (stack.length == 0) {
946
- tag.start.column += tag.tagName.length + 2;
947
- return Range.fromPoints(tag.start, end);
948
- }
949
- }
950
- else {
951
- stack.push(tag)
952
- }
953
- }
954
- }
955
-
956
- };
957
-
958
- }).call(FoldMode.prototype);
959
-
960
- });/* ***** BEGIN LICENSE BLOCK *****
961
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
962
- *
963
- * The contents of this file are subject to the Mozilla Public License Version
964
- * 1.1 (the "License"); you may not use this file except in compliance with
965
- * the License. You may obtain a copy of the License at
966
- * http://www.mozilla.org/MPL/
967
- *
968
- * Software distributed under the License is distributed on an "AS IS" basis,
969
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
970
- * for the specific language governing rights and limitations under the
971
- * License.
972
- *
973
- * The Original Code is Ajax.org Code Editor (ACE).
974
- *
975
- * The Initial Developer of the Original Code is
976
- * Ajax.org B.V.
977
- * Portions created by the Initial Developer are Copyright (C) 2010
978
- * the Initial Developer. All Rights Reserved.
979
- *
980
- * Contributor(s):
981
- * Fabian Jakobs <fabian AT ajax DOT org>
982
- *
983
- * Alternatively, the contents of this file may be used under the terms of
984
- * either the GNU General Public License Version 2 or later (the "GPL"), or
985
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
986
- * in which case the provisions of the GPL or the LGPL are applicable instead
987
- * of those above. If you wish to allow use of your version of this file only
988
- * under the terms of either the GPL or the LGPL, and not to allow others to
989
- * use your version of this file under the terms of the MPL, indicate your
990
- * decision by deleting the provisions above and replace them with the notice
991
- * and other provisions required by the GPL or the LGPL. If you do not delete
992
- * the provisions above, a recipient may use your version of this file under
993
- * the terms of any one of the MPL, the GPL or the LGPL.
994
- *
995
- * ***** END LICENSE BLOCK ***** */
996
-
997
- ace.define('ace/mode/folding/fold_mode', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
998
- "use strict";
999
-
1000
- var Range = require("../../range").Range;
1001
-
1002
- var FoldMode = exports.FoldMode = function() {};
1003
-
1004
- (function() {
1005
-
1006
- this.foldingStartMarker = null;
1007
- this.foldingStopMarker = null;
1008
-
1009
- // must return "" if there's no fold, to enable caching
1010
- this.getFoldWidget = function(session, foldStyle, row) {
1011
- var line = session.getLine(row);
1012
- if (this.foldingStartMarker.test(line))
1013
- return "start";
1014
- if (foldStyle == "markbeginend"
1015
- && this.foldingStopMarker
1016
- && this.foldingStopMarker.test(line))
1017
- return "end";
1018
- return "";
1019
- };
1020
-
1021
- this.getFoldWidgetRange = function(session, foldStyle, row) {
1022
- return null;
1023
- };
1024
-
1025
- this.indentationBlock = function(session, row, column) {
1026
- var re = /^\s*/;
1027
- var startRow = row;
1028
- var endRow = row;
1029
- var line = session.getLine(row);
1030
- var startColumn = column || line.length;
1031
- var startLevel = line.match(re)[0].length;
1032
- var maxRow = session.getLength()
1033
-
1034
- while (++row < maxRow) {
1035
- line = session.getLine(row);
1036
- var level = line.match(re)[0].length;
1037
-
1038
- if (level == line.length)
1039
- continue;
1040
-
1041
- if (level <= startLevel)
1042
- break;
1043
-
1044
- endRow = row;
1045
- }
1046
-
1047
- if (endRow > startRow) {
1048
- var endColumn = session.getLine(endRow).length;
1049
- return new Range(startRow, startColumn, endRow, endColumn);
1050
- }
1051
- };
1052
-
1053
- this.openingBracketBlock = function(session, bracket, row, column) {
1054
- var start = {row: row, column: column + 1};
1055
- var end = session.$findClosingBracket(bracket, start);
1056
- if (!end)
1057
- return;
1058
-
1059
- var fw = session.foldWidgets[end.row];
1060
- if (fw == null)
1061
- fw = this.getFoldWidget(session, end.row);
1062
-
1063
- if (fw == "start") {
1064
- end.row --;
1065
- end.column = session.getLine(end.row).length;
1066
- }
1067
- return Range.fromPoints(start, end);
1068
- };
1069
-
1070
- }).call(FoldMode.prototype);
1071
-
1072
- });
1073
- /* ***** BEGIN LICENSE BLOCK *****
1074
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1075
- *
1076
- * The contents of this file are subject to the Mozilla Public License Version
1077
- * 1.1 (the "License"); you may not use this file except in compliance with
1078
- * the License. You may obtain a copy of the License at
1079
- * http://www.mozilla.org/MPL/
1080
- *
1081
- * Software distributed under the License is distributed on an "AS IS" basis,
1082
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1083
- * for the specific language governing rights and limitations under the
1084
- * License.
1085
- *
1086
- * The Original Code is Ajax.org Code Editor (ACE).
1087
- *
1088
- * The Initial Developer of the Original Code is
1089
- * Ajax.org B.V.
1090
- * Portions created by the Initial Developer are Copyright (C) 2010
1091
- * the Initial Developer. All Rights Reserved.
1092
- *
1093
- * Contributor(s):
1094
- * Fabian Jakobs <fabian AT ajax DOT org>
1095
- *
1096
- * Alternatively, the contents of this file may be used under the terms of
1097
- * either the GNU General Public License Version 2 or later (the "GPL"), or
1098
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1099
- * in which case the provisions of the GPL or the LGPL are applicable instead
1100
- * of those above. If you wish to allow use of your version of this file only
1101
- * under the terms of either the GPL or the LGPL, and not to allow others to
1102
- * use your version of this file under the terms of the MPL, indicate your
1103
- * decision by deleting the provisions above and replace them with the notice
1104
- * and other provisions required by the GPL or the LGPL. If you do not delete
1105
- * the provisions above, a recipient may use your version of this file under
1106
- * the terms of any one of the MPL, the GPL or the LGPL.
1107
- *
1108
- * ***** END LICENSE BLOCK ***** */
1109
-
1110
- ace.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) {
1111
- "use strict";
1112
-
1113
- var oop = require("../lib/oop");
1114
- var TextMode = require("./text").Mode;
1115
- var Tokenizer = require("../tokenizer").Tokenizer;
1116
- var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
1117
- var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
1118
- var Range = require("../range").Range;
1119
- var WorkerClient = require("../worker/worker_client").WorkerClient;
1120
- var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
1121
- var CStyleFoldMode = require("./folding/cstyle").FoldMode;
1122
-
1123
- var Mode = function() {
1124
- this.$tokenizer = new Tokenizer(new JavaScriptHighlightRules().getRules());
1125
- this.$outdent = new MatchingBraceOutdent();
1126
- this.$behaviour = new CstyleBehaviour();
1127
- this.foldingRules = new CStyleFoldMode();
1128
- };
1129
- oop.inherits(Mode, TextMode);
1130
-
1131
- (function() {
1132
-
1133
-
1134
- this.toggleCommentLines = function(state, doc, startRow, endRow) {
1135
- var outdent = true;
1136
- var re = /^(\s*)\/\//;
1137
-
1138
- for (var i=startRow; i<= endRow; i++) {
1139
- if (!re.test(doc.getLine(i))) {
1140
- outdent = false;
1141
- break;
1142
- }
1143
- }
1144
-
1145
- if (outdent) {
1146
- var deleteRange = new Range(0, 0, 0, 0);
1147
- for (var i=startRow; i<= endRow; i++)
1148
- {
1149
- var line = doc.getLine(i);
1150
- var m = line.match(re);
1151
- deleteRange.start.row = i;
1152
- deleteRange.end.row = i;
1153
- deleteRange.end.column = m[0].length;
1154
- doc.replace(deleteRange, m[1]);
1155
- }
1156
- }
1157
- else {
1158
- doc.indentRows(startRow, endRow, "//");
1159
- }
1160
- };
1161
-
1162
- this.getNextLineIndent = function(state, line, tab) {
1163
- var indent = this.$getIndent(line);
1164
-
1165
- var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
1166
- var tokens = tokenizedLine.tokens;
1167
- var endState = tokenizedLine.state;
1168
-
1169
- if (tokens.length && tokens[tokens.length-1].type == "comment") {
1170
- return indent;
1171
- }
1172
-
1173
- if (state == "start" || state == "regex_allowed") {
1174
- var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
1175
- if (match) {
1176
- indent += tab;
1177
- }
1178
- } else if (state == "doc-start") {
1179
- if (endState == "start" || state == "regex_allowed") {
1180
- return "";
1181
- }
1182
- var match = line.match(/^\s*(\/?)\*/);
1183
- if (match) {
1184
- if (match[1]) {
1185
- indent += " ";
1186
- }
1187
- indent += "* ";
1188
- }
1189
- }
1190
-
1191
- return indent;
1192
- };
1193
-
1194
- this.checkOutdent = function(state, line, input) {
1195
- return this.$outdent.checkOutdent(line, input);
1196
- };
1197
-
1198
- this.autoOutdent = function(state, doc, row) {
1199
- this.$outdent.autoOutdent(doc, row);
1200
- };
1201
-
1202
- this.createWorker = function(session) {
1203
- var worker = new WorkerClient(["ace"], "worker-javascript.js", "ace/mode/javascript_worker", "JavaScriptWorker");
1204
- worker.attachToDocument(session.getDocument());
1205
-
1206
- worker.on("jslint", function(results) {
1207
- var errors = [];
1208
- for (var i=0; i<results.data.length; i++) {
1209
- var error = results.data[i];
1210
- if (error)
1211
- errors.push({
1212
- row: error.line-1,
1213
- column: error.character-1,
1214
- text: error.reason,
1215
- type: "warning",
1216
- lint: error
1217
- });
1218
- }
1219
- session.setAnnotations(errors);
1220
- });
1221
-
1222
- worker.on("narcissus", function(e) {
1223
- session.setAnnotations([e.data]);
1224
- });
1225
-
1226
- worker.on("terminate", function() {
1227
- session.clearAnnotations();
1228
- });
1229
-
1230
- return worker;
1231
- };
1232
-
1233
- }).call(Mode.prototype);
1234
-
1235
- exports.Mode = Mode;
1236
- });
1237
- /* ***** BEGIN LICENSE BLOCK *****
1238
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1239
- *
1240
- * The contents of this file are subject to the Mozilla Public License Version
1241
- * 1.1 (the "License"); you may not use this file except in compliance with
1242
- * the License. You may obtain a copy of the License at
1243
- * http://www.mozilla.org/MPL/
1244
- *
1245
- * Software distributed under the License is distributed on an "AS IS" basis,
1246
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1247
- * for the specific language governing rights and limitations under the
1248
- * License.
1249
- *
1250
- * The Original Code is Ajax.org Code Editor (ACE).
1251
- *
1252
- * The Initial Developer of the Original Code is
1253
- * Ajax.org B.V.
1254
- * Portions created by the Initial Developer are Copyright (C) 2010
1255
- * the Initial Developer. All Rights Reserved.
1256
- *
1257
- * Contributor(s):
1258
- * Fabian Jakobs <fabian AT ajax DOT org>
1259
- * Mihai Sucan <mihai DOT sucan AT gmail DOT com>
1260
- *
1261
- * Alternatively, the contents of this file may be used under the terms of
1262
- * either the GNU General Public License Version 2 or later (the "GPL"), or
1263
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1264
- * in which case the provisions of the GPL or the LGPL are applicable instead
1265
- * of those above. If you wish to allow use of your version of this file only
1266
- * under the terms of either the GPL or the LGPL, and not to allow others to
1267
- * use your version of this file under the terms of the MPL, indicate your
1268
- * decision by deleting the provisions above and replace them with the notice
1269
- * and other provisions required by the GPL or the LGPL. If you do not delete
1270
- * the provisions above, a recipient may use your version of this file under
1271
- * the terms of any one of the MPL, the GPL or the LGPL.
1272
- *
1273
- * ***** END LICENSE BLOCK ***** */
1274
-
1275
- ace.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) {
1276
- "use strict";
1277
-
1278
- var oop = require("../lib/oop");
1279
- var lang = require("../lib/lang");
1280
- var unicode = require("../unicode");
1281
- var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
1282
- var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1283
-
1284
- var JavaScriptHighlightRules = function() {
1285
-
1286
- // see: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects
1287
- var globals = lang.arrayToMap(
1288
- // Constructors
1289
- ("Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" +
1290
- // E4X
1291
- "Namespace|QName|XML|XMLList|" +
1292
- "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
1293
- "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
1294
- // Errors
1295
- "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" +
1296
- "SyntaxError|TypeError|URIError|" +
1297
- // Non-constructor functions
1298
- "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" +
1299
- "isNaN|parseFloat|parseInt|" +
1300
- // Other
1301
- "JSON|Math|" +
1302
- // Pseudo
1303
- "this|arguments|prototype|window|document"
1304
- ).split("|")
1305
- );
1306
-
1307
- var keywords = lang.arrayToMap(
1308
- ("break|case|catch|continue|default|delete|do|else|finally|for|function|" +
1309
- "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|" +
1310
- "const|yield|import|get|set").split("|")
1311
- );
1312
-
1313
- // keywords which can be followed by regular expressions
1314
- var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield";
1315
-
1316
- var deprecated = lang.arrayToMap(
1317
- ("__parent__|__count__|escape|unescape|with|__proto__").split("|")
1318
- );
1319
-
1320
- var definitions = lang.arrayToMap(("const|let|var|function").split("|"));
1321
-
1322
- var buildinConstants = lang.arrayToMap(
1323
- ("null|Infinity|NaN|undefined").split("|")
1324
- );
1325
-
1326
- var futureReserved = lang.arrayToMap(
1327
- ("class|enum|extends|super|export|implements|private|" +
1328
- "public|interface|package|protected|static").split("|")
1329
- );
1330
-
1331
- // TODO: Unicode escape sequences
1332
- var identifierRe = "[" + unicode.packages.L + "\\$_]["
1333
- + unicode.packages.L
1334
- + unicode.packages.Mn + unicode.packages.Mc
1335
- + unicode.packages.Nd
1336
- + unicode.packages.Pc + "\\$_]*\\b";
1337
-
1338
- var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
1339
- "u[0-9a-fA-F]{4}|" + // unicode
1340
- "[0-2][0-7]{0,2}|" + // oct
1341
- "3[0-6][0-7]?|" + // oct
1342
- "37[0-7]?|" + // oct
1343
- "[4-7][0-7]?|" + //oct
1344
- ".)";
1345
-
1346
- // regexp must not have capturing parentheses. Use (?:) instead.
1347
- // regexps are ordered -> the first match is used
1348
-
1349
- this.$rules = {
1350
- "start" : [
1351
- {
1352
- token : "comment",
1353
- regex : "\\/\\/.*$"
1354
- },
1355
- new DocCommentHighlightRules().getStartRule("doc-start"),
1356
- {
1357
- token : "comment", // multi line comment
1358
- merge : true,
1359
- regex : "\\/\\*",
1360
- next : "comment"
1361
- }, {
1362
- token : "string",
1363
- regex : "'",
1364
- next : "qstring"
1365
- }, {
1366
- token : "string",
1367
- regex : '"',
1368
- next : "qqstring"
1369
- }, {
1370
- token : "constant.numeric", // hex
1371
- regex : "0[xX][0-9a-fA-F]+\\b"
1372
- }, {
1373
- token : "constant.numeric", // float
1374
- regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
1375
- }, { // match stuff like: Sound.prototype.play = function() { }
1376
- 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"],
1377
- regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)?(\\s*)(\\()(.*?)(\\))"
1378
- }, { // match stuff like: Sound.prototype.play = myfunc
1379
- token : ["storage.type", "punctuation.operator", "support.function", "punctuation.operator", "entity.name.function", "text", "keyword.operator", "text"],
1380
- regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
1381
- }, { // match stuff like: Sound.play = function() { }
1382
- token : ["storage.type", "punctuation.operator", "entity.name.function", "text", "keyword.operator", "text", "storage.type", "text", "paren.lparen", "variable.parameter", "paren.rparen"],
1383
- regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)?(\\s*)(\\()(.*?)(\\))"
1384
- }, { // match stuff like: play = function() { }
1385
- token : ["entity.name.function", "text", "keyword.operator", "text", "storage.type", "text", "paren.lparen", "variable.parameter", "paren.rparen"],
1386
- regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)?(\\s*)(\\()(.*?)(\\))"
1387
- }, { // match regular function like: function myFunc(arg) { }
1388
- token : ["storage.type", "text", "entity.name.function", "text", "paren.lparen", "variable.parameter", "paren.rparen"],
1389
- regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
1390
- }, { // match stuff like: foobar: function() { }
1391
- token : ["entity.name.function", "text", "punctuation.operator", "text", "storage.type", "text", "paren.lparen", "variable.parameter", "paren.rparen"],
1392
- regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)?(\\s*)(\\()(.*?)(\\))"
1393
- }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
1394
- token : ["text", "text", "storage.type", "text", "paren.lparen", "variable.parameter", "paren.rparen"],
1395
- regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
1396
- }, {
1397
- token : "constant.language.boolean",
1398
- regex : "(?:true|false)\\b"
1399
- }, {
1400
- token : "keyword",
1401
- regex : "(?:" + kwBeforeRe + ")\\b",
1402
- next : "regex_allowed"
1403
- }, {
1404
- token : "support.function",
1405
- 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(?=\\()"
1406
- }, {
1407
- token : "support.function.dom",
1408
- 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(?=\\()"
1409
- }, {
1410
- token : "support.function.constant",
1411
- 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"
1412
- }, {
1413
- token : ["punctuation.operator", "support.function.firebug"],
1414
- regex : "(\\.)(warn|info|log|error|time|timeEnd|assert)\\b"
1415
-
1416
- }, {
1417
- token : function(value) {
1418
- if (globals.hasOwnProperty(value))
1419
- return "variable.language";
1420
- else if (deprecated.hasOwnProperty(value))
1421
- return "invalid.deprecated";
1422
- else if (definitions.hasOwnProperty(value))
1423
- return "storage.type";
1424
- else if (keywords.hasOwnProperty(value))
1425
- return "keyword";
1426
- else if (buildinConstants.hasOwnProperty(value))
1427
- return "constant.language";
1428
- else if (futureReserved.hasOwnProperty(value))
1429
- return "invalid.illegal";
1430
- else if (value == "debugger")
1431
- return "invalid.deprecated";
1432
- else
1433
- return "identifier";
1434
- },
1435
- regex : identifierRe
1436
- }, {
1437
- token : "keyword.operator",
1438
- regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)",
1439
- next : "regex_allowed"
1440
- }, {
1441
- token : "punctuation.operator",
1442
- regex : "\\?|\\:|\\,|\\;|\\.",
1443
- next : "regex_allowed"
1444
- }, {
1445
- token : "paren.lparen",
1446
- regex : "[[({]",
1447
- next : "regex_allowed"
1448
- }, {
1449
- token : "paren.rparen",
1450
- regex : "[\\])}]"
1451
- }, {
1452
- token : "keyword.operator",
1453
- regex : "\\/=?",
1454
- next : "regex_allowed"
1455
- }, {
1456
- token: "comment",
1457
- regex: "^#!.*$"
1458
- }, {
1459
- token : "text",
1460
- regex : "\\s+"
1461
- }
1462
- ],
1463
- // regular expressions are only allowed after certain tokens. This
1464
- // makes sure we don't mix up regexps with the divison operator
1465
- "regex_allowed": [
1466
- {
1467
- token : "comment", // multi line comment
1468
- merge : true,
1469
- regex : "\\/\\*",
1470
- next : "comment_regex_allowed"
1471
- }, {
1472
- token : "comment",
1473
- regex : "\\/\\/.*$"
1474
- }, {
1475
- token: "string.regexp",
1476
- regex: "\\/",
1477
- next: "regex",
1478
- merge: true
1479
- }, {
1480
- token : "text",
1481
- regex : "\\s+"
1482
- }, {
1483
- // immediately return to the start mode without matching
1484
- // anything
1485
- token: "empty",
1486
- regex: "",
1487
- next: "start"
1488
- }
1489
- ],
1490
- "regex": [
1491
- {
1492
- token: "regexp.keyword.operator",
1493
- regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
1494
- next: "regex"
1495
- }, {
1496
- // flag
1497
- token: "string.regexp",
1498
- regex: "/\\w*",
1499
- next: "start",
1500
- merge: true
1501
- }, {
1502
- token: "string.regexp",
1503
- regex: "[^\\\\/\\[]+",
1504
- next: "regex",
1505
- merge: true
1506
- }, {
1507
- token: "string.regexp.charachterclass",
1508
- regex: "\\[",
1509
- next: "regex_character_class",
1510
- merge: true
1511
- }, {
1512
- token: "empty",
1513
- regex: "",
1514
- next: "start"
1515
- }
1516
- ],
1517
- "regex_character_class": [
1518
- {
1519
- token: "regexp.keyword.operator",
1520
- regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
1521
- next: "regex_character_class"
1522
- }, {
1523
- token: "string.regexp.charachterclass",
1524
- regex: "]",
1525
- next: "regex",
1526
- merge: true
1527
- }, {
1528
- token: "string.regexp.charachterclass",
1529
- regex: "[^\\\\\\]]+",
1530
- next: "regex_character_class",
1531
- merge: true
1532
- }, {
1533
- token: "empty",
1534
- regex: "",
1535
- next: "start"
1536
- }
1537
- ],
1538
- "comment_regex_allowed" : [
1539
- {
1540
- token : "comment", // closing comment
1541
- regex : ".*?\\*\\/",
1542
- merge : true,
1543
- next : "regex_allowed"
1544
- }, {
1545
- token : "comment", // comment spanning whole line
1546
- merge : true,
1547
- regex : ".+"
1548
- }
1549
- ],
1550
- "comment" : [
1551
- {
1552
- token : "comment", // closing comment
1553
- regex : ".*?\\*\\/",
1554
- merge : true,
1555
- next : "start"
1556
- }, {
1557
- token : "comment", // comment spanning whole line
1558
- merge : true,
1559
- regex : ".+"
1560
- }
1561
- ],
1562
- "qqstring" : [
1563
- {
1564
- token : "constant.language.escape",
1565
- regex : escapedRe
1566
- }, {
1567
- token : "string",
1568
- regex : '[^"\\\\]+'
1569
- }, {
1570
- token : "string",
1571
- regex : '"',
1572
- next : "start"
1573
- }
1574
- ],
1575
- "qstring" : [
1576
- {
1577
- token : "constant.language.escape",
1578
- regex : escapedRe
1579
- }, {
1580
- token : "string",
1581
- regex : "[^'\\\\]+"
1582
- }, {
1583
- token : "string",
1584
- regex : "'",
1585
- next : "start"
1586
- }
1587
- ]
1588
- };
1589
-
1590
- this.embedRules(DocCommentHighlightRules, "doc-",
1591
- [ new DocCommentHighlightRules().getEndRule("start") ]);
1592
- };
1593
-
1594
- oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
1595
-
1596
- exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
1597
- });
1598
- /* ***** BEGIN LICENSE BLOCK *****
1599
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1600
- *
1601
- * The contents of this file are subject to the Mozilla Public License Version
1602
- * 1.1 (the "License"); you may not use this file except in compliance with
1603
- * the License. You may obtain a copy of the License at
1604
- * http://www.mozilla.org/MPL/
1605
- *
1606
- * Software distributed under the License is distributed on an "AS IS" basis,
1607
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1608
- * for the specific language governing rights and limitations under the
1609
- * License.
1610
- *
1611
- * The Original Code is Ajax.org Code Editor (ACE).
1612
- *
1613
- * The Initial Developer of the Original Code is
1614
- * Ajax.org B.V.
1615
- * Portions created by the Initial Developer are Copyright (C) 2010
1616
- * the Initial Developer. All Rights Reserved.
1617
- *
1618
- * Contributor(s):
1619
- * Fabian Jakobs <fabian AT ajax DOT org>
1620
- *
1621
- * Alternatively, the contents of this file may be used under the terms of
1622
- * either the GNU General Public License Version 2 or later (the "GPL"), or
1623
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1624
- * in which case the provisions of the GPL or the LGPL are applicable instead
1625
- * of those above. If you wish to allow use of your version of this file only
1626
- * under the terms of either the GPL or the LGPL, and not to allow others to
1627
- * use your version of this file under the terms of the MPL, indicate your
1628
- * decision by deleting the provisions above and replace them with the notice
1629
- * and other provisions required by the GPL or the LGPL. If you do not delete
1630
- * the provisions above, a recipient may use your version of this file under
1631
- * the terms of any one of the MPL, the GPL or the LGPL.
1632
- *
1633
- * ***** END LICENSE BLOCK ***** */
1634
-
1635
- ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
1636
- "use strict";
1637
-
1638
- var oop = require("../lib/oop");
1639
- var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1640
-
1641
- var DocCommentHighlightRules = function() {
1642
-
1643
- this.$rules = {
1644
- "start" : [ {
1645
- token : "comment.doc.tag",
1646
- regex : "@[\\w\\d_]+" // TODO: fix email addresses
1647
- }, {
1648
- token : "comment.doc",
1649
- merge : true,
1650
- regex : "\\s+"
1651
- }, {
1652
- token : "comment.doc",
1653
- merge : true,
1654
- regex : "TODO"
1655
- }, {
1656
- token : "comment.doc",
1657
- merge : true,
1658
- regex : "[^@\\*]+"
1659
- }, {
1660
- token : "comment.doc",
1661
- merge : true,
1662
- regex : "."
1663
- }]
1664
- };
1665
- };
1666
-
1667
- oop.inherits(DocCommentHighlightRules, TextHighlightRules);
1668
-
1669
- (function() {
1670
-
1671
- this.getStartRule = function(start) {
1672
- return {
1673
- token : "comment.doc", // doc comment
1674
- merge : true,
1675
- regex : "\\/\\*(?=\\*)",
1676
- next : start
1677
- };
1678
- };
1679
-
1680
- this.getEndRule = function (start) {
1681
- return {
1682
- token : "comment.doc", // closing comment
1683
- merge : true,
1684
- regex : "\\*\\/",
1685
- next : start
1686
- };
1687
- };
1688
-
1689
- }).call(DocCommentHighlightRules.prototype);
1690
-
1691
- exports.DocCommentHighlightRules = DocCommentHighlightRules;
1692
-
1693
- });
1694
- /* ***** BEGIN LICENSE BLOCK *****
1695
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1696
- *
1697
- * The contents of this file are subject to the Mozilla Public License Version
1698
- * 1.1 (the "License"); you may not use this file except in compliance with
1699
- * the License. You may obtain a copy of the License at
1700
- * http://www.mozilla.org/MPL/
1701
- *
1702
- * Software distributed under the License is distributed on an "AS IS" basis,
1703
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1704
- * for the specific language governing rights and limitations under the
1705
- * License.
1706
- *
1707
- * The Original Code is Ajax.org Code Editor (ACE).
1708
- *
1709
- * The Initial Developer of the Original Code is
1710
- * Ajax.org B.V.
1711
- * Portions created by the Initial Developer are Copyright (C) 2010
1712
- * the Initial Developer. All Rights Reserved.
1713
- *
1714
- * Contributor(s):
1715
- * Fabian Jakobs <fabian AT ajax DOT org>
1716
- *
1717
- * Alternatively, the contents of this file may be used under the terms of
1718
- * either the GNU General Public License Version 2 or later (the "GPL"), or
1719
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1720
- * in which case the provisions of the GPL or the LGPL are applicable instead
1721
- * of those above. If you wish to allow use of your version of this file only
1722
- * under the terms of either the GPL or the LGPL, and not to allow others to
1723
- * use your version of this file under the terms of the MPL, indicate your
1724
- * decision by deleting the provisions above and replace them with the notice
1725
- * and other provisions required by the GPL or the LGPL. If you do not delete
1726
- * the provisions above, a recipient may use your version of this file under
1727
- * the terms of any one of the MPL, the GPL or the LGPL.
1728
- *
1729
- * ***** END LICENSE BLOCK ***** */
1730
-
1731
- ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
1732
- "use strict";
1733
-
1734
- var Range = require("../range").Range;
1735
-
1736
- var MatchingBraceOutdent = function() {};
1737
-
1738
- (function() {
1739
-
1740
- this.checkOutdent = function(line, input) {
1741
- if (! /^\s+$/.test(line))
1742
- return false;
1743
-
1744
- return /^\s*\}/.test(input);
1745
- };
1746
-
1747
- this.autoOutdent = function(doc, row) {
1748
- var line = doc.getLine(row);
1749
- var match = line.match(/^(\s*\})/);
1750
-
1751
- if (!match) return 0;
1752
-
1753
- var column = match[1].length;
1754
- var openBracePos = doc.findMatchingBracket({row: row, column: column});
1755
-
1756
- if (!openBracePos || openBracePos.row == row) return 0;
1757
-
1758
- var indent = this.$getIndent(doc.getLine(openBracePos.row));
1759
- doc.replace(new Range(row, 0, row, column-1), indent);
1760
- };
1761
-
1762
- this.$getIndent = function(line) {
1763
- var match = line.match(/^(\s+)/);
1764
- if (match) {
1765
- return match[1];
1766
- }
1767
-
1768
- return "";
1769
- };
1770
-
1771
- }).call(MatchingBraceOutdent.prototype);
1772
-
1773
- exports.MatchingBraceOutdent = MatchingBraceOutdent;
1774
- });
1775
- /* ***** BEGIN LICENSE BLOCK *****
1776
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1777
- *
1778
- * The contents of this file are subject to the Mozilla Public License Version
1779
- * 1.1 (the "License"); you may not use this file except in compliance with
1780
- * the License. You may obtain a copy of the License at
1781
- * http://www.mozilla.org/MPL/
1782
- *
1783
- * Software distributed under the License is distributed on an "AS IS" basis,
1784
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1785
- * for the specific language governing rights and limitations under the
1786
- * License.
1787
- *
1788
- * The Original Code is Ajax.org Code Editor (ACE).
1789
- *
1790
- * The Initial Developer of the Original Code is
1791
- * Ajax.org B.V.
1792
- * Portions created by the Initial Developer are Copyright (C) 2010
1793
- * the Initial Developer. All Rights Reserved.
1794
- *
1795
- * Contributor(s):
1796
- * Fabian Jakobs <fabian AT ajax DOT org>
1797
- *
1798
- * Alternatively, the contents of this file may be used under the terms of
1799
- * either the GNU General Public License Version 2 or later (the "GPL"), or
1800
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1801
- * in which case the provisions of the GPL or the LGPL are applicable instead
1802
- * of those above. If you wish to allow use of your version of this file only
1803
- * under the terms of either the GPL or the LGPL, and not to allow others to
1804
- * use your version of this file under the terms of the MPL, indicate your
1805
- * decision by deleting the provisions above and replace them with the notice
1806
- * and other provisions required by the GPL or the LGPL. If you do not delete
1807
- * the provisions above, a recipient may use your version of this file under
1808
- * the terms of any one of the MPL, the GPL or the LGPL.
1809
- *
1810
- * ***** END LICENSE BLOCK ***** */
1811
-
1812
- ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
1813
- "use strict";
1814
-
1815
- var oop = require("../../lib/oop");
1816
- var Range = require("../../range").Range;
1817
- var BaseFoldMode = require("./fold_mode").FoldMode;
1818
-
1819
- var FoldMode = exports.FoldMode = function() {};
1820
- oop.inherits(FoldMode, BaseFoldMode);
1821
-
1822
- (function() {
1823
-
1824
- this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
1825
- this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
1826
-
1827
- this.getFoldWidgetRange = function(session, foldStyle, row) {
1828
- var line = session.getLine(row);
1829
- var match = line.match(this.foldingStartMarker);
1830
- if (match) {
1831
- var i = match.index;
1832
-
1833
- if (match[1])
1834
- return this.openingBracketBlock(session, match[1], row, i);
1835
-
1836
- var range = session.getCommentFoldRange(row, i + match[0].length);
1837
- range.end.column -= 2;
1838
- return range;
1839
- }
1840
-
1841
- if (foldStyle !== "markbeginend")
1842
- return;
1843
-
1844
- var match = line.match(this.foldingStopMarker);
1845
- if (match) {
1846
- var i = match.index + match[0].length;
1847
-
1848
- if (match[2]) {
1849
- var range = session.getCommentFoldRange(row, i);
1850
- range.end.column -= 2;
1851
- return range;
1852
- }
1853
-
1854
- var end = {row: row, column: i};
1855
- var start = session.$findOpeningBracket(match[1], end);
1856
-
1857
- if (!start)
1858
- return;
1859
-
1860
- start.column++;
1861
- end.column--;
1862
-
1863
- return Range.fromPoints(start, end);
1864
- }
1865
- };
1866
-
1867
- }).call(FoldMode.prototype);
1868
-
1869
- });/* ***** BEGIN LICENSE BLOCK *****
1870
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1871
- *
1872
- * The contents of this file are subject to the Mozilla Public License Version
1873
- * 1.1 (the "License"); you may not use this file except in compliance with
1874
- * the License. You may obtain a copy of the License at
1875
- * http://www.mozilla.org/MPL/
1876
- *
1877
- * Software distributed under the License is distributed on an "AS IS" basis,
1878
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1879
- * for the specific language governing rights and limitations under the
1880
- * License.
1881
- *
1882
- * The Original Code is Ajax.org Code Editor (ACE).
1883
- *
1884
- * The Initial Developer of the Original Code is
1885
- * Ajax.org B.V.
1886
- * Portions created by the Initial Developer are Copyright (C) 2010
1887
- * the Initial Developer. All Rights Reserved.
1888
- *
1889
- * Contributor(s):
1890
- * Fabian Jakobs <fabian AT ajax DOT org>
1891
- *
1892
- * Alternatively, the contents of this file may be used under the terms of
1893
- * either the GNU General Public License Version 2 or later (the "GPL"), or
1894
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1895
- * in which case the provisions of the GPL or the LGPL are applicable instead
1896
- * of those above. If you wish to allow use of your version of this file only
1897
- * under the terms of either the GPL or the LGPL, and not to allow others to
1898
- * use your version of this file under the terms of the MPL, indicate your
1899
- * decision by deleting the provisions above and replace them with the notice
1900
- * and other provisions required by the GPL or the LGPL. If you do not delete
1901
- * the provisions above, a recipient may use your version of this file under
1902
- * the terms of any one of the MPL, the GPL or the LGPL.
1903
- *
1904
- * ***** END LICENSE BLOCK ***** */
1905
-
1906
- 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) {
1907
- "use strict";
1908
-
1909
- var oop = require("../lib/oop");
1910
- var TextMode = require("./text").Mode;
1911
- var Tokenizer = require("../tokenizer").Tokenizer;
1912
- var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
1913
- var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
1914
- var WorkerClient = require("../worker/worker_client").WorkerClient;
1915
- var CStyleFoldMode = require("./folding/cstyle").FoldMode;
1916
-
1917
- var Mode = function() {
1918
- this.$tokenizer = new Tokenizer(new CssHighlightRules().getRules(), "i");
1919
- this.$outdent = new MatchingBraceOutdent();
1920
- this.foldingRules = new CStyleFoldMode();
1921
- };
1922
- oop.inherits(Mode, TextMode);
1923
-
1924
- (function() {
1925
-
1926
- this.foldingRules = "cStyle";
1927
-
1928
- this.getNextLineIndent = function(state, line, tab) {
1929
- var indent = this.$getIndent(line);
1930
-
1931
- // ignore braces in comments
1932
- var tokens = this.$tokenizer.getLineTokens(line, state).tokens;
1933
- if (tokens.length && tokens[tokens.length-1].type == "comment") {
1934
- return indent;
1935
- }
1936
-
1937
- var match = line.match(/^.*\{\s*$/);
1938
- if (match) {
1939
- indent += tab;
1940
- }
1941
-
1942
- return indent;
1943
- };
1944
-
1945
- this.checkOutdent = function(state, line, input) {
1946
- return this.$outdent.checkOutdent(line, input);
1947
- };
1948
-
1949
- this.autoOutdent = function(state, doc, row) {
1950
- this.$outdent.autoOutdent(doc, row);
1951
- };
1952
-
1953
- this.createWorker = function(session) {
1954
- var worker = new WorkerClient(["ace"], "worker-css.js", "ace/mode/css_worker", "Worker");
1955
- worker.attachToDocument(session.getDocument());
1956
-
1957
- worker.on("csslint", function(e) {
1958
- var errors = [];
1959
- e.data.forEach(function(message) {
1960
- errors.push({
1961
- row: message.line - 1,
1962
- column: message.col - 1,
1963
- text: message.message,
1964
- type: message.type,
1965
- lint: message
1966
- });
1967
- });
1968
-
1969
- session.setAnnotations(errors);
1970
- });
1971
- return worker;
1972
- };
1973
-
1974
- }).call(Mode.prototype);
1975
-
1976
- exports.Mode = Mode;
1977
-
1978
- });
1979
- /* ***** BEGIN LICENSE BLOCK *****
1980
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1981
- *
1982
- * The contents of this file are subject to the Mozilla Public License Version
1983
- * 1.1 (the "License"); you may not use this file except in compliance with
1984
- * the License. You may obtain a copy of the License at
1985
- * http://www.mozilla.org/MPL/
1986
- *
1987
- * Software distributed under the License is distributed on an "AS IS" basis,
1988
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1989
- * for the specific language governing rights and limitations under the
1990
- * License.
1991
- *
1992
- * The Original Code is Ajax.org Code Editor (ACE).
1993
- *
1994
- * The Initial Developer of the Original Code is
1995
- * Ajax.org B.V.
1996
- * Portions created by the Initial Developer are Copyright (C) 2010
1997
- * the Initial Developer. All Rights Reserved.
1998
- *
1999
- * Contributor(s):
2000
- * Fabian Jakobs <fabian AT ajax DOT org>
2001
- *
2002
- * Alternatively, the contents of this file may be used under the terms of
2003
- * either the GNU General Public License Version 2 or later (the "GPL"), or
2004
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
2005
- * in which case the provisions of the GPL or the LGPL are applicable instead
2006
- * of those above. If you wish to allow use of your version of this file only
2007
- * under the terms of either the GPL or the LGPL, and not to allow others to
2008
- * use your version of this file under the terms of the MPL, indicate your
2009
- * decision by deleting the provisions above and replace them with the notice
2010
- * and other provisions required by the GPL or the LGPL. If you do not delete
2011
- * the provisions above, a recipient may use your version of this file under
2012
- * the terms of any one of the MPL, the GPL or the LGPL.
2013
- *
2014
- * ***** END LICENSE BLOCK ***** */
2015
-
2016
- 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) {
2017
- "use strict";
2018
-
2019
- var oop = require("../lib/oop");
2020
- var lang = require("../lib/lang");
2021
- var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
2022
-
2023
- var CssHighlightRules = function() {
2024
-
2025
- var properties = lang.arrayToMap(
2026
- ("-moz-appearance|-moz-box-sizing|-webkit-box-sizing|-moz-outline-radius|-moz-transform|-webkit-transform|" +
2027
- "appearance|azimuth|background-attachment|background-color|background-image|" +
2028
- "background-origin|background-position|background-repeat|background|border-bottom-color|" +
2029
- "border-bottom-style|border-bottom-width|border-bottom|border-collapse|" +
2030
- "border-color|border-left-color|border-left-style|border-left-width|" +
2031
- "border-left|border-right-color|border-right-style|border-right-width|" +
2032
- "border-right|border-spacing|border-style|border-top-color|" +
2033
- "border-top-style|border-top-width|border-top|border-width|border|" +
2034
- "bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|" +
2035
- "counter-reset|cue-after|cue-before|cue|cursor|direction|display|" +
2036
- "elevation|empty-cells|float|font-family|font-size-adjust|font-size|" +
2037
- "font-stretch|font-style|font-variant|font-weight|font|height|left|" +
2038
- "letter-spacing|line-height|list-style-image|list-style-position|" +
2039
- "list-style-type|list-style|margin-bottom|margin-left|margin-right|" +
2040
- "margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" +
2041
- "min-width|-moz-border-radius|opacity|orphans|outline-color|outline-offset|outline-radius|" +
2042
- "outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" +
2043
- "padding-left|padding-right|padding-top|padding|page-break-after|" +
2044
- "page-break-before|page-break-inside|page|pause-after|pause-before|" +
2045
- "pause|pitch-range|pitch|play-during|pointer-events|position|quotes|resize|richness|right|" +
2046
- "size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" +
2047
- "stress|table-layout|text-align|text-decoration|text-indent|" +
2048
- "text-shadow|text-transform|top|transform|unicode-bidi|vertical-align|" +
2049
- "visibility|voice-family|volume|white-space|widows|width|word-spacing|" +
2050
- "z-index").split("|")
2051
- );
2052
-
2053
- var functions = lang.arrayToMap(
2054
- ("rgb|rgba|url|attr|counter|counters").split("|")
2055
- );
2056
-
2057
- var constants = lang.arrayToMap(
2058
- ("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" +
2059
- "block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" +
2060
- "char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" +
2061
- "decimal-leading-zero|decimal|default|disabled|disc|" +
2062
- "distribute-all-lines|distribute-letter|distribute-space|" +
2063
- "distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" +
2064
- "hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" +
2065
- "ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" +
2066
- "ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" +
2067
- "inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" +
2068
- "keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" +
2069
- "lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" +
2070
- "medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" +
2071
- "nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" +
2072
- "overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" +
2073
- "ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" +
2074
- "solid|square|static|strict|super|sw-resize|table-footer-group|" +
2075
- "table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" +
2076
- "transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" +
2077
- "vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" +
2078
- "zero").split("|")
2079
- );
2080
-
2081
- var colors = lang.arrayToMap(
2082
- ("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|" +
2083
- "purple|red|silver|teal|white|yellow").split("|")
2084
- );
2085
-
2086
- var fonts = lang.arrayToMap(
2087
- ("arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|" +
2088
- "symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|" +
2089
- "serif|monospace").split("|")
2090
- );
2091
-
2092
- // regexp must not have capturing parentheses. Use (?:) instead.
2093
- // regexps are ordered -> the first match is used
2094
-
2095
- var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
2096
-
2097
- var base_ruleset = [
2098
- {
2099
- token : "comment", // multi line comment
2100
- merge : true,
2101
- regex : "\\/\\*",
2102
- next : "ruleset_comment"
2103
- },{
2104
- token : "string", // single line
2105
- regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
2106
- }, {
2107
- token : "string", // single line
2108
- regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
2109
- }, {
2110
- token : ["constant.numeric", "keyword"],
2111
- regex : "(" + numRe + ")(em|ex|px|ch|cm|mm|in|pt|pc|deg|rad|dpi|grad|ms|s|hz|khz|%)"
2112
- }, {
2113
- token : ["constant.numeric"],
2114
- regex : "([0-9]+)"
2115
- }, {
2116
- token : "constant.numeric", // hex6 color
2117
- regex : "#[a-f0-9]{6}"
2118
- }, {
2119
- token : "constant.numeric", // hex3 color
2120
- regex : "#[a-f0-9]{3}"
2121
- }, {
2122
- token : function(value) {
2123
- if (properties.hasOwnProperty(value.toLowerCase())) {
2124
- return "support.type";
2125
- }
2126
- else if (functions.hasOwnProperty(value.toLowerCase())) {
2127
- return "support.function";
2128
- }
2129
- else if (constants.hasOwnProperty(value.toLowerCase())) {
2130
- return "support.constant";
2131
- }
2132
- else if (colors.hasOwnProperty(value.toLowerCase())) {
2133
- return "support.constant.color";
2134
- }
2135
- else if (fonts.hasOwnProperty(value.toLowerCase())) {
2136
- return "support.constant.fonts";
2137
- }
2138
- else {
2139
- return "text";
2140
- }
2141
- },
2142
- regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
2143
- }
2144
- ];
2145
-
2146
- var ruleset = lang.copyArray(base_ruleset);
2147
- ruleset.unshift({
2148
- token : "paren.rparen",
2149
- regex : "\\}",
2150
- next: "start"
2151
- });
2152
-
2153
- var media_ruleset = lang.copyArray( base_ruleset );
2154
- media_ruleset.unshift({
2155
- token : "paren.rparen",
2156
- regex : "\\}",
2157
- next: "media"
2158
- });
2159
-
2160
- var base_comment = [{
2161
- token : "comment", // comment spanning whole line
2162
- merge : true,
2163
- regex : ".+"
2164
- }];
2165
-
2166
- var comment = lang.copyArray(base_comment);
2167
- comment.unshift({
2168
- token : "comment", // closing comment
2169
- regex : ".*?\\*\\/",
2170
- next : "start"
2171
- });
2172
-
2173
- var media_comment = lang.copyArray(base_comment);
2174
- media_comment.unshift({
2175
- token : "comment", // closing comment
2176
- regex : ".*?\\*\\/",
2177
- next : "media"
2178
- });
2179
-
2180
- var ruleset_comment = lang.copyArray(base_comment);
2181
- ruleset_comment.unshift({
2182
- token : "comment", // closing comment
2183
- regex : ".*?\\*\\/",
2184
- next : "ruleset"
2185
- });
2186
-
2187
- this.$rules = {
2188
- "start" : [{
2189
- token : "comment", // multi line comment
2190
- merge : true,
2191
- regex : "\\/\\*",
2192
- next : "comment"
2193
- }, {
2194
- token: "paren.lparen",
2195
- regex: "\\{",
2196
- next: "ruleset"
2197
- }, {
2198
- token: "string",
2199
- regex: "@.*?{",
2200
- next: "media"
2201
- },{
2202
- token: "keyword",
2203
- regex: "#[a-z0-9-_]+"
2204
- },{
2205
- token: "variable",
2206
- regex: "\\.[a-z0-9-_]+"
2207
- },{
2208
- token: "string",
2209
- regex: ":[a-z0-9-_]+"
2210
- },{
2211
- token: "constant",
2212
- regex: "[a-z0-9-_]+"
2213
- }],
2214
-
2215
- "media" : [ {
2216
- token : "comment", // multi line comment
2217
- merge : true,
2218
- regex : "\\/\\*",
2219
- next : "media_comment"
2220
- }, {
2221
- token: "paren.lparen",
2222
- regex: "\\{",
2223
- next: "media_ruleset"
2224
- },{
2225
- token: "string",
2226
- regex: "\\}",
2227
- next: "start"
2228
- },{
2229
- token: "keyword",
2230
- regex: "#[a-z0-9-_]+"
2231
- },{
2232
- token: "variable",
2233
- regex: "\\.[a-z0-9-_]+"
2234
- },{
2235
- token: "string",
2236
- regex: ":[a-z0-9-_]+"
2237
- },{
2238
- token: "constant",
2239
- regex: "[a-z0-9-_]+"
2240
- }],
2241
-
2242
- "comment" : comment,
2243
-
2244
- "ruleset" : ruleset,
2245
- "ruleset_comment" : ruleset_comment,
2246
-
2247
- "media_ruleset" : media_ruleset,
2248
- "media_comment" : media_comment
2249
- };
2250
- };
2251
-
2252
- oop.inherits(CssHighlightRules, TextHighlightRules);
2253
-
2254
- exports.CssHighlightRules = CssHighlightRules;
2255
-
2256
- });
2257
- /* ***** BEGIN LICENSE BLOCK *****
2258
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
2259
- *
2260
- * The contents of this file are subject to the Mozilla Public License Version
2261
- * 1.1 (the "License"); you may not use this file except in compliance with
2262
- * the License. You may obtain a copy of the License at
2263
- * http://www.mozilla.org/MPL/
2264
- *
2265
- * Software distributed under the License is distributed on an "AS IS" basis,
2266
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
2267
- * for the specific language governing rights and limitations under the
2268
- * License.
2269
- *
2270
- * The Original Code is Ajax.org Code Editor (ACE).
2271
- *
2272
- * The Initial Developer of the Original Code is
2273
- * Ajax.org B.V.
2274
- * Portions created by the Initial Developer are Copyright (C) 2010
2275
- * the Initial Developer. All Rights Reserved.
2276
- *
2277
- * Contributor(s):
2278
- * Fabian Jakobs <fabian AT ajax DOT org>
2279
- *
2280
- * Alternatively, the contents of this file may be used under the terms of
2281
- * either the GNU General Public License Version 2 or later (the "GPL"), or
2282
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
2283
- * in which case the provisions of the GPL or the LGPL are applicable instead
2284
- * of those above. If you wish to allow use of your version of this file only
2285
- * under the terms of either the GPL or the LGPL, and not to allow others to
2286
- * use your version of this file under the terms of the MPL, indicate your
2287
- * decision by deleting the provisions above and replace them with the notice
2288
- * and other provisions required by the GPL or the LGPL. If you do not delete
2289
- * the provisions above, a recipient may use your version of this file under
2290
- * the terms of any one of the MPL, the GPL or the LGPL.
2291
- *
2292
- * ***** END LICENSE BLOCK ***** */
2293
-
2294
- ace.define('ace/mode/coldfusion_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/css_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/text_highlight_rules', 'ace/mode/xml_util'], function(require, exports, module) {
2295
- "use strict";
2296
-
2297
- var oop = require("../lib/oop");
2298
- var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
2299
- var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
2300
- var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
2301
- var xml_util = require("./xml_util");
2302
-
2303
- var ColdfusionHighlightRules = function() {
2304
-
2305
- // regexp must not have capturing parentheses
2306
- // regexps are ordered -> the first match is used
2307
-
2308
- this.$rules = {
2309
- start : [ {
2310
- token : "text",
2311
- merge : true,
2312
- regex : "<\\!\\[CDATA\\[",
2313
- next : "cdata"
2314
- }, {
2315
- token : "xml_pe",
2316
- regex : "<\\?.*?\\?>"
2317
- }, {
2318
- token : "comment",
2319
- merge : true,
2320
- regex : "<\\!--",
2321
- next : "comment"
2322
- }, {
2323
- token : "meta.tag",
2324
- regex : "<(?=\s*script)",
2325
- next : "script"
2326
- }, {
2327
- token : "meta.tag",
2328
- regex : "<(?=\s*style)",
2329
- next : "style"
2330
- }, {
2331
- token : "meta.tag", // opening tag
2332
- regex : "<\\/?",
2333
- next : "tag"
2334
- }, {
2335
- token : "text",
2336
- regex : "\\s+"
2337
- }, {
2338
- token : "text",
2339
- regex : "[^<]+"
2340
- } ],
2341
-
2342
- cdata : [ {
2343
- token : "text",
2344
- regex : "\\]\\]>",
2345
- next : "start"
2346
- }, {
2347
- token : "text",
2348
- merge : true,
2349
- regex : "\\s+"
2350
- }, {
2351
- token : "text",
2352
- merge : true,
2353
- regex : ".+"
2354
- } ],
2355
-
2356
- comment : [ {
2357
- token : "comment",
2358
- regex : ".*?-->",
2359
- next : "start"
2360
- }, {
2361
- token : "comment",
2362
- merge : true,
2363
- regex : ".+"
2364
- } ]
2365
- };
2366
-
2367
- xml_util.tag(this.$rules, "tag", "start");
2368
- xml_util.tag(this.$rules, "style", "css-start");
2369
- xml_util.tag(this.$rules, "script", "js-start");
2370
-
2371
- this.embedRules(JavaScriptHighlightRules, "js-", [{
2372
- token: "comment",
2373
- regex: "\\/\\/.*(?=<\\/script>)",
2374
- next: "tag"
2375
- }, {
2376
- token: "meta.tag",
2377
- regex: "<\\/(?=script)",
2378
- next: "tag"
2379
- }]);
2380
-
2381
- this.embedRules(CssHighlightRules, "css-", [{
2382
- token: "meta.tag",
2383
- regex: "<\\/(?=style)",
2384
- next: "tag"
2385
- }]);
2386
- };
2387
-
2388
- oop.inherits(ColdfusionHighlightRules, TextHighlightRules);
2389
-
2390
- exports.ColdfusionHighlightRules = ColdfusionHighlightRules;
2391
- });