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