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