ace-rails-ap 0.0.3 → 1.0.0

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