jquery-ace-rails 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (205) hide show
  1. data/README.md +36 -0
  2. data/lib/jquery-ace-rails.rb +5 -0
  3. data/lib/jquery-ace-rails/engine.rb +4 -0
  4. data/lib/jquery-ace-rails/version.rb +3 -0
  5. data/vendor/assets/javascripts/jquery-ace/jquery-ace.coffee +126 -0
  6. data/vendor/assets/javascripts/jquery-ace/jquery-ace.js +195 -0
  7. data/vendor/assets/javascripts/jquery-ace/jquery-ace.min.js +1 -0
  8. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/ace.js +11 -0
  9. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/ext-static_highlight.js +1 -0
  10. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/ext-textarea.js +1 -0
  11. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/keybinding-emacs.js +1 -0
  12. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/keybinding-vim.js +1 -0
  13. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-abap.js +1 -0
  14. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-asciidoc.js +1 -0
  15. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-c9search.js +1 -0
  16. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-c_cpp.js +1 -0
  17. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-clojure.js +1 -0
  18. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-coffee.js +1 -0
  19. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-coldfusion.js +1 -0
  20. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-csharp.js +1 -0
  21. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-css.js +1 -0
  22. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-dart.js +1 -0
  23. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-diff.js +1 -0
  24. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-dot.js +1 -0
  25. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-glsl.js +1 -0
  26. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-golang.js +1 -0
  27. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-groovy.js +1 -0
  28. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-haml.js +1 -0
  29. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-haxe.js +1 -0
  30. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-html.js +1 -0
  31. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-jade.js +1 -0
  32. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-java.js +1 -0
  33. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-javascript.js +1 -0
  34. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-json.js +1 -0
  35. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-jsp.js +1 -0
  36. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-jsx.js +1 -0
  37. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-latex.js +1 -0
  38. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-less.js +1 -0
  39. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-liquid.js +1 -0
  40. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-lisp.js +1 -0
  41. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-lua.js +1 -0
  42. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-luapage.js +1 -0
  43. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-lucene.js +1 -0
  44. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-makefile.js +1 -0
  45. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-markdown.js +1 -0
  46. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-objectivec.js +1 -0
  47. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-ocaml.js +1 -0
  48. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-perl.js +1 -0
  49. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-pgsql.js +1 -0
  50. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-php.js +1 -0
  51. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-powershell.js +1 -0
  52. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-python.js +1 -0
  53. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-r.js +1 -0
  54. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-rdoc.js +1 -0
  55. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-rhtml.js +1 -0
  56. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-ruby.js +1 -0
  57. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-scad.js +1 -0
  58. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-scala.js +1 -0
  59. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-scss.js +1 -0
  60. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-sh.js +1 -0
  61. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-sql.js +1 -0
  62. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-stylus.js +1 -0
  63. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-svg.js +1 -0
  64. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-tcl.js +1 -0
  65. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-tex.js +1 -0
  66. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-text.js +0 -0
  67. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-textile.js +1 -0
  68. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-typescript.js +1 -0
  69. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-xml.js +1 -0
  70. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-xquery.js +1 -0
  71. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-yaml.js +1 -0
  72. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-ambiance.js +1 -0
  73. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-chaos.js +1 -0
  74. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-chrome.js +1 -0
  75. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-clouds.js +1 -0
  76. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-clouds_midnight.js +1 -0
  77. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-cobalt.js +1 -0
  78. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-crimson_editor.js +1 -0
  79. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-dawn.js +1 -0
  80. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-dreamweaver.js +1 -0
  81. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-eclipse.js +1 -0
  82. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-github.js +1 -0
  83. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-idle_fingers.js +1 -0
  84. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-kr.js +1 -0
  85. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-merbivore.js +1 -0
  86. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-merbivore_soft.js +1 -0
  87. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-mono_industrial.js +1 -0
  88. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-monokai.js +1 -0
  89. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-pastel_on_dark.js +1 -0
  90. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-solarized_dark.js +1 -0
  91. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-solarized_light.js +1 -0
  92. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-textmate.js +1 -0
  93. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-tomorrow.js +1 -0
  94. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-tomorrow_night.js +1 -0
  95. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-tomorrow_night_blue.js +1 -0
  96. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-tomorrow_night_bright.js +1 -0
  97. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-tomorrow_night_eighties.js +1 -0
  98. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-twilight.js +1 -0
  99. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-vibrant_ink.js +1 -0
  100. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-xcode.js +1 -0
  101. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/worker-coffee.js +1 -0
  102. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/worker-css.js +1 -0
  103. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/worker-javascript.js +1 -0
  104. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/worker-json.js +1 -0
  105. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/worker-xquery.js +1 -0
  106. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/ace.js +14262 -0
  107. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/ext-static_highlight.js +96 -0
  108. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/ext-textarea.js +591 -0
  109. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/keybinding-emacs.js +364 -0
  110. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/keybinding-vim.js +1646 -0
  111. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-abap.js +259 -0
  112. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-asciidoc.js +372 -0
  113. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-c9search.js +187 -0
  114. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-c_cpp.js +765 -0
  115. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-clojure.js +325 -0
  116. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-coffee.js +520 -0
  117. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-coldfusion.js +1725 -0
  118. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-csharp.js +605 -0
  119. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-css.js +680 -0
  120. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-dart.js +279 -0
  121. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-diff.js +163 -0
  122. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-dot.js +348 -0
  123. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-glsl.js +838 -0
  124. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-golang.js +660 -0
  125. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-groovy.js +1082 -0
  126. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-haml.js +440 -0
  127. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-haxe.js +610 -0
  128. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-html.js +1850 -0
  129. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-jade.js +2035 -0
  130. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-java.js +1041 -0
  131. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-javascript.js +921 -0
  132. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-json.js +574 -0
  133. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-jsp.js +1371 -0
  134. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-jsx.js +635 -0
  135. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-latex.js +217 -0
  136. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-less.js +394 -0
  137. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-liquid.js +921 -0
  138. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-lisp.js +142 -0
  139. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-lua.js +609 -0
  140. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-luapage.js +2463 -0
  141. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-lucene.js +64 -0
  142. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-makefile.js +314 -0
  143. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-markdown.js +2228 -0
  144. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-objectivec.js +655 -0
  145. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-ocaml.js +448 -0
  146. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-perl.js +319 -0
  147. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-pgsql.js +928 -0
  148. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-php.js +2299 -0
  149. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-powershell.js +611 -0
  150. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-python.js +290 -0
  151. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-r.js +410 -0
  152. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-rdoc.js +189 -0
  153. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-rhtml.js +2138 -0
  154. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-ruby.js +410 -0
  155. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-scad.js +698 -0
  156. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-scala.js +1070 -0
  157. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-scss.js +416 -0
  158. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-sh.js +232 -0
  159. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-sql.js +145 -0
  160. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-stylus.js +474 -0
  161. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-svg.js +1490 -0
  162. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-tcl.js +342 -0
  163. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-tex.js +171 -0
  164. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-text.js +0 -0
  165. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-textile.js +175 -0
  166. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-typescript.js +1011 -0
  167. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-xml.js +792 -0
  168. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-xquery.js +676 -0
  169. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-yaml.js +298 -0
  170. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-ambiance.js +202 -0
  171. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-chaos.js +167 -0
  172. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-chrome.js +161 -0
  173. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-clouds.js +135 -0
  174. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-clouds_midnight.js +136 -0
  175. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-cobalt.js +150 -0
  176. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-crimson_editor.js +154 -0
  177. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-dawn.js +146 -0
  178. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-dreamweaver.js +173 -0
  179. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-eclipse.js +122 -0
  180. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-github.js +136 -0
  181. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-idle_fingers.js +136 -0
  182. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-kr.js +143 -0
  183. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-merbivore.js +135 -0
  184. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-merbivore_soft.js +136 -0
  185. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-mono_industrial.js +148 -0
  186. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-monokai.js +140 -0
  187. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-pastel_on_dark.js +148 -0
  188. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-solarized_dark.js +128 -0
  189. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-solarized_light.js +131 -0
  190. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-textmate.js +163 -0
  191. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-tomorrow.js +147 -0
  192. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-tomorrow_night.js +147 -0
  193. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-tomorrow_night_blue.js +145 -0
  194. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-tomorrow_night_bright.js +147 -0
  195. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-tomorrow_night_eighties.js +144 -0
  196. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-twilight.js +147 -0
  197. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-vibrant_ink.js +131 -0
  198. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-xcode.js +125 -0
  199. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/worker-coffee.js +6985 -0
  200. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/worker-css.js +7741 -0
  201. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/worker-javascript.js +6387 -0
  202. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/worker-json.js +2228 -0
  203. data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/worker-xquery.js +21719 -0
  204. data/vendor/assets/javascripts/jquery-ace/vendor/jquery-1.8.3.min.js +2 -0
  205. metadata +249 -0
@@ -0,0 +1,1850 @@
1
+ /* ***** BEGIN LICENSE BLOCK *****
2
+ * Distributed under the BSD license:
3
+ *
4
+ * Copyright (c) 2010, Ajax.org B.V.
5
+ * All rights reserved.
6
+ *
7
+ * Redistribution and use in source and binary forms, with or without
8
+ * modification, are permitted provided that the following conditions are met:
9
+ * * Redistributions of source code must retain the above copyright
10
+ * notice, this list of conditions and the following disclaimer.
11
+ * * Redistributions in binary form must reproduce the above copyright
12
+ * notice, this list of conditions and the following disclaimer in the
13
+ * documentation and/or other materials provided with the distribution.
14
+ * * Neither the name of Ajax.org B.V. nor the
15
+ * names of its contributors may be used to endorse or promote products
16
+ * derived from this software without specific prior written permission.
17
+ *
18
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
22
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
+ *
29
+ * ***** END LICENSE BLOCK ***** */
30
+
31
+ define('ace/mode/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/mode/javascript', 'ace/mode/css', 'ace/tokenizer', 'ace/mode/html_highlight_rules', 'ace/mode/behaviour/html', 'ace/mode/folding/html'], function(require, exports, module) {
32
+
33
+
34
+ var oop = require("../lib/oop");
35
+ var TextMode = require("./text").Mode;
36
+ var JavaScriptMode = require("./javascript").Mode;
37
+ var CssMode = require("./css").Mode;
38
+ var Tokenizer = require("../tokenizer").Tokenizer;
39
+ var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
40
+ var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour;
41
+ var HtmlFoldMode = require("./folding/html").FoldMode;
42
+
43
+ var Mode = function() {
44
+ var highlighter = new HtmlHighlightRules();
45
+ this.$tokenizer = new Tokenizer(highlighter.getRules());
46
+ this.$behaviour = new HtmlBehaviour();
47
+
48
+ this.$embeds = highlighter.getEmbeds();
49
+ this.createModeDelegates({
50
+ "js-": JavaScriptMode,
51
+ "css-": CssMode
52
+ });
53
+
54
+ this.foldingRules = new HtmlFoldMode();
55
+ };
56
+ oop.inherits(Mode, TextMode);
57
+
58
+ (function() {
59
+
60
+
61
+ this.toggleCommentLines = function(state, doc, startRow, endRow) {
62
+ return 0;
63
+ };
64
+
65
+ this.getNextLineIndent = function(state, line, tab) {
66
+ return this.$getIndent(line);
67
+ };
68
+
69
+ this.checkOutdent = function(state, line, input) {
70
+ return false;
71
+ };
72
+
73
+ }).call(Mode.prototype);
74
+
75
+ exports.Mode = Mode;
76
+ });
77
+
78
+ 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) {
79
+
80
+
81
+ var oop = require("../lib/oop");
82
+ var TextMode = require("./text").Mode;
83
+ var Tokenizer = require("../tokenizer").Tokenizer;
84
+ var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
85
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
86
+ var Range = require("../range").Range;
87
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
88
+ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
89
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
90
+
91
+ var Mode = function() {
92
+ this.$tokenizer = new Tokenizer(new JavaScriptHighlightRules().getRules());
93
+ this.$outdent = new MatchingBraceOutdent();
94
+ this.$behaviour = new CstyleBehaviour();
95
+ this.foldingRules = new CStyleFoldMode();
96
+ };
97
+ oop.inherits(Mode, TextMode);
98
+
99
+ (function() {
100
+
101
+
102
+ this.toggleCommentLines = function(state, doc, startRow, endRow) {
103
+ var outdent = true;
104
+ var re = /^(\s*)\/\//;
105
+
106
+ for (var i=startRow; i<= endRow; i++) {
107
+ if (!re.test(doc.getLine(i))) {
108
+ outdent = false;
109
+ break;
110
+ }
111
+ }
112
+
113
+ if (outdent) {
114
+ var deleteRange = new Range(0, 0, 0, 0);
115
+ for (var i=startRow; i<= endRow; i++)
116
+ {
117
+ var line = doc.getLine(i);
118
+ var m = line.match(re);
119
+ deleteRange.start.row = i;
120
+ deleteRange.end.row = i;
121
+ deleteRange.end.column = m[0].length;
122
+ doc.replace(deleteRange, m[1]);
123
+ }
124
+ }
125
+ else {
126
+ doc.indentRows(startRow, endRow, "//");
127
+ }
128
+ };
129
+
130
+ this.getNextLineIndent = function(state, line, tab) {
131
+ var indent = this.$getIndent(line);
132
+
133
+ var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
134
+ var tokens = tokenizedLine.tokens;
135
+ var endState = tokenizedLine.state;
136
+
137
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
138
+ return indent;
139
+ }
140
+
141
+ if (state == "start" || state == "regex_allowed") {
142
+ var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
143
+ if (match) {
144
+ indent += tab;
145
+ }
146
+ } else if (state == "doc-start") {
147
+ if (endState == "start" || state == "regex_allowed") {
148
+ return "";
149
+ }
150
+ var match = line.match(/^\s*(\/?)\*/);
151
+ if (match) {
152
+ if (match[1]) {
153
+ indent += " ";
154
+ }
155
+ indent += "* ";
156
+ }
157
+ }
158
+
159
+ return indent;
160
+ };
161
+
162
+ this.checkOutdent = function(state, line, input) {
163
+ return this.$outdent.checkOutdent(line, input);
164
+ };
165
+
166
+ this.autoOutdent = function(state, doc, row) {
167
+ this.$outdent.autoOutdent(doc, row);
168
+ };
169
+
170
+ this.createWorker = function(session) {
171
+ var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
172
+ worker.attachToDocument(session.getDocument());
173
+
174
+ worker.on("jslint", function(results) {
175
+ session.setAnnotations(results.data);
176
+ });
177
+
178
+ worker.on("terminate", function() {
179
+ session.clearAnnotations();
180
+ });
181
+
182
+ return worker;
183
+ };
184
+
185
+ }).call(Mode.prototype);
186
+
187
+ exports.Mode = Mode;
188
+ });
189
+
190
+ define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
191
+
192
+
193
+ var oop = require("../lib/oop");
194
+ var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
195
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
196
+
197
+ var JavaScriptHighlightRules = function() {
198
+ var keywordMapper = this.createKeywordMapper({
199
+ "variable.language":
200
+ "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
201
+ "Namespace|QName|XML|XMLList|" + // E4X
202
+ "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
203
+ "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
204
+ "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
205
+ "SyntaxError|TypeError|URIError|" +
206
+ "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
207
+ "isNaN|parseFloat|parseInt|" +
208
+ "JSON|Math|" + // Other
209
+ "this|arguments|prototype|window|document" , // Pseudo
210
+ "keyword":
211
+ "const|yield|import|get|set|" +
212
+ "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
213
+ "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
214
+ "__parent__|__count__|escape|unescape|with|__proto__|" +
215
+ "class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
216
+ "storage.type":
217
+ "const|let|var|function",
218
+ "constant.language":
219
+ "null|Infinity|NaN|undefined",
220
+ "support.function":
221
+ "alert"
222
+ }, "identifier");
223
+ var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
224
+ var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
225
+
226
+ var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
227
+ "u[0-9a-fA-F]{4}|" + // unicode
228
+ "[0-2][0-7]{0,2}|" + // oct
229
+ "3[0-6][0-7]?|" + // oct
230
+ "37[0-7]?|" + // oct
231
+ "[4-7][0-7]?|" + //oct
232
+ ".)";
233
+
234
+ this.$rules = {
235
+ "start" : [
236
+ {
237
+ token : "comment",
238
+ regex : /\/\/.*$/
239
+ },
240
+ DocCommentHighlightRules.getStartRule("doc-start"),
241
+ {
242
+ token : "comment", // multi line comment
243
+ regex : /\/\*/,
244
+ next : "comment"
245
+ }, {
246
+ token : "string",
247
+ regex : "'(?=.)",
248
+ next : "qstring"
249
+ }, {
250
+ token : "string",
251
+ regex : '"(?=.)',
252
+ next : "qqstring"
253
+ }, {
254
+ token : "constant.numeric", // hex
255
+ regex : /0[xX][0-9a-fA-F]+\b/
256
+ }, {
257
+ token : "constant.numeric", // float
258
+ regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
259
+ }, {
260
+ token : [
261
+ "storage.type", "punctuation.operator", "support.function",
262
+ "punctuation.operator", "entity.name.function", "text","keyword.operator"
263
+ ],
264
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
265
+ next: "function_arguments"
266
+ }, {
267
+ token : [
268
+ "storage.type", "punctuation.operator", "entity.name.function", "text",
269
+ "keyword.operator", "text", "storage.type", "text", "paren.lparen"
270
+ ],
271
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
272
+ next: "function_arguments"
273
+ }, {
274
+ token : [
275
+ "entity.name.function", "text", "keyword.operator", "text", "storage.type",
276
+ "text", "paren.lparen"
277
+ ],
278
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
279
+ next: "function_arguments"
280
+ }, {
281
+ token : [
282
+ "storage.type", "punctuation.operator", "entity.name.function", "text",
283
+ "keyword.operator", "text",
284
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
285
+ ],
286
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
287
+ next: "function_arguments"
288
+ }, {
289
+ token : [
290
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
291
+ ],
292
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
293
+ next: "function_arguments"
294
+ }, {
295
+ token : [
296
+ "entity.name.function", "text", "punctuation.operator",
297
+ "text", "storage.type", "text", "paren.lparen"
298
+ ],
299
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
300
+ next: "function_arguments"
301
+ }, {
302
+ token : [
303
+ "text", "text", "storage.type", "text", "paren.lparen"
304
+ ],
305
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
306
+ next: "function_arguments"
307
+ }, {
308
+ token : "constant.language.boolean",
309
+ regex : /(?:true|false)\b/
310
+ }, {
311
+ token : "keyword",
312
+ regex : "(?:" + kwBeforeRe + ")\\b",
313
+ next : "regex_allowed"
314
+ }, {
315
+ token : ["punctuation.operator", "support.function"],
316
+ regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
317
+ }, {
318
+ token : ["punctuation.operator", "support.function.dom"],
319
+ regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
320
+ }, {
321
+ token : ["punctuation.operator", "support.constant"],
322
+ regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
323
+ }, {
324
+ token : ["storage.type", "punctuation.operator", "support.function.firebug"],
325
+ regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
326
+ }, {
327
+ token : keywordMapper,
328
+ regex : identifierRe
329
+ }, {
330
+ token : "keyword.operator",
331
+ regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/,
332
+ next : "regex_allowed"
333
+ }, {
334
+ token : "punctuation.operator",
335
+ regex : /\?|\:|\,|\;|\./,
336
+ next : "regex_allowed"
337
+ }, {
338
+ token : "paren.lparen",
339
+ regex : /[\[({]/,
340
+ next : "regex_allowed"
341
+ }, {
342
+ token : "paren.rparen",
343
+ regex : /[\])}]/
344
+ }, {
345
+ token : "keyword.operator",
346
+ regex : /\/=?/,
347
+ next : "regex_allowed"
348
+ }, {
349
+ token: "comment",
350
+ regex: /^#!.*$/
351
+ }, {
352
+ token : "text",
353
+ regex : /\s+/
354
+ }
355
+ ],
356
+ "regex_allowed": [
357
+ DocCommentHighlightRules.getStartRule("doc-start"),
358
+ {
359
+ token : "comment", // multi line comment
360
+ regex : "\\/\\*",
361
+ next : "comment_regex_allowed"
362
+ }, {
363
+ token : "comment",
364
+ regex : "\\/\\/.*$"
365
+ }, {
366
+ token: "string.regexp",
367
+ regex: "\\/",
368
+ next: "regex",
369
+ }, {
370
+ token : "text",
371
+ regex : "\\s+"
372
+ }, {
373
+ token: "empty",
374
+ regex: "",
375
+ next: "start"
376
+ }
377
+ ],
378
+ "regex": [
379
+ {
380
+ token: "regexp.keyword.operator",
381
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
382
+ }, {
383
+ token: "string.regexp",
384
+ regex: "/\\w*",
385
+ next: "start",
386
+ }, {
387
+ token : "invalid",
388
+ regex: /\{\d+,?(?:\d+)?}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
389
+ }, {
390
+ token : "constant.language.escape",
391
+ regex: /\(\?[:=!]|\)|{\d+,?(?:\d+)?}|{,\d+}|[+*]\?|[(|)$^+*?]/
392
+ }, {
393
+ token: "string.regexp",
394
+ regex: /{|[^{\[\/\\(|)$^+*?]+/,
395
+ }, {
396
+ token: "constant.language.escape",
397
+ regex: /\[\^?/,
398
+ next: "regex_character_class",
399
+ }, {
400
+ token: "empty",
401
+ regex: "",
402
+ next: "start"
403
+ }
404
+ ],
405
+ "regex_character_class": [
406
+ {
407
+ token: "regexp.keyword.operator",
408
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
409
+ }, {
410
+ token: "constant.language.escape",
411
+ regex: "]",
412
+ next: "regex",
413
+ }, {
414
+ token: "constant.language.escape",
415
+ regex: "-"
416
+ }, {
417
+ token: "string.regexp.charachterclass",
418
+ regex: /[^\]\-\\]+/,
419
+ }, {
420
+ token: "empty",
421
+ regex: "",
422
+ next: "start"
423
+ }
424
+ ],
425
+ "function_arguments": [
426
+ {
427
+ token: "variable.parameter",
428
+ regex: identifierRe
429
+ }, {
430
+ token: "punctuation.operator",
431
+ regex: "[, ]+",
432
+ }, {
433
+ token: "punctuation.operator",
434
+ regex: "$",
435
+ }, {
436
+ token: "empty",
437
+ regex: "",
438
+ next: "start"
439
+ }
440
+ ],
441
+ "comment_regex_allowed" : [
442
+ {
443
+ token : "comment", // closing comment
444
+ regex : ".*?\\*\\/",
445
+ next : "regex_allowed"
446
+ }, {
447
+ token : "comment", // comment spanning whole line
448
+ regex : ".+"
449
+ }
450
+ ],
451
+ "comment" : [
452
+ {
453
+ token : "comment", // closing comment
454
+ regex : ".*?\\*\\/",
455
+ next : "start"
456
+ }, {
457
+ token : "comment", // comment spanning whole line
458
+ regex : ".+"
459
+ }
460
+ ],
461
+ "qqstring" : [
462
+ {
463
+ token : "constant.language.escape",
464
+ regex : escapedRe
465
+ }, {
466
+ token : "string",
467
+ regex : "\\\\$",
468
+ next : "qqstring",
469
+ }, {
470
+ token : "string",
471
+ regex : '"|$',
472
+ next : "start",
473
+ }, {
474
+ token : "string",
475
+ regex : '.|\\w+|\\s+',
476
+ }
477
+ ],
478
+ "qstring" : [
479
+ {
480
+ token : "constant.language.escape",
481
+ regex : escapedRe
482
+ }, {
483
+ token : "string",
484
+ regex : "\\\\$",
485
+ next : "qstring",
486
+ }, {
487
+ token : "string",
488
+ regex : "'|$",
489
+ next : "start",
490
+ }, {
491
+ token : "string",
492
+ regex : '.|\\w+|\\s+',
493
+ }
494
+ ]
495
+ };
496
+
497
+ this.embedRules(DocCommentHighlightRules, "doc-",
498
+ [ DocCommentHighlightRules.getEndRule("start") ]);
499
+ };
500
+
501
+ oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
502
+
503
+ exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
504
+ });
505
+
506
+ define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
507
+
508
+
509
+ var oop = require("../lib/oop");
510
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
511
+
512
+ var DocCommentHighlightRules = function() {
513
+
514
+ this.$rules = {
515
+ "start" : [ {
516
+ token : "comment.doc.tag",
517
+ regex : "@[\\w\\d_]+" // TODO: fix email addresses
518
+ }, {
519
+ token : "comment.doc",
520
+ regex : "\\s+"
521
+ }, {
522
+ token : "comment.doc",
523
+ regex : "TODO"
524
+ }, {
525
+ token : "comment.doc",
526
+ regex : "[^@\\*]+"
527
+ }, {
528
+ token : "comment.doc",
529
+ regex : "."
530
+ }]
531
+ };
532
+ };
533
+
534
+ oop.inherits(DocCommentHighlightRules, TextHighlightRules);
535
+
536
+ DocCommentHighlightRules.getStartRule = function(start) {
537
+ return {
538
+ token : "comment.doc", // doc comment
539
+ regex : "\\/\\*(?=\\*)",
540
+ next : start
541
+ };
542
+ };
543
+
544
+ DocCommentHighlightRules.getEndRule = function (start) {
545
+ return {
546
+ token : "comment.doc", // closing comment
547
+ regex : "\\*\\/",
548
+ next : start
549
+ };
550
+ };
551
+
552
+
553
+ exports.DocCommentHighlightRules = DocCommentHighlightRules;
554
+
555
+ });
556
+
557
+ define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
558
+
559
+
560
+ var Range = require("../range").Range;
561
+
562
+ var MatchingBraceOutdent = function() {};
563
+
564
+ (function() {
565
+
566
+ this.checkOutdent = function(line, input) {
567
+ if (! /^\s+$/.test(line))
568
+ return false;
569
+
570
+ return /^\s*\}/.test(input);
571
+ };
572
+
573
+ this.autoOutdent = function(doc, row) {
574
+ var line = doc.getLine(row);
575
+ var match = line.match(/^(\s*\})/);
576
+
577
+ if (!match) return 0;
578
+
579
+ var column = match[1].length;
580
+ var openBracePos = doc.findMatchingBracket({row: row, column: column});
581
+
582
+ if (!openBracePos || openBracePos.row == row) return 0;
583
+
584
+ var indent = this.$getIndent(doc.getLine(openBracePos.row));
585
+ doc.replace(new Range(row, 0, row, column-1), indent);
586
+ };
587
+
588
+ this.$getIndent = function(line) {
589
+ var match = line.match(/^(\s+)/);
590
+ if (match) {
591
+ return match[1];
592
+ }
593
+
594
+ return "";
595
+ };
596
+
597
+ }).call(MatchingBraceOutdent.prototype);
598
+
599
+ exports.MatchingBraceOutdent = MatchingBraceOutdent;
600
+ });
601
+
602
+ define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) {
603
+
604
+
605
+ var oop = require("../../lib/oop");
606
+ var Behaviour = require("../behaviour").Behaviour;
607
+ var TokenIterator = require("../../token_iterator").TokenIterator;
608
+ var lang = require("../../lib/lang");
609
+
610
+ var SAFE_INSERT_IN_TOKENS =
611
+ ["text", "paren.rparen", "punctuation.operator"];
612
+ var SAFE_INSERT_BEFORE_TOKENS =
613
+ ["text", "paren.rparen", "punctuation.operator", "comment"];
614
+
615
+
616
+ var autoInsertedBrackets = 0;
617
+ var autoInsertedRow = -1;
618
+ var autoInsertedLineEnd = "";
619
+ var maybeInsertedBrackets = 0;
620
+ var maybeInsertedRow = -1;
621
+ var maybeInsertedLineStart = "";
622
+ var maybeInsertedLineEnd = "";
623
+
624
+ var CstyleBehaviour = function () {
625
+
626
+ CstyleBehaviour.isSaneInsertion = function(editor, session) {
627
+ var cursor = editor.getCursorPosition();
628
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
629
+ if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
630
+ var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
631
+ if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
632
+ return false;
633
+ }
634
+ iterator.stepForward();
635
+ return iterator.getCurrentTokenRow() !== cursor.row ||
636
+ this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
637
+ };
638
+
639
+ CstyleBehaviour.$matchTokenType = function(token, types) {
640
+ return types.indexOf(token.type || token) > -1;
641
+ };
642
+
643
+ CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
644
+ var cursor = editor.getCursorPosition();
645
+ var line = session.doc.getLine(cursor.row);
646
+ if (!this.isAutoInsertedClosing(cursor, line, autoInsertedLineEnd[0]))
647
+ autoInsertedBrackets = 0;
648
+ autoInsertedRow = cursor.row;
649
+ autoInsertedLineEnd = bracket + line.substr(cursor.column);
650
+ autoInsertedBrackets++;
651
+ };
652
+
653
+ CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
654
+ var cursor = editor.getCursorPosition();
655
+ var line = session.doc.getLine(cursor.row);
656
+ if (!this.isMaybeInsertedClosing(cursor, line))
657
+ maybeInsertedBrackets = 0;
658
+ maybeInsertedRow = cursor.row;
659
+ maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
660
+ maybeInsertedLineEnd = line.substr(cursor.column);
661
+ maybeInsertedBrackets++;
662
+ };
663
+
664
+ CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
665
+ return autoInsertedBrackets > 0 &&
666
+ cursor.row === autoInsertedRow &&
667
+ bracket === autoInsertedLineEnd[0] &&
668
+ line.substr(cursor.column) === autoInsertedLineEnd;
669
+ };
670
+
671
+ CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
672
+ return maybeInsertedBrackets > 0 &&
673
+ cursor.row === maybeInsertedRow &&
674
+ line.substr(cursor.column) === maybeInsertedLineEnd &&
675
+ line.substr(0, cursor.column) == maybeInsertedLineStart;
676
+ };
677
+
678
+ CstyleBehaviour.popAutoInsertedClosing = function() {
679
+ autoInsertedLineEnd = autoInsertedLineEnd.substr(1);
680
+ autoInsertedBrackets--;
681
+ };
682
+
683
+ CstyleBehaviour.clearMaybeInsertedClosing = function() {
684
+ maybeInsertedBrackets = 0;
685
+ maybeInsertedRow = -1;
686
+ };
687
+
688
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
689
+ var cursor = editor.getCursorPosition();
690
+ var line = session.doc.getLine(cursor.row);
691
+ if (text == '{') {
692
+ var selection = editor.getSelectionRange();
693
+ var selected = session.doc.getTextRange(selection);
694
+ if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
695
+ return {
696
+ text: '{' + selected + '}',
697
+ selection: false
698
+ };
699
+ } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
700
+ if (/[\]\}\)]/.test(line[cursor.column])) {
701
+ CstyleBehaviour.recordAutoInsert(editor, session, "}");
702
+ return {
703
+ text: '{}',
704
+ selection: [1, 1]
705
+ };
706
+ } else {
707
+ CstyleBehaviour.recordMaybeInsert(editor, session, "{");
708
+ return {
709
+ text: '{',
710
+ selection: [1, 1]
711
+ };
712
+ }
713
+ }
714
+ } else if (text == '}') {
715
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
716
+ if (rightChar == '}') {
717
+ var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
718
+ if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
719
+ CstyleBehaviour.popAutoInsertedClosing();
720
+ return {
721
+ text: '',
722
+ selection: [1, 1]
723
+ };
724
+ }
725
+ }
726
+ } else if (text == "\n" || text == "\r\n") {
727
+ var closing = "";
728
+ if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {
729
+ closing = lang.stringRepeat("}", maybeInsertedBrackets);
730
+ CstyleBehaviour.clearMaybeInsertedClosing();
731
+ }
732
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
733
+ if (rightChar == '}' || closing !== "") {
734
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column}, '}');
735
+ if (!openBracePos)
736
+ return null;
737
+
738
+ var indent = this.getNextLineIndent(state, line.substring(0, cursor.column), session.getTabString());
739
+ var next_indent = this.$getIndent(line);
740
+
741
+ return {
742
+ text: '\n' + indent + '\n' + next_indent + closing,
743
+ selection: [1, indent.length, 1, indent.length]
744
+ };
745
+ }
746
+ }
747
+ });
748
+
749
+ this.add("braces", "deletion", function (state, action, editor, session, range) {
750
+ var selected = session.doc.getTextRange(range);
751
+ if (!range.isMultiLine() && selected == '{') {
752
+ var line = session.doc.getLine(range.start.row);
753
+ var rightChar = line.substring(range.end.column, range.end.column + 1);
754
+ if (rightChar == '}') {
755
+ range.end.column++;
756
+ return range;
757
+ } else {
758
+ maybeInsertedBrackets--;
759
+ }
760
+ }
761
+ });
762
+
763
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
764
+ if (text == '(') {
765
+ var selection = editor.getSelectionRange();
766
+ var selected = session.doc.getTextRange(selection);
767
+ if (selected !== "" && editor.getWrapBehavioursEnabled()) {
768
+ return {
769
+ text: '(' + selected + ')',
770
+ selection: false
771
+ };
772
+ } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
773
+ CstyleBehaviour.recordAutoInsert(editor, session, ")");
774
+ return {
775
+ text: '()',
776
+ selection: [1, 1]
777
+ };
778
+ }
779
+ } else if (text == ')') {
780
+ var cursor = editor.getCursorPosition();
781
+ var line = session.doc.getLine(cursor.row);
782
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
783
+ if (rightChar == ')') {
784
+ var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
785
+ if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
786
+ CstyleBehaviour.popAutoInsertedClosing();
787
+ return {
788
+ text: '',
789
+ selection: [1, 1]
790
+ };
791
+ }
792
+ }
793
+ }
794
+ });
795
+
796
+ this.add("parens", "deletion", function (state, action, editor, session, range) {
797
+ var selected = session.doc.getTextRange(range);
798
+ if (!range.isMultiLine() && selected == '(') {
799
+ var line = session.doc.getLine(range.start.row);
800
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
801
+ if (rightChar == ')') {
802
+ range.end.column++;
803
+ return range;
804
+ }
805
+ }
806
+ });
807
+
808
+ this.add("brackets", "insertion", function (state, action, editor, session, text) {
809
+ if (text == '[') {
810
+ var selection = editor.getSelectionRange();
811
+ var selected = session.doc.getTextRange(selection);
812
+ if (selected !== "" && editor.getWrapBehavioursEnabled()) {
813
+ return {
814
+ text: '[' + selected + ']',
815
+ selection: false
816
+ };
817
+ } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
818
+ CstyleBehaviour.recordAutoInsert(editor, session, "]");
819
+ return {
820
+ text: '[]',
821
+ selection: [1, 1]
822
+ };
823
+ }
824
+ } else if (text == ']') {
825
+ var cursor = editor.getCursorPosition();
826
+ var line = session.doc.getLine(cursor.row);
827
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
828
+ if (rightChar == ']') {
829
+ var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row});
830
+ if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
831
+ CstyleBehaviour.popAutoInsertedClosing();
832
+ return {
833
+ text: '',
834
+ selection: [1, 1]
835
+ };
836
+ }
837
+ }
838
+ }
839
+ });
840
+
841
+ this.add("brackets", "deletion", function (state, action, editor, session, range) {
842
+ var selected = session.doc.getTextRange(range);
843
+ if (!range.isMultiLine() && selected == '[') {
844
+ var line = session.doc.getLine(range.start.row);
845
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
846
+ if (rightChar == ']') {
847
+ range.end.column++;
848
+ return range;
849
+ }
850
+ }
851
+ });
852
+
853
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
854
+ if (text == '"' || text == "'") {
855
+ var quote = text;
856
+ var selection = editor.getSelectionRange();
857
+ var selected = session.doc.getTextRange(selection);
858
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
859
+ return {
860
+ text: quote + selected + quote,
861
+ selection: false
862
+ };
863
+ } else {
864
+ var cursor = editor.getCursorPosition();
865
+ var line = session.doc.getLine(cursor.row);
866
+ var leftChar = line.substring(cursor.column-1, cursor.column);
867
+ if (leftChar == '\\') {
868
+ return null;
869
+ }
870
+ var tokens = session.getTokens(selection.start.row);
871
+ var col = 0, token;
872
+ var quotepos = -1; // Track whether we're inside an open quote.
873
+
874
+ for (var x = 0; x < tokens.length; x++) {
875
+ token = tokens[x];
876
+ if (token.type == "string") {
877
+ quotepos = -1;
878
+ } else if (quotepos < 0) {
879
+ quotepos = token.value.indexOf(quote);
880
+ }
881
+ if ((token.value.length + col) > selection.start.column) {
882
+ break;
883
+ }
884
+ col += tokens[x].value.length;
885
+ }
886
+ if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) {
887
+ if (!CstyleBehaviour.isSaneInsertion(editor, session))
888
+ return;
889
+ return {
890
+ text: quote + quote,
891
+ selection: [1,1]
892
+ };
893
+ } else if (token && token.type === "string") {
894
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
895
+ if (rightChar == quote) {
896
+ return {
897
+ text: '',
898
+ selection: [1, 1]
899
+ };
900
+ }
901
+ }
902
+ }
903
+ }
904
+ });
905
+
906
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
907
+ var selected = session.doc.getTextRange(range);
908
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
909
+ var line = session.doc.getLine(range.start.row);
910
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
911
+ if (rightChar == '"') {
912
+ range.end.column++;
913
+ return range;
914
+ }
915
+ }
916
+ });
917
+
918
+ };
919
+
920
+ oop.inherits(CstyleBehaviour, Behaviour);
921
+
922
+ exports.CstyleBehaviour = CstyleBehaviour;
923
+ });
924
+
925
+ define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
926
+
927
+
928
+ var oop = require("../../lib/oop");
929
+ var Range = require("../../range").Range;
930
+ var BaseFoldMode = require("./fold_mode").FoldMode;
931
+
932
+ var FoldMode = exports.FoldMode = function() {};
933
+ oop.inherits(FoldMode, BaseFoldMode);
934
+
935
+ (function() {
936
+
937
+ this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
938
+ this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
939
+
940
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
941
+ var line = session.getLine(row);
942
+ var match = line.match(this.foldingStartMarker);
943
+ if (match) {
944
+ var i = match.index;
945
+
946
+ if (match[1])
947
+ return this.openingBracketBlock(session, match[1], row, i);
948
+
949
+ return session.getCommentFoldRange(row, i + match[0].length, 1);
950
+ }
951
+
952
+ if (foldStyle !== "markbeginend")
953
+ return;
954
+
955
+ var match = line.match(this.foldingStopMarker);
956
+ if (match) {
957
+ var i = match.index + match[0].length;
958
+
959
+ if (match[1])
960
+ return this.closingBracketBlock(session, match[1], row, i);
961
+
962
+ return session.getCommentFoldRange(row, i, -1);
963
+ }
964
+ };
965
+
966
+ }).call(FoldMode.prototype);
967
+
968
+ });
969
+
970
+ 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/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) {
971
+
972
+
973
+ var oop = require("../lib/oop");
974
+ var TextMode = require("./text").Mode;
975
+ var Tokenizer = require("../tokenizer").Tokenizer;
976
+ var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
977
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
978
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
979
+ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
980
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
981
+
982
+ var Mode = function() {
983
+ this.$tokenizer = new Tokenizer(new CssHighlightRules().getRules(), "i");
984
+ this.$outdent = new MatchingBraceOutdent();
985
+ this.$behaviour = new CstyleBehaviour();
986
+ this.foldingRules = new CStyleFoldMode();
987
+ };
988
+ oop.inherits(Mode, TextMode);
989
+
990
+ (function() {
991
+
992
+ this.foldingRules = "cStyle";
993
+
994
+ this.getNextLineIndent = function(state, line, tab) {
995
+ var indent = this.$getIndent(line);
996
+ var tokens = this.$tokenizer.getLineTokens(line, state).tokens;
997
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
998
+ return indent;
999
+ }
1000
+
1001
+ var match = line.match(/^.*\{\s*$/);
1002
+ if (match) {
1003
+ indent += tab;
1004
+ }
1005
+
1006
+ return indent;
1007
+ };
1008
+
1009
+ this.checkOutdent = function(state, line, input) {
1010
+ return this.$outdent.checkOutdent(line, input);
1011
+ };
1012
+
1013
+ this.autoOutdent = function(state, doc, row) {
1014
+ this.$outdent.autoOutdent(doc, row);
1015
+ };
1016
+
1017
+ this.createWorker = function(session) {
1018
+ var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
1019
+ worker.attachToDocument(session.getDocument());
1020
+
1021
+ worker.on("csslint", function(e) {
1022
+ session.setAnnotations(e.data);
1023
+ });
1024
+
1025
+ worker.on("terminate", function() {
1026
+ session.clearAnnotations();
1027
+ });
1028
+
1029
+ return worker;
1030
+ };
1031
+
1032
+ }).call(Mode.prototype);
1033
+
1034
+ exports.Mode = Mode;
1035
+
1036
+ });
1037
+
1038
+ define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
1039
+
1040
+
1041
+ var oop = require("../lib/oop");
1042
+ var lang = require("../lib/lang");
1043
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1044
+ var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index";
1045
+ var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
1046
+ var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero";
1047
+ var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow";
1048
+ var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace";
1049
+
1050
+ var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
1051
+ var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
1052
+ var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
1053
+
1054
+ var CssHighlightRules = function() {
1055
+
1056
+ var keywordMapper = this.createKeywordMapper({
1057
+ "support.function": supportFunction,
1058
+ "support.constant": supportConstant,
1059
+ "support.type": supportType,
1060
+ "support.constant.color": supportConstantColor,
1061
+ "support.constant.fonts": supportConstantFonts
1062
+ }, "text", true);
1063
+
1064
+ var base_ruleset = [
1065
+ {
1066
+ token : "comment", // multi line comment
1067
+ regex : "\\/\\*",
1068
+ next : "ruleset_comment"
1069
+ }, {
1070
+ token : "string", // single line
1071
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
1072
+ }, {
1073
+ token : "string", // single line
1074
+ regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
1075
+ }, {
1076
+ token : ["constant.numeric", "keyword"],
1077
+ regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)"
1078
+ }, {
1079
+ token : "constant.numeric",
1080
+ regex : numRe
1081
+ }, {
1082
+ token : "constant.numeric", // hex6 color
1083
+ regex : "#[a-f0-9]{6}"
1084
+ }, {
1085
+ token : "constant.numeric", // hex3 color
1086
+ regex : "#[a-f0-9]{3}"
1087
+ }, {
1088
+ token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
1089
+ regex : pseudoElements
1090
+ }, {
1091
+ token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
1092
+ regex : pseudoClasses
1093
+ }, {
1094
+ token : keywordMapper,
1095
+ regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
1096
+ }
1097
+ ];
1098
+
1099
+ var ruleset = lang.copyArray(base_ruleset);
1100
+ ruleset.unshift({
1101
+ token : "paren.rparen",
1102
+ regex : "\\}",
1103
+ next: "start"
1104
+ });
1105
+
1106
+ var media_ruleset = lang.copyArray( base_ruleset );
1107
+ media_ruleset.unshift({
1108
+ token : "paren.rparen",
1109
+ regex : "\\}",
1110
+ next: "media"
1111
+ });
1112
+
1113
+ var base_comment = [{
1114
+ token : "comment", // comment spanning whole line
1115
+ regex : ".+"
1116
+ }];
1117
+
1118
+ var comment = lang.copyArray(base_comment);
1119
+ comment.unshift({
1120
+ token : "comment", // closing comment
1121
+ regex : ".*?\\*\\/",
1122
+ next : "start"
1123
+ });
1124
+
1125
+ var media_comment = lang.copyArray(base_comment);
1126
+ media_comment.unshift({
1127
+ token : "comment", // closing comment
1128
+ regex : ".*?\\*\\/",
1129
+ next : "media"
1130
+ });
1131
+
1132
+ var ruleset_comment = lang.copyArray(base_comment);
1133
+ ruleset_comment.unshift({
1134
+ token : "comment", // closing comment
1135
+ regex : ".*?\\*\\/",
1136
+ next : "ruleset"
1137
+ });
1138
+
1139
+ this.$rules = {
1140
+ "start" : [{
1141
+ token : "comment", // multi line comment
1142
+ regex : "\\/\\*",
1143
+ next : "comment"
1144
+ }, {
1145
+ token: "paren.lparen",
1146
+ regex: "\\{",
1147
+ next: "ruleset"
1148
+ }, {
1149
+ token: "string",
1150
+ regex: "@.*?{",
1151
+ next: "media"
1152
+ },{
1153
+ token: "keyword",
1154
+ regex: "#[a-z0-9-_]+"
1155
+ },{
1156
+ token: "variable",
1157
+ regex: "\\.[a-z0-9-_]+"
1158
+ },{
1159
+ token: "string",
1160
+ regex: ":[a-z0-9-_]+"
1161
+ },{
1162
+ token: "constant",
1163
+ regex: "[a-z0-9-_]+"
1164
+ }],
1165
+
1166
+ "media" : [ {
1167
+ token : "comment", // multi line comment
1168
+ regex : "\\/\\*",
1169
+ next : "media_comment"
1170
+ }, {
1171
+ token: "paren.lparen",
1172
+ regex: "\\{",
1173
+ next: "media_ruleset"
1174
+ },{
1175
+ token: "string",
1176
+ regex: "\\}",
1177
+ next: "start"
1178
+ },{
1179
+ token: "keyword",
1180
+ regex: "#[a-z0-9-_]+"
1181
+ },{
1182
+ token: "variable",
1183
+ regex: "\\.[a-z0-9-_]+"
1184
+ },{
1185
+ token: "string",
1186
+ regex: ":[a-z0-9-_]+"
1187
+ },{
1188
+ token: "constant",
1189
+ regex: "[a-z0-9-_]+"
1190
+ }],
1191
+
1192
+ "comment" : comment,
1193
+
1194
+ "ruleset" : ruleset,
1195
+ "ruleset_comment" : ruleset_comment,
1196
+
1197
+ "media_ruleset" : media_ruleset,
1198
+ "media_comment" : media_comment
1199
+ };
1200
+ };
1201
+
1202
+ oop.inherits(CssHighlightRules, TextHighlightRules);
1203
+
1204
+ exports.CssHighlightRules = CssHighlightRules;
1205
+
1206
+ });
1207
+
1208
+ define('ace/mode/html_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/css_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
1209
+
1210
+
1211
+ var oop = require("../lib/oop");
1212
+ var lang = require("../lib/lang");
1213
+ var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
1214
+ var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
1215
+ var xmlUtil = require("./xml_util");
1216
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1217
+
1218
+ var tagMap = lang.createMap({
1219
+ a : 'anchor',
1220
+ button : 'form',
1221
+ form : 'form',
1222
+ img : 'image',
1223
+ input : 'form',
1224
+ label : 'form',
1225
+ script : 'script',
1226
+ select : 'form',
1227
+ textarea : 'form',
1228
+ style : 'style',
1229
+ table : 'table',
1230
+ tbody : 'table',
1231
+ td : 'table',
1232
+ tfoot : 'table',
1233
+ th : 'table',
1234
+ tr : 'table'
1235
+ });
1236
+
1237
+ var HtmlHighlightRules = function() {
1238
+ this.$rules = {
1239
+ start : [{
1240
+ token : "text",
1241
+ regex : "<\\!\\[CDATA\\[",
1242
+ next : "cdata"
1243
+ }, {
1244
+ token : "xml-pe",
1245
+ regex : "<\\?.*?\\?>"
1246
+ }, {
1247
+ token : "comment",
1248
+ regex : "<\\!--",
1249
+ next : "comment"
1250
+ }, {
1251
+ token : "xml-pe",
1252
+ regex : "<\\!.*?>"
1253
+ }, {
1254
+ token : "meta.tag",
1255
+ regex : "<(?=script\\b)",
1256
+ next : "script"
1257
+ }, {
1258
+ token : "meta.tag",
1259
+ regex : "<(?=style\\b)",
1260
+ next : "style"
1261
+ }, {
1262
+ token : "meta.tag", // opening tag
1263
+ regex : "<\\/?",
1264
+ next : "tag"
1265
+ }, {
1266
+ token : "text",
1267
+ regex : "\\s+"
1268
+ }, {
1269
+ token : "constant.character.entity",
1270
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
1271
+ }, {
1272
+ token : "text",
1273
+ regex : "[^<]+"
1274
+ } ],
1275
+
1276
+ cdata : [ {
1277
+ token : "text",
1278
+ regex : "\\]\\]>",
1279
+ next : "start"
1280
+ }, {
1281
+ token : "text",
1282
+ regex : "\\s+"
1283
+ }, {
1284
+ token : "text",
1285
+ regex : ".+"
1286
+ } ],
1287
+
1288
+ comment : [ {
1289
+ token : "comment",
1290
+ regex : ".*?-->",
1291
+ next : "start"
1292
+ }, {
1293
+ token : "comment",
1294
+ regex : ".+"
1295
+ } ]
1296
+ };
1297
+
1298
+ xmlUtil.tag(this.$rules, "tag", "start", tagMap);
1299
+ xmlUtil.tag(this.$rules, "style", "css-start", tagMap);
1300
+ xmlUtil.tag(this.$rules, "script", "js-start", tagMap);
1301
+
1302
+ this.embedRules(JavaScriptHighlightRules, "js-", [{
1303
+ token: "comment",
1304
+ regex: "\\/\\/.*(?=<\\/script>)",
1305
+ next: "tag"
1306
+ }, {
1307
+ token: "meta.tag",
1308
+ regex: "<\\/(?=script)",
1309
+ next: "tag"
1310
+ }]);
1311
+
1312
+ this.embedRules(CssHighlightRules, "css-", [{
1313
+ token: "meta.tag",
1314
+ regex: "<\\/(?=style)",
1315
+ next: "tag"
1316
+ }]);
1317
+ };
1318
+
1319
+ oop.inherits(HtmlHighlightRules, TextHighlightRules);
1320
+
1321
+ exports.HtmlHighlightRules = HtmlHighlightRules;
1322
+ });
1323
+
1324
+ define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) {
1325
+
1326
+
1327
+ function string(state) {
1328
+ return [{
1329
+ token : "string",
1330
+ regex : '"',
1331
+ next : state + "_qqstring"
1332
+ }, {
1333
+ token : "string",
1334
+ regex : "'",
1335
+ next : state + "_qstring"
1336
+ }];
1337
+ }
1338
+
1339
+ function multiLineString(quote, state) {
1340
+ return [
1341
+ {token : "string", regex : quote, next : state},
1342
+ {
1343
+ token : "constant.language.escape",
1344
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
1345
+ },
1346
+ {token : "string", regex : '\\w+|.|\\s+'}
1347
+ ];
1348
+ }
1349
+
1350
+ exports.tag = function(states, name, nextState, tagMap) {
1351
+ states[name] = [{
1352
+ token : "text",
1353
+ regex : "\\s+"
1354
+ }, {
1355
+
1356
+ token : !tagMap ? "meta.tag.tag-name" : function(value) {
1357
+ if (tagMap[value])
1358
+ return "meta.tag.tag-name." + tagMap[value];
1359
+ else
1360
+ return "meta.tag.tag-name";
1361
+ },
1362
+ regex : "[-_a-zA-Z0-9:]+",
1363
+ next : name + "_embed_attribute_list"
1364
+ }, {
1365
+ token: "empty",
1366
+ regex: "",
1367
+ next : name + "_embed_attribute_list"
1368
+ }];
1369
+
1370
+ states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list");
1371
+ states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list");
1372
+
1373
+ states[name + "_embed_attribute_list"] = [{
1374
+ token : "meta.tag.r",
1375
+ regex : "/?>",
1376
+ next : nextState
1377
+ }, {
1378
+ token : "keyword.operator",
1379
+ regex : "="
1380
+ }, {
1381
+ token : "entity.other.attribute-name",
1382
+ regex : "[-_a-zA-Z0-9:]+"
1383
+ }, {
1384
+ token : "constant.numeric", // float
1385
+ regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
1386
+ }, {
1387
+ token : "text",
1388
+ regex : "\\s+"
1389
+ }].concat(string(name));
1390
+ };
1391
+
1392
+ });
1393
+
1394
+ define('ace/mode/behaviour/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour/xml', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) {
1395
+
1396
+
1397
+ var oop = require("../../lib/oop");
1398
+ var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
1399
+ var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
1400
+ var TokenIterator = require("../../token_iterator").TokenIterator;
1401
+ var voidElements = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr'];
1402
+
1403
+ function hasType(token, type) {
1404
+ var hasType = true;
1405
+ var typeList = token.type.split('.');
1406
+ var needleList = type.split('.');
1407
+ needleList.forEach(function(needle){
1408
+ if (typeList.indexOf(needle) == -1) {
1409
+ hasType = false;
1410
+ return false;
1411
+ }
1412
+ });
1413
+ return hasType;
1414
+ }
1415
+
1416
+ var HtmlBehaviour = function () {
1417
+
1418
+ this.inherit(XmlBehaviour); // Get xml behaviour
1419
+
1420
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
1421
+ if (text == '>') {
1422
+ var position = editor.getCursorPosition();
1423
+ var iterator = new TokenIterator(session, position.row, position.column);
1424
+ var token = iterator.getCurrentToken();
1425
+ var atCursor = false;
1426
+ if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){
1427
+ do {
1428
+ token = iterator.stepBackward();
1429
+ } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text')));
1430
+ } else {
1431
+ atCursor = true;
1432
+ }
1433
+ if (!token || !hasType(token, 'meta.tag-name') || iterator.stepBackward().value.match('/')) {
1434
+ return
1435
+ }
1436
+ var element = token.value;
1437
+ if (atCursor){
1438
+ var element = element.substring(0, position.column - token.start);
1439
+ }
1440
+ if (voidElements.indexOf(element) !== -1){
1441
+ return;
1442
+ }
1443
+ return {
1444
+ text: '>' + '</' + element + '>',
1445
+ selection: [1, 1]
1446
+ }
1447
+ }
1448
+ });
1449
+ }
1450
+ oop.inherits(HtmlBehaviour, XmlBehaviour);
1451
+
1452
+ exports.HtmlBehaviour = HtmlBehaviour;
1453
+ });
1454
+
1455
+ define('ace/mode/behaviour/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) {
1456
+
1457
+
1458
+ var oop = require("../../lib/oop");
1459
+ var Behaviour = require("../behaviour").Behaviour;
1460
+ var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
1461
+ var TokenIterator = require("../../token_iterator").TokenIterator;
1462
+
1463
+ function hasType(token, type) {
1464
+ var hasType = true;
1465
+ var typeList = token.type.split('.');
1466
+ var needleList = type.split('.');
1467
+ needleList.forEach(function(needle){
1468
+ if (typeList.indexOf(needle) == -1) {
1469
+ hasType = false;
1470
+ return false;
1471
+ }
1472
+ });
1473
+ return hasType;
1474
+ }
1475
+
1476
+ var XmlBehaviour = function () {
1477
+
1478
+ this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour
1479
+
1480
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
1481
+ if (text == '>') {
1482
+ var position = editor.getCursorPosition();
1483
+ var iterator = new TokenIterator(session, position.row, position.column);
1484
+ var token = iterator.getCurrentToken();
1485
+ var atCursor = false;
1486
+ if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){
1487
+ do {
1488
+ token = iterator.stepBackward();
1489
+ } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text')));
1490
+ } else {
1491
+ atCursor = true;
1492
+ }
1493
+ if (!token || !hasType(token, 'meta.tag-name') || iterator.stepBackward().value.match('/')) {
1494
+ return
1495
+ }
1496
+ var tag = token.value;
1497
+ if (atCursor){
1498
+ var tag = tag.substring(0, position.column - token.start);
1499
+ }
1500
+
1501
+ return {
1502
+ text: '>' + '</' + tag + '>',
1503
+ selection: [1, 1]
1504
+ }
1505
+ }
1506
+ });
1507
+
1508
+ this.add('autoindent', 'insertion', function (state, action, editor, session, text) {
1509
+ if (text == "\n") {
1510
+ var cursor = editor.getCursorPosition();
1511
+ var line = session.doc.getLine(cursor.row);
1512
+ var rightChars = line.substring(cursor.column, cursor.column + 2);
1513
+ if (rightChars == '</') {
1514
+ var indent = this.$getIndent(session.doc.getLine(cursor.row)) + session.getTabString();
1515
+ var next_indent = this.$getIndent(session.doc.getLine(cursor.row));
1516
+
1517
+ return {
1518
+ text: '\n' + indent + '\n' + next_indent,
1519
+ selection: [1, indent.length, 1, indent.length]
1520
+ }
1521
+ }
1522
+ }
1523
+ });
1524
+
1525
+ }
1526
+ oop.inherits(XmlBehaviour, Behaviour);
1527
+
1528
+ exports.XmlBehaviour = XmlBehaviour;
1529
+ });
1530
+
1531
+ define('ace/mode/folding/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/mixed', 'ace/mode/folding/xml', 'ace/mode/folding/cstyle'], function(require, exports, module) {
1532
+
1533
+
1534
+ var oop = require("../../lib/oop");
1535
+ var MixedFoldMode = require("./mixed").FoldMode;
1536
+ var XmlFoldMode = require("./xml").FoldMode;
1537
+ var CStyleFoldMode = require("./cstyle").FoldMode;
1538
+
1539
+ var FoldMode = exports.FoldMode = function() {
1540
+ MixedFoldMode.call(this, new XmlFoldMode({
1541
+ "area": 1,
1542
+ "base": 1,
1543
+ "br": 1,
1544
+ "col": 1,
1545
+ "command": 1,
1546
+ "embed": 1,
1547
+ "hr": 1,
1548
+ "img": 1,
1549
+ "input": 1,
1550
+ "keygen": 1,
1551
+ "link": 1,
1552
+ "meta": 1,
1553
+ "param": 1,
1554
+ "source": 1,
1555
+ "track": 1,
1556
+ "wbr": 1,
1557
+ "li": 1,
1558
+ "dt": 1,
1559
+ "dd": 1,
1560
+ "p": 1,
1561
+ "rt": 1,
1562
+ "rp": 1,
1563
+ "optgroup": 1,
1564
+ "option": 1,
1565
+ "colgroup": 1,
1566
+ "td": 1,
1567
+ "th": 1
1568
+ }), {
1569
+ "js-": new CStyleFoldMode(),
1570
+ "css-": new CStyleFoldMode()
1571
+ });
1572
+ };
1573
+
1574
+ oop.inherits(FoldMode, MixedFoldMode);
1575
+
1576
+ });
1577
+
1578
+ define('ace/mode/folding/mixed', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
1579
+
1580
+
1581
+ var oop = require("../../lib/oop");
1582
+ var BaseFoldMode = require("./fold_mode").FoldMode;
1583
+
1584
+ var FoldMode = exports.FoldMode = function(defaultMode, subModes) {
1585
+ this.defaultMode = defaultMode;
1586
+ this.subModes = subModes;
1587
+ };
1588
+ oop.inherits(FoldMode, BaseFoldMode);
1589
+
1590
+ (function() {
1591
+
1592
+
1593
+ this.$getMode = function(state) {
1594
+ for (var key in this.subModes) {
1595
+ if (state.indexOf(key) === 0)
1596
+ return this.subModes[key];
1597
+ }
1598
+ return null;
1599
+ };
1600
+
1601
+ this.$tryMode = function(state, session, foldStyle, row) {
1602
+ var mode = this.$getMode(state);
1603
+ return (mode ? mode.getFoldWidget(session, foldStyle, row) : "");
1604
+ };
1605
+
1606
+ this.getFoldWidget = function(session, foldStyle, row) {
1607
+ return (
1608
+ this.$tryMode(session.getState(row-1), session, foldStyle, row) ||
1609
+ this.$tryMode(session.getState(row), session, foldStyle, row) ||
1610
+ this.defaultMode.getFoldWidget(session, foldStyle, row)
1611
+ );
1612
+ };
1613
+
1614
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
1615
+ var mode = this.$getMode(session.getState(row-1));
1616
+
1617
+ if (!mode || !mode.getFoldWidget(session, foldStyle, row))
1618
+ mode = this.$getMode(session.getState(row));
1619
+
1620
+ if (!mode || !mode.getFoldWidget(session, foldStyle, row))
1621
+ mode = this.defaultMode;
1622
+
1623
+ return mode.getFoldWidgetRange(session, foldStyle, row);
1624
+ };
1625
+
1626
+ }).call(FoldMode.prototype);
1627
+
1628
+ });
1629
+
1630
+ 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) {
1631
+
1632
+
1633
+ var oop = require("../../lib/oop");
1634
+ var lang = require("../../lib/lang");
1635
+ var Range = require("../../range").Range;
1636
+ var BaseFoldMode = require("./fold_mode").FoldMode;
1637
+ var TokenIterator = require("../../token_iterator").TokenIterator;
1638
+
1639
+ var FoldMode = exports.FoldMode = function(voidElements) {
1640
+ BaseFoldMode.call(this);
1641
+ this.voidElements = voidElements || {};
1642
+ };
1643
+ oop.inherits(FoldMode, BaseFoldMode);
1644
+
1645
+ (function() {
1646
+
1647
+ this.getFoldWidget = function(session, foldStyle, row) {
1648
+ var tag = this._getFirstTagInLine(session, row);
1649
+
1650
+ if (tag.closing)
1651
+ return foldStyle == "markbeginend" ? "end" : "";
1652
+
1653
+ if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()])
1654
+ return "";
1655
+
1656
+ if (tag.selfClosing)
1657
+ return "";
1658
+
1659
+ if (tag.value.indexOf("/" + tag.tagName) !== -1)
1660
+ return "";
1661
+
1662
+ return "start";
1663
+ };
1664
+
1665
+ this._getFirstTagInLine = function(session, row) {
1666
+ var tokens = session.getTokens(row);
1667
+ var value = "";
1668
+ for (var i = 0; i < tokens.length; i++) {
1669
+ var token = tokens[i];
1670
+ if (token.type.indexOf("meta.tag") === 0)
1671
+ value += token.value;
1672
+ else
1673
+ value += lang.stringRepeat(" ", token.value.length);
1674
+ }
1675
+
1676
+ return this._parseTag(value);
1677
+ };
1678
+
1679
+ this.tagRe = /^(\s*)(<?(\/?)([-_a-zA-Z0-9:!]*)\s*(\/?)>?)/;
1680
+ this._parseTag = function(tag) {
1681
+
1682
+ var match = this.tagRe.exec(tag);
1683
+ var column = this.tagRe.lastIndex || 0;
1684
+ this.tagRe.lastIndex = 0;
1685
+
1686
+ return {
1687
+ value: tag,
1688
+ match: match ? match[2] : "",
1689
+ closing: match ? !!match[3] : false,
1690
+ selfClosing: match ? !!match[5] || match[2] == "/>" : false,
1691
+ tagName: match ? match[4] : "",
1692
+ column: match[1] ? column + match[1].length : column
1693
+ };
1694
+ };
1695
+ this._readTagForward = function(iterator) {
1696
+ var token = iterator.getCurrentToken();
1697
+ if (!token)
1698
+ return null;
1699
+
1700
+ var value = "";
1701
+ var start;
1702
+
1703
+ do {
1704
+ if (token.type.indexOf("meta.tag") === 0) {
1705
+ if (!start) {
1706
+ var start = {
1707
+ row: iterator.getCurrentTokenRow(),
1708
+ column: iterator.getCurrentTokenColumn()
1709
+ };
1710
+ }
1711
+ value += token.value;
1712
+ if (value.indexOf(">") !== -1) {
1713
+ var tag = this._parseTag(value);
1714
+ tag.start = start;
1715
+ tag.end = {
1716
+ row: iterator.getCurrentTokenRow(),
1717
+ column: iterator.getCurrentTokenColumn() + token.value.length
1718
+ };
1719
+ iterator.stepForward();
1720
+ return tag;
1721
+ }
1722
+ }
1723
+ } while(token = iterator.stepForward());
1724
+
1725
+ return null;
1726
+ };
1727
+
1728
+ this._readTagBackward = function(iterator) {
1729
+ var token = iterator.getCurrentToken();
1730
+ if (!token)
1731
+ return null;
1732
+
1733
+ var value = "";
1734
+ var end;
1735
+
1736
+ do {
1737
+ if (token.type.indexOf("meta.tag") === 0) {
1738
+ if (!end) {
1739
+ end = {
1740
+ row: iterator.getCurrentTokenRow(),
1741
+ column: iterator.getCurrentTokenColumn() + token.value.length
1742
+ };
1743
+ }
1744
+ value = token.value + value;
1745
+ if (value.indexOf("<") !== -1) {
1746
+ var tag = this._parseTag(value);
1747
+ tag.end = end;
1748
+ tag.start = {
1749
+ row: iterator.getCurrentTokenRow(),
1750
+ column: iterator.getCurrentTokenColumn()
1751
+ };
1752
+ iterator.stepBackward();
1753
+ return tag;
1754
+ }
1755
+ }
1756
+ } while(token = iterator.stepBackward());
1757
+
1758
+ return null;
1759
+ };
1760
+
1761
+ this._pop = function(stack, tag) {
1762
+ while (stack.length) {
1763
+
1764
+ var top = stack[stack.length-1];
1765
+ if (!tag || top.tagName == tag.tagName) {
1766
+ return stack.pop();
1767
+ }
1768
+ else if (this.voidElements[tag.tagName]) {
1769
+ return;
1770
+ }
1771
+ else if (this.voidElements[top.tagName]) {
1772
+ stack.pop();
1773
+ continue;
1774
+ } else {
1775
+ return null;
1776
+ }
1777
+ }
1778
+ };
1779
+
1780
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
1781
+ var firstTag = this._getFirstTagInLine(session, row);
1782
+
1783
+ if (!firstTag.match)
1784
+ return null;
1785
+
1786
+ var isBackward = firstTag.closing || firstTag.selfClosing;
1787
+ var stack = [];
1788
+ var tag;
1789
+
1790
+ if (!isBackward) {
1791
+ var iterator = new TokenIterator(session, row, firstTag.column);
1792
+ var start = {
1793
+ row: row,
1794
+ column: firstTag.column + firstTag.tagName.length + 2
1795
+ };
1796
+ while (tag = this._readTagForward(iterator)) {
1797
+ if (tag.selfClosing) {
1798
+ if (!stack.length) {
1799
+ tag.start.column += tag.tagName.length + 2;
1800
+ tag.end.column -= 2;
1801
+ return Range.fromPoints(tag.start, tag.end);
1802
+ } else
1803
+ continue;
1804
+ }
1805
+
1806
+ if (tag.closing) {
1807
+ this._pop(stack, tag);
1808
+ if (stack.length == 0)
1809
+ return Range.fromPoints(start, tag.start);
1810
+ }
1811
+ else {
1812
+ stack.push(tag)
1813
+ }
1814
+ }
1815
+ }
1816
+ else {
1817
+ var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length);
1818
+ var end = {
1819
+ row: row,
1820
+ column: firstTag.column
1821
+ };
1822
+
1823
+ while (tag = this._readTagBackward(iterator)) {
1824
+ if (tag.selfClosing) {
1825
+ if (!stack.length) {
1826
+ tag.start.column += tag.tagName.length + 2;
1827
+ tag.end.column -= 2;
1828
+ return Range.fromPoints(tag.start, tag.end);
1829
+ } else
1830
+ continue;
1831
+ }
1832
+
1833
+ if (!tag.closing) {
1834
+ this._pop(stack, tag);
1835
+ if (stack.length == 0) {
1836
+ tag.start.column += tag.tagName.length + 2;
1837
+ return Range.fromPoints(tag.start, end);
1838
+ }
1839
+ }
1840
+ else {
1841
+ stack.push(tag)
1842
+ }
1843
+ }
1844
+ }
1845
+
1846
+ };
1847
+
1848
+ }).call(FoldMode.prototype);
1849
+
1850
+ });