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,1001 @@
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/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) {
39
+ "use strict";
40
+
41
+ var oop = require("../lib/oop");
42
+ var TextMode = require("./text").Mode;
43
+ var Tokenizer = require("../tokenizer").Tokenizer;
44
+ var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
45
+ var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
46
+ var XmlFoldMode = require("./folding/xml").FoldMode;
47
+
48
+ var Mode = function() {
49
+ this.$tokenizer = new Tokenizer(new XmlHighlightRules().getRules());
50
+ this.$behaviour = new XmlBehaviour();
51
+ this.foldingRules = new XmlFoldMode();
52
+ };
53
+
54
+ oop.inherits(Mode, TextMode);
55
+
56
+ (function() {
57
+
58
+ this.getNextLineIndent = function(state, line, tab) {
59
+ return this.$getIndent(line);
60
+ };
61
+
62
+ }).call(Mode.prototype);
63
+
64
+ exports.Mode = Mode;
65
+ });
66
+ /* ***** BEGIN LICENSE BLOCK *****
67
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
68
+ *
69
+ * The contents of this file are subject to the Mozilla Public License Version
70
+ * 1.1 (the "License"); you may not use this file except in compliance with
71
+ * the License. You may obtain a copy of the License at
72
+ * http://www.mozilla.org/MPL/
73
+ *
74
+ * Software distributed under the License is distributed on an "AS IS" basis,
75
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
76
+ * for the specific language governing rights and limitations under the
77
+ * License.
78
+ *
79
+ * The Original Code is Ajax.org Code Editor (ACE).
80
+ *
81
+ * The Initial Developer of the Original Code is
82
+ * Ajax.org B.V.
83
+ * Portions created by the Initial Developer are Copyright (C) 2010
84
+ * the Initial Developer. All Rights Reserved.
85
+ *
86
+ * Contributor(s):
87
+ * Fabian Jakobs <fabian AT ajax DOT org>
88
+ *
89
+ * Alternatively, the contents of this file may be used under the terms of
90
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
91
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
92
+ * in which case the provisions of the GPL or the LGPL are applicable instead
93
+ * of those above. If you wish to allow use of your version of this file only
94
+ * under the terms of either the GPL or the LGPL, and not to allow others to
95
+ * use your version of this file under the terms of the MPL, indicate your
96
+ * decision by deleting the provisions above and replace them with the notice
97
+ * and other provisions required by the GPL or the LGPL. If you do not delete
98
+ * the provisions above, a recipient may use your version of this file under
99
+ * the terms of any one of the MPL, the GPL or the LGPL.
100
+ *
101
+ * ***** END LICENSE BLOCK ***** */
102
+
103
+ 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) {
104
+ "use strict";
105
+
106
+ var oop = require("../lib/oop");
107
+ var xmlUtil = require("./xml_util");
108
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
109
+
110
+ var XmlHighlightRules = function() {
111
+
112
+ // regexp must not have capturing parentheses
113
+ // regexps are ordered -> the first match is used
114
+ this.$rules = {
115
+ start : [{
116
+ token : "text",
117
+ regex : "<\\!\\[CDATA\\[",
118
+ next : "cdata"
119
+ }, {
120
+ token : "xml_pe",
121
+ regex : "<\\?.*?\\?>"
122
+ }, {
123
+ token : "comment",
124
+ merge : true,
125
+ regex : "<\\!--",
126
+ next : "comment"
127
+ }, {
128
+ token : "meta.tag", // opening tag
129
+ regex : "<\\/?",
130
+ next : "tag"
131
+ }, {
132
+ token : "text",
133
+ regex : "\\s+"
134
+ }, {
135
+ token : "text",
136
+ regex : "[^<]+"
137
+ }],
138
+
139
+ cdata : [{
140
+ token : "text",
141
+ regex : "\\]\\]>",
142
+ next : "start"
143
+ }, {
144
+ token : "text",
145
+ regex : "\\s+"
146
+ }, {
147
+ token : "text",
148
+ regex : "(?:[^\\]]|\\](?!\\]>))+"
149
+ }],
150
+
151
+ comment : [{
152
+ token : "comment",
153
+ regex : ".*?-->",
154
+ next : "start"
155
+ }, {
156
+ token : "comment",
157
+ merge : true,
158
+ regex : ".+"
159
+ }]
160
+ };
161
+
162
+ xmlUtil.tag(this.$rules, "tag", "start");
163
+ };
164
+
165
+ oop.inherits(XmlHighlightRules, TextHighlightRules);
166
+
167
+ exports.XmlHighlightRules = XmlHighlightRules;
168
+ });
169
+ /* ***** BEGIN LICENSE BLOCK *****
170
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
171
+ *
172
+ * The contents of this file are subject to the Mozilla Public License Version
173
+ * 1.1 (the "License"); you may not use this file except in compliance with
174
+ * the License. You may obtain a copy of the License at
175
+ * http://www.mozilla.org/MPL/
176
+ *
177
+ * Software distributed under the License is distributed on an "AS IS" basis,
178
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
179
+ * for the specific language governing rights and limitations under the
180
+ * License.
181
+ *
182
+ * The Original Code is Ajax.org Code Editor (ACE).
183
+ *
184
+ * The Initial Developer of the Original Code is
185
+ * Ajax.org B.V.
186
+ * Portions created by the Initial Developer are Copyright (C) 2010
187
+ * the Initial Developer. All Rights Reserved.
188
+ *
189
+ * Contributor(s):
190
+ * Fabian Jakobs <fabian AT ajax DOT org>
191
+ *
192
+ * Alternatively, the contents of this file may be used under the terms of
193
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
194
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
195
+ * in which case the provisions of the GPL or the LGPL are applicable instead
196
+ * of those above. If you wish to allow use of your version of this file only
197
+ * under the terms of either the GPL or the LGPL, and not to allow others to
198
+ * use your version of this file under the terms of the MPL, indicate your
199
+ * decision by deleting the provisions above and replace them with the notice
200
+ * and other provisions required by the GPL or the LGPL. If you do not delete
201
+ * the provisions above, a recipient may use your version of this file under
202
+ * the terms of any one of the MPL, the GPL or the LGPL.
203
+ *
204
+ * ***** END LICENSE BLOCK ***** */
205
+
206
+ define('ace/mode/xml_util', ['require', 'exports', 'module' , 'ace/lib/lang'], function(require, exports, module) {
207
+ "use strict";
208
+
209
+ var lang = require("../lib/lang");
210
+
211
+ var formTags = lang.arrayToMap(
212
+ ("button|form|input|label|select|textarea").split("|")
213
+ );
214
+
215
+ var tableTags = lang.arrayToMap(
216
+ ("table|tbody|td|tfoot|th|tr").split("|")
217
+ );
218
+
219
+ function string(state) {
220
+ return [{
221
+ token : "string",
222
+ regex : '".*?"'
223
+ }, {
224
+ token : "string", // multi line string start
225
+ merge : true,
226
+ regex : '["].*',
227
+ next : state + "_qqstring"
228
+ }, {
229
+ token : "string",
230
+ regex : "'.*?'"
231
+ }, {
232
+ token : "string", // multi line string start
233
+ merge : true,
234
+ regex : "['].*",
235
+ next : state + "_qstring"
236
+ }];
237
+ }
238
+
239
+ function multiLineString(quote, state) {
240
+ return [{
241
+ token : "string",
242
+ merge : true,
243
+ regex : ".*?" + quote,
244
+ next : state
245
+ }, {
246
+ token : "string",
247
+ merge : true,
248
+ regex : '.+'
249
+ }];
250
+ }
251
+
252
+ exports.tag = function(states, name, nextState) {
253
+ states[name] = [{
254
+ token : "text",
255
+ regex : "\\s+"
256
+ }, {
257
+ //token : "meta.tag",
258
+
259
+ token : function(value) {
260
+ if ( value==='a' ) {
261
+ return "meta.tag.anchor";
262
+ }
263
+ else if ( value==='img' ) {
264
+ return "meta.tag.image";
265
+ }
266
+ else if ( value==='script' ) {
267
+ return "meta.tag.script";
268
+ }
269
+ else if ( value==='style' ) {
270
+ return "meta.tag.style";
271
+ }
272
+ else if (formTags.hasOwnProperty(value.toLowerCase())) {
273
+ return "meta.tag.form";
274
+ }
275
+ else if (tableTags.hasOwnProperty(value.toLowerCase())) {
276
+ return "meta.tag.table";
277
+ }
278
+ else {
279
+ return "meta.tag";
280
+ }
281
+ },
282
+ merge : true,
283
+ regex : "[-_a-zA-Z0-9:!]+",
284
+ next : name + "_embed_attribute_list"
285
+ }, {
286
+ token: "empty",
287
+ regex: "",
288
+ next : name + "_embed_attribute_list"
289
+ }];
290
+
291
+ states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list");
292
+ states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list");
293
+
294
+ states[name + "_embed_attribute_list"] = [{
295
+ token : "meta.tag",
296
+ merge : true,
297
+ regex : "\/?>",
298
+ next : nextState
299
+ }, {
300
+ token : "keyword.operator",
301
+ regex : "="
302
+ }, {
303
+ token : "entity.other.attribute-name",
304
+ regex : "[-_a-zA-Z0-9:]+"
305
+ }, {
306
+ token : "constant.numeric", // float
307
+ regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
308
+ }, {
309
+ token : "text",
310
+ regex : "\\s+"
311
+ }].concat(string(name));
312
+ };
313
+
314
+ });
315
+ /* vim:ts=4:sts=4:sw=4:
316
+ * ***** BEGIN LICENSE BLOCK *****
317
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
318
+ *
319
+ * The contents of this file are subject to the Mozilla Public License Version
320
+ * 1.1 (the "License"); you may not use this file except in compliance with
321
+ * the License. You may obtain a copy of the License at
322
+ * http://www.mozilla.org/MPL/
323
+ *
324
+ * Software distributed under the License is distributed on an "AS IS" basis,
325
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
326
+ * for the specific language governing rights and limitations under the
327
+ * License.
328
+ *
329
+ * The Original Code is Ajax.org Code Editor (ACE).
330
+ *
331
+ * The Initial Developer of the Original Code is
332
+ * Ajax.org B.V.
333
+ * Portions created by the Initial Developer are Copyright (C) 2010
334
+ * the Initial Developer. All Rights Reserved.
335
+ *
336
+ * Contributor(s):
337
+ * Chris Spencer <chris.ag.spencer AT googlemail DOT com>
338
+ *
339
+ * Alternatively, the contents of this file may be used under the terms of
340
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
341
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
342
+ * in which case the provisions of the GPL or the LGPL are applicable instead
343
+ * of those above. If you wish to allow use of your version of this file only
344
+ * under the terms of either the GPL or the LGPL, and not to allow others to
345
+ * use your version of this file under the terms of the MPL, indicate your
346
+ * decision by deleting the provisions above and replace them with the notice
347
+ * and other provisions required by the GPL or the LGPL. If you do not delete
348
+ * the provisions above, a recipient may use your version of this file under
349
+ * the terms of any one of the MPL, the GPL or the LGPL.
350
+ *
351
+ * ***** END LICENSE BLOCK ***** */
352
+
353
+ define('ace/mode/behaviour/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle'], function(require, exports, module) {
354
+ "use strict";
355
+
356
+ var oop = require("../../lib/oop");
357
+ var Behaviour = require("../behaviour").Behaviour;
358
+ var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
359
+
360
+ var XmlBehaviour = function () {
361
+
362
+ this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour
363
+
364
+ this.add("brackets", "insertion", function (state, action, editor, session, text) {
365
+ if (text == '<') {
366
+ var selection = editor.getSelectionRange();
367
+ var selected = session.doc.getTextRange(selection);
368
+ if (selected !== "") {
369
+ return false;
370
+ } else {
371
+ return {
372
+ text: '<>',
373
+ selection: [1, 1]
374
+ }
375
+ }
376
+ } else if (text == '>') {
377
+ var cursor = editor.getCursorPosition();
378
+ var line = session.doc.getLine(cursor.row);
379
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
380
+ if (rightChar == '>') { // need some kind of matching check here
381
+ return {
382
+ text: '',
383
+ selection: [1, 1]
384
+ }
385
+ }
386
+ } else if (text == "\n") {
387
+ var cursor = editor.getCursorPosition();
388
+ var line = session.doc.getLine(cursor.row);
389
+ var rightChars = line.substring(cursor.column, cursor.column + 2);
390
+ if (rightChars == '</') {
391
+ var indent = this.$getIndent(session.doc.getLine(cursor.row)) + session.getTabString();
392
+ var next_indent = this.$getIndent(session.doc.getLine(cursor.row));
393
+
394
+ return {
395
+ text: '\n' + indent + '\n' + next_indent,
396
+ selection: [1, indent.length, 1, indent.length]
397
+ }
398
+ }
399
+ }
400
+ });
401
+
402
+ }
403
+ oop.inherits(XmlBehaviour, Behaviour);
404
+
405
+ exports.XmlBehaviour = XmlBehaviour;
406
+ });/* vim:ts=4:sts=4:sw=4:
407
+ * ***** BEGIN LICENSE BLOCK *****
408
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
409
+ *
410
+ * The contents of this file are subject to the Mozilla Public License Version
411
+ * 1.1 (the "License"); you may not use this file except in compliance with
412
+ * the License. You may obtain a copy of the License at
413
+ * http://www.mozilla.org/MPL/
414
+ *
415
+ * Software distributed under the License is distributed on an "AS IS" basis,
416
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
417
+ * for the specific language governing rights and limitations under the
418
+ * License.
419
+ *
420
+ * The Original Code is Ajax.org Code Editor (ACE).
421
+ *
422
+ * The Initial Developer of the Original Code is
423
+ * Ajax.org B.V.
424
+ * Portions created by the Initial Developer are Copyright (C) 2010
425
+ * the Initial Developer. All Rights Reserved.
426
+ *
427
+ * Contributor(s):
428
+ * Chris Spencer <chris.ag.spencer AT googlemail DOT com>
429
+ *
430
+ * Alternatively, the contents of this file may be used under the terms of
431
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
432
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
433
+ * in which case the provisions of the GPL or the LGPL are applicable instead
434
+ * of those above. If you wish to allow use of your version of this file only
435
+ * under the terms of either the GPL or the LGPL, and not to allow others to
436
+ * use your version of this file under the terms of the MPL, indicate your
437
+ * decision by deleting the provisions above and replace them with the notice
438
+ * and other provisions required by the GPL or the LGPL. If you do not delete
439
+ * the provisions above, a recipient may use your version of this file under
440
+ * the terms of any one of the MPL, the GPL or the LGPL.
441
+ *
442
+ * ***** END LICENSE BLOCK ***** */
443
+
444
+ define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
445
+ "use strict";
446
+
447
+ var oop = require("../../lib/oop");
448
+ var Behaviour = require('../behaviour').Behaviour;
449
+
450
+ var CstyleBehaviour = function () {
451
+
452
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
453
+ if (text == '{') {
454
+ var selection = editor.getSelectionRange();
455
+ var selected = session.doc.getTextRange(selection);
456
+ if (selected !== "") {
457
+ return {
458
+ text: '{' + selected + '}',
459
+ selection: false
460
+ }
461
+ } else {
462
+ return {
463
+ text: '{}',
464
+ selection: [1, 1]
465
+ }
466
+ }
467
+ } else if (text == '}') {
468
+ var cursor = editor.getCursorPosition();
469
+ var line = session.doc.getLine(cursor.row);
470
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
471
+ if (rightChar == '}') {
472
+ var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
473
+ if (matching !== null) {
474
+ return {
475
+ text: '',
476
+ selection: [1, 1]
477
+ }
478
+ }
479
+ }
480
+ } else if (text == "\n") {
481
+ var cursor = editor.getCursorPosition();
482
+ var line = session.doc.getLine(cursor.row);
483
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
484
+ if (rightChar == '}') {
485
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
486
+ if (!openBracePos)
487
+ return null;
488
+
489
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
490
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
491
+
492
+ return {
493
+ text: '\n' + indent + '\n' + next_indent,
494
+ selection: [1, indent.length, 1, indent.length]
495
+ }
496
+ }
497
+ }
498
+ });
499
+
500
+ this.add("braces", "deletion", function (state, action, editor, session, range) {
501
+ var selected = session.doc.getTextRange(range);
502
+ if (!range.isMultiLine() && selected == '{') {
503
+ var line = session.doc.getLine(range.start.row);
504
+ var rightChar = line.substring(range.end.column, range.end.column + 1);
505
+ if (rightChar == '}') {
506
+ range.end.column++;
507
+ return range;
508
+ }
509
+ }
510
+ });
511
+
512
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
513
+ if (text == '(') {
514
+ var selection = editor.getSelectionRange();
515
+ var selected = session.doc.getTextRange(selection);
516
+ if (selected !== "") {
517
+ return {
518
+ text: '(' + selected + ')',
519
+ selection: false
520
+ }
521
+ } else {
522
+ return {
523
+ text: '()',
524
+ selection: [1, 1]
525
+ }
526
+ }
527
+ } else if (text == ')') {
528
+ var cursor = editor.getCursorPosition();
529
+ var line = session.doc.getLine(cursor.row);
530
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
531
+ if (rightChar == ')') {
532
+ var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
533
+ if (matching !== null) {
534
+ return {
535
+ text: '',
536
+ selection: [1, 1]
537
+ }
538
+ }
539
+ }
540
+ }
541
+ });
542
+
543
+ this.add("parens", "deletion", function (state, action, editor, session, range) {
544
+ var selected = session.doc.getTextRange(range);
545
+ if (!range.isMultiLine() && selected == '(') {
546
+ var line = session.doc.getLine(range.start.row);
547
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
548
+ if (rightChar == ')') {
549
+ range.end.column++;
550
+ return range;
551
+ }
552
+ }
553
+ });
554
+
555
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
556
+ if (text == '"') {
557
+ var selection = editor.getSelectionRange();
558
+ var selected = session.doc.getTextRange(selection);
559
+ if (selected !== "") {
560
+ return {
561
+ text: '"' + selected + '"',
562
+ selection: false
563
+ }
564
+ } else {
565
+ var cursor = editor.getCursorPosition();
566
+ var line = session.doc.getLine(cursor.row);
567
+ var leftChar = line.substring(cursor.column-1, cursor.column);
568
+
569
+ // We're escaped.
570
+ if (leftChar == '\\') {
571
+ return null;
572
+ }
573
+
574
+ // Find what token we're inside.
575
+ var tokens = session.getTokens(selection.start.row, selection.start.row)[0].tokens;
576
+ var col = 0, token;
577
+ var quotepos = -1; // Track whether we're inside an open quote.
578
+
579
+ for (var x = 0; x < tokens.length; x++) {
580
+ token = tokens[x];
581
+ if (token.type == "string") {
582
+ quotepos = -1;
583
+ } else if (quotepos < 0) {
584
+ quotepos = token.value.indexOf('"');
585
+ }
586
+ if ((token.value.length + col) > selection.start.column) {
587
+ break;
588
+ }
589
+ col += tokens[x].value.length;
590
+ }
591
+
592
+ // Try and be smart about when we auto insert.
593
+ 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)))) {
594
+ return {
595
+ text: '""',
596
+ selection: [1,1]
597
+ }
598
+ } else if (token && token.type === "string") {
599
+ // Ignore input and move right one if we're typing over the closing quote.
600
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
601
+ if (rightChar == '"') {
602
+ return {
603
+ text: '',
604
+ selection: [1, 1]
605
+ }
606
+ }
607
+ }
608
+ }
609
+ }
610
+ });
611
+
612
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
613
+ var selected = session.doc.getTextRange(range);
614
+ if (!range.isMultiLine() && selected == '"') {
615
+ var line = session.doc.getLine(range.start.row);
616
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
617
+ if (rightChar == '"') {
618
+ range.end.column++;
619
+ return range;
620
+ }
621
+ }
622
+ });
623
+
624
+ }
625
+ oop.inherits(CstyleBehaviour, Behaviour);
626
+
627
+ exports.CstyleBehaviour = CstyleBehaviour;
628
+ });/* ***** BEGIN LICENSE BLOCK *****
629
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
630
+ *
631
+ * The contents of this file are subject to the Mozilla Public License Version
632
+ * 1.1 (the "License"); you may not use this file except in compliance with
633
+ * the License. You may obtain a copy of the License at
634
+ * http://www.mozilla.org/MPL/
635
+ *
636
+ * Software distributed under the License is distributed on an "AS IS" basis,
637
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
638
+ * for the specific language governing rights and limitations under the
639
+ * License.
640
+ *
641
+ * The Original Code is Ajax.org Code Editor (ACE).
642
+ *
643
+ * The Initial Developer of the Original Code is
644
+ * Ajax.org B.V.
645
+ * Portions created by the Initial Developer are Copyright (C) 2010
646
+ * the Initial Developer. All Rights Reserved.
647
+ *
648
+ * Contributor(s):
649
+ * Fabian Jakobs <fabian AT ajax DOT org>
650
+ *
651
+ * Alternatively, the contents of this file may be used under the terms of
652
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
653
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
654
+ * in which case the provisions of the GPL or the LGPL are applicable instead
655
+ * of those above. If you wish to allow use of your version of this file only
656
+ * under the terms of either the GPL or the LGPL, and not to allow others to
657
+ * use your version of this file under the terms of the MPL, indicate your
658
+ * decision by deleting the provisions above and replace them with the notice
659
+ * and other provisions required by the GPL or the LGPL. If you do not delete
660
+ * the provisions above, a recipient may use your version of this file under
661
+ * the terms of any one of the MPL, the GPL or the LGPL.
662
+ *
663
+ * ***** END LICENSE BLOCK ***** */
664
+
665
+ 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) {
666
+ "use strict";
667
+
668
+ var oop = require("../../lib/oop");
669
+ var lang = require("../../lib/lang");
670
+ var Range = require("../../range").Range;
671
+ var BaseFoldMode = require("./fold_mode").FoldMode;
672
+ var TokenIterator = require("../../token_iterator").TokenIterator;
673
+
674
+ var FoldMode = exports.FoldMode = function(voidElements) {
675
+ BaseFoldMode.call(this);
676
+ this.voidElements = voidElements || {};
677
+ };
678
+ oop.inherits(FoldMode, BaseFoldMode);
679
+
680
+ (function() {
681
+
682
+ this.getFoldWidget = function(session, foldStyle, row) {
683
+ var tag = this._getFirstTagInLine(session, row);
684
+
685
+ if (tag.closing)
686
+ return foldStyle == "markbeginend" ? "end" : "";
687
+
688
+ if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()])
689
+ return "";
690
+
691
+ if (tag.selfClosing)
692
+ return "";
693
+
694
+ if (tag.value.indexOf("/" + tag.tagName) !== -1)
695
+ return "";
696
+
697
+ return "start";
698
+ };
699
+
700
+ this._getFirstTagInLine = function(session, row) {
701
+ var tokens = session.getTokens(row, row)[0].tokens;
702
+ var value = "";
703
+ for (var i = 0; i < tokens.length; i++) {
704
+ var token = tokens[i];
705
+ if (token.type.indexOf("meta.tag") === 0)
706
+ value += token.value;
707
+ else
708
+ value += lang.stringRepeat(" ", token.value.length);
709
+ }
710
+
711
+ return this._parseTag(value);
712
+ };
713
+
714
+ this.tagRe = /^(\s*)(<?(\/?)([-_a-zA-Z0-9:!]*)\s*(\/?)>?)/;
715
+ this._parseTag = function(tag) {
716
+
717
+ var match = this.tagRe.exec(tag);
718
+ var column = this.tagRe.lastIndex || 0;
719
+ this.tagRe.lastIndex = 0;
720
+
721
+ return {
722
+ value: tag,
723
+ match: match ? match[2] : "",
724
+ closing: match ? !!match[3] : false,
725
+ selfClosing: match ? !!match[5] || match[2] == "/>" : false,
726
+ tagName: match ? match[4] : "",
727
+ column: match[1] ? column + match[1].length : column
728
+ };
729
+ };
730
+
731
+ /**
732
+ * reads a full tag and places the iterator after the tag
733
+ */
734
+ this._readTagForward = function(iterator) {
735
+ var token = iterator.getCurrentToken();
736
+ if (!token)
737
+ return null;
738
+
739
+ var value = "";
740
+ var start;
741
+
742
+ do {
743
+ if (token.type.indexOf("meta.tag") === 0) {
744
+ if (!start) {
745
+ var start = {
746
+ row: iterator.getCurrentTokenRow(),
747
+ column: iterator.getCurrentTokenColumn()
748
+ };
749
+ }
750
+ value += token.value;
751
+ if (value.indexOf(">") !== -1) {
752
+ var tag = this._parseTag(value);
753
+ tag.start = start;
754
+ tag.end = {
755
+ row: iterator.getCurrentTokenRow(),
756
+ column: iterator.getCurrentTokenColumn() + token.value.length
757
+ };
758
+ iterator.stepForward();
759
+ return tag;
760
+ }
761
+ }
762
+ } while(token = iterator.stepForward());
763
+
764
+ return null;
765
+ };
766
+
767
+ this._readTagBackward = function(iterator) {
768
+ var token = iterator.getCurrentToken();
769
+ if (!token)
770
+ return null;
771
+
772
+ var value = "";
773
+ var end;
774
+
775
+ do {
776
+ if (token.type.indexOf("meta.tag") === 0) {
777
+ if (!end) {
778
+ end = {
779
+ row: iterator.getCurrentTokenRow(),
780
+ column: iterator.getCurrentTokenColumn() + token.value.length
781
+ };
782
+ }
783
+ value = token.value + value;
784
+ if (value.indexOf("<") !== -1) {
785
+ var tag = this._parseTag(value);
786
+ tag.end = end;
787
+ tag.start = {
788
+ row: iterator.getCurrentTokenRow(),
789
+ column: iterator.getCurrentTokenColumn()
790
+ };
791
+ iterator.stepBackward();
792
+ return tag;
793
+ }
794
+ }
795
+ } while(token = iterator.stepBackward());
796
+
797
+ return null;
798
+ };
799
+
800
+ this._pop = function(stack, tag) {
801
+ while (stack.length) {
802
+
803
+ var top = stack[stack.length-1];
804
+ if (!tag || top.tagName == tag.tagName) {
805
+ return stack.pop();
806
+ }
807
+ else if (this.voidElements[tag.tagName]) {
808
+ return;
809
+ }
810
+ else if (this.voidElements[top.tagName]) {
811
+ stack.pop();
812
+ continue;
813
+ } else {
814
+ return null;
815
+ }
816
+ }
817
+ };
818
+
819
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
820
+ var firstTag = this._getFirstTagInLine(session, row);
821
+
822
+ if (!firstTag.match)
823
+ return null;
824
+
825
+ var isBackward = firstTag.closing || firstTag.selfClosing;
826
+ var stack = [];
827
+ var tag;
828
+
829
+ if (!isBackward) {
830
+ var iterator = new TokenIterator(session, row, firstTag.column);
831
+ var start = {
832
+ row: row,
833
+ column: firstTag.column + firstTag.tagName.length + 2
834
+ };
835
+ while (tag = this._readTagForward(iterator)) {
836
+ if (tag.selfClosing) {
837
+ if (!stack.length) {
838
+ tag.start.column += tag.tagName.length + 2;
839
+ tag.end.column -= 2;
840
+ return Range.fromPoints(tag.start, tag.end);
841
+ } else
842
+ continue;
843
+ }
844
+
845
+ if (tag.closing) {
846
+ this._pop(stack, tag);
847
+ if (stack.length == 0)
848
+ return Range.fromPoints(start, tag.start);
849
+ }
850
+ else {
851
+ stack.push(tag)
852
+ }
853
+ }
854
+ }
855
+ else {
856
+ var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length);
857
+ var end = {
858
+ row: row,
859
+ column: firstTag.column
860
+ };
861
+
862
+ while (tag = this._readTagBackward(iterator)) {
863
+ if (tag.selfClosing) {
864
+ if (!stack.length) {
865
+ tag.start.column += tag.tagName.length + 2;
866
+ tag.end.column -= 2;
867
+ return Range.fromPoints(tag.start, tag.end);
868
+ } else
869
+ continue;
870
+ }
871
+
872
+ if (!tag.closing) {
873
+ this._pop(stack, tag);
874
+ if (stack.length == 0) {
875
+ tag.start.column += tag.tagName.length + 2;
876
+ return Range.fromPoints(tag.start, end);
877
+ }
878
+ }
879
+ else {
880
+ stack.push(tag)
881
+ }
882
+ }
883
+ }
884
+
885
+ };
886
+
887
+ }).call(FoldMode.prototype);
888
+
889
+ });/* ***** BEGIN LICENSE BLOCK *****
890
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
891
+ *
892
+ * The contents of this file are subject to the Mozilla Public License Version
893
+ * 1.1 (the "License"); you may not use this file except in compliance with
894
+ * the License. You may obtain a copy of the License at
895
+ * http://www.mozilla.org/MPL/
896
+ *
897
+ * Software distributed under the License is distributed on an "AS IS" basis,
898
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
899
+ * for the specific language governing rights and limitations under the
900
+ * License.
901
+ *
902
+ * The Original Code is Ajax.org Code Editor (ACE).
903
+ *
904
+ * The Initial Developer of the Original Code is
905
+ * Ajax.org B.V.
906
+ * Portions created by the Initial Developer are Copyright (C) 2010
907
+ * the Initial Developer. All Rights Reserved.
908
+ *
909
+ * Contributor(s):
910
+ * Fabian Jakobs <fabian AT ajax DOT org>
911
+ *
912
+ * Alternatively, the contents of this file may be used under the terms of
913
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
914
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
915
+ * in which case the provisions of the GPL or the LGPL are applicable instead
916
+ * of those above. If you wish to allow use of your version of this file only
917
+ * under the terms of either the GPL or the LGPL, and not to allow others to
918
+ * use your version of this file under the terms of the MPL, indicate your
919
+ * decision by deleting the provisions above and replace them with the notice
920
+ * and other provisions required by the GPL or the LGPL. If you do not delete
921
+ * the provisions above, a recipient may use your version of this file under
922
+ * the terms of any one of the MPL, the GPL or the LGPL.
923
+ *
924
+ * ***** END LICENSE BLOCK ***** */
925
+
926
+ define('ace/mode/folding/fold_mode', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
927
+ "use strict";
928
+
929
+ var Range = require("../../range").Range;
930
+
931
+ var FoldMode = exports.FoldMode = function() {};
932
+
933
+ (function() {
934
+
935
+ this.foldingStartMarker = null;
936
+ this.foldingStopMarker = null;
937
+
938
+ // must return "" if there's no fold, to enable caching
939
+ this.getFoldWidget = function(session, foldStyle, row) {
940
+ var line = session.getLine(row);
941
+ if (this.foldingStartMarker.test(line))
942
+ return "start";
943
+ if (foldStyle == "markbeginend"
944
+ && this.foldingStopMarker
945
+ && this.foldingStopMarker.test(line))
946
+ return "end";
947
+ return "";
948
+ };
949
+
950
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
951
+ return null;
952
+ };
953
+
954
+ this.indentationBlock = function(session, row, column) {
955
+ var re = /^\s*/;
956
+ var startRow = row;
957
+ var endRow = row;
958
+ var line = session.getLine(row);
959
+ var startColumn = column || line.length;
960
+ var startLevel = line.match(re)[0].length;
961
+ var maxRow = session.getLength()
962
+
963
+ while (++row < maxRow) {
964
+ line = session.getLine(row);
965
+ var level = line.match(re)[0].length;
966
+
967
+ if (level == line.length)
968
+ continue;
969
+
970
+ if (level <= startLevel)
971
+ break;
972
+
973
+ endRow = row;
974
+ }
975
+
976
+ if (endRow > startRow) {
977
+ var endColumn = session.getLine(endRow).length;
978
+ return new Range(startRow, startColumn, endRow, endColumn);
979
+ }
980
+ };
981
+
982
+ this.openingBracketBlock = function(session, bracket, row, column) {
983
+ var start = {row: row, column: column + 1};
984
+ var end = session.$findClosingBracket(bracket, start);
985
+ if (!end)
986
+ return;
987
+
988
+ var fw = session.foldWidgets[end.row];
989
+ if (fw == null)
990
+ fw = this.getFoldWidget(session, end.row);
991
+
992
+ if (fw == "start") {
993
+ end.row --;
994
+ end.column = session.getLine(end.row).length;
995
+ }
996
+ return Range.fromPoints(start, end);
997
+ };
998
+
999
+ }).call(FoldMode.prototype);
1000
+
1001
+ });