aced_rails 0.0.1

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