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