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,189 @@
1
+ /*
2
+ * rdoc.js
3
+ *
4
+ * Copyright (C) 2009-11 by RStudio, Inc.
5
+ *
6
+ * This program is licensed to you under the terms of version 3 of the
7
+ * GNU Affero General Public License. This program is distributed WITHOUT
8
+ * ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT,
9
+ * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the
10
+ * AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details.
11
+ *
12
+ */
13
+ define('ace/mode/rdoc', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/text_highlight_rules', 'ace/mode/rdoc_highlight_rules', 'ace/mode/matching_brace_outdent'], function(require, exports, module) {
14
+
15
+
16
+ var oop = require("../lib/oop");
17
+ var TextMode = require("./text").Mode;
18
+ var Tokenizer = require("../tokenizer").Tokenizer;
19
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
20
+ var RDocHighlightRules = require("./rdoc_highlight_rules").RDocHighlightRules;
21
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
22
+
23
+ var Mode = function(suppressHighlighting) {
24
+ this.$tokenizer = new Tokenizer(new RDocHighlightRules().getRules());
25
+ this.$outdent = new MatchingBraceOutdent();
26
+ };
27
+ oop.inherits(Mode, TextMode);
28
+
29
+ (function() {
30
+ this.getNextLineIndent = function(state, line, tab) {
31
+ return this.$getIndent(line);
32
+ };
33
+ }).call(Mode.prototype);
34
+
35
+ exports.Mode = Mode;
36
+ });
37
+ define('ace/mode/rdoc_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules', 'ace/mode/latex_highlight_rules'], function(require, exports, module) {
38
+
39
+
40
+ var oop = require("../lib/oop");
41
+ var lang = require("../lib/lang");
42
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
43
+ var LaTeXHighlightRules = require("./latex_highlight_rules");
44
+
45
+ var RDocHighlightRules = function() {
46
+
47
+ this.$rules = {
48
+ "start" : [
49
+ {
50
+ token : "comment",
51
+ regex : "%.*$"
52
+ }, {
53
+ token : "text", // non-command
54
+ regex : "\\\\[$&%#\\{\\}]"
55
+ }, {
56
+ token : "keyword", // command
57
+ regex : "\\\\(?:name|alias|method|S3method|S4method|item|code|preformatted|kbd|pkg|var|env|option|command|author|email|url|source|cite|acronym|href|code|preformatted|link|eqn|deqn|keyword|usage|examples|dontrun|dontshow|figure|if|ifelse|Sexpr|RdOpts|inputencoding|usepackage)\\b",
58
+ next : "nospell"
59
+ }, {
60
+ token : "keyword", // command
61
+ regex : "\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])"
62
+ }, {
63
+ token : "paren.keyword.operator",
64
+ regex : "[[({]"
65
+ }, {
66
+ token : "paren.keyword.operator",
67
+ regex : "[\\])}]"
68
+ }, {
69
+ token : "text",
70
+ regex : "\\s+"
71
+ }
72
+ ],
73
+ "nospell" : [
74
+ {
75
+ token : "comment",
76
+ regex : "%.*$",
77
+ next : "start"
78
+ }, {
79
+ token : "nospell.text", // non-command
80
+ regex : "\\\\[$&%#\\{\\}]"
81
+ }, {
82
+ token : "keyword", // command
83
+ regex : "\\\\(?:name|alias|method|S3method|S4method|item|code|preformatted|kbd|pkg|var|env|option|command|author|email|url|source|cite|acronym|href|code|preformatted|link|eqn|deqn|keyword|usage|examples|dontrun|dontshow|figure|if|ifelse|Sexpr|RdOpts|inputencoding|usepackage)\\b"
84
+ }, {
85
+ token : "keyword", // command
86
+ regex : "\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])",
87
+ next : "start"
88
+ }, {
89
+ token : "paren.keyword.operator",
90
+ regex : "[[({]"
91
+ }, {
92
+ token : "paren.keyword.operator",
93
+ regex : "[\\])]"
94
+ }, {
95
+ token : "paren.keyword.operator",
96
+ regex : "}",
97
+ next : "start"
98
+ }, {
99
+ token : "nospell.text",
100
+ regex : "\\s+"
101
+ }, {
102
+ token : "nospell.text",
103
+ regex : "\\w+"
104
+ }
105
+ ]
106
+ };
107
+ };
108
+
109
+ oop.inherits(RDocHighlightRules, TextHighlightRules);
110
+
111
+ exports.RDocHighlightRules = RDocHighlightRules;
112
+ });
113
+ define('ace/mode/latex_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
114
+
115
+
116
+ var oop = require("../lib/oop");
117
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
118
+
119
+ var LatexHighlightRules = function() {
120
+ this.$rules = {
121
+ "start" : [{
122
+ token : "keyword",
123
+ regex : "\\\\(?:[^a-zA-Z]|[a-zA-Z]+)"
124
+ }, {
125
+ token : "lparen",
126
+ regex : "[[({]"
127
+ }, {
128
+ token : "rparen",
129
+ regex : "[\\])}]"
130
+ }, {
131
+ token : "string",
132
+ regex : "\\$(?:(?:\\\\.)|(?:[^\\$\\\\]))*?\\$"
133
+ }, {
134
+ token : "comment",
135
+ regex : "%.*$"
136
+ }]
137
+ };
138
+ };
139
+
140
+ oop.inherits(LatexHighlightRules, TextHighlightRules);
141
+
142
+ exports.LatexHighlightRules = LatexHighlightRules;
143
+
144
+ });
145
+
146
+ define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
147
+
148
+
149
+ var Range = require("../range").Range;
150
+
151
+ var MatchingBraceOutdent = function() {};
152
+
153
+ (function() {
154
+
155
+ this.checkOutdent = function(line, input) {
156
+ if (! /^\s+$/.test(line))
157
+ return false;
158
+
159
+ return /^\s*\}/.test(input);
160
+ };
161
+
162
+ this.autoOutdent = function(doc, row) {
163
+ var line = doc.getLine(row);
164
+ var match = line.match(/^(\s*\})/);
165
+
166
+ if (!match) return 0;
167
+
168
+ var column = match[1].length;
169
+ var openBracePos = doc.findMatchingBracket({row: row, column: column});
170
+
171
+ if (!openBracePos || openBracePos.row == row) return 0;
172
+
173
+ var indent = this.$getIndent(doc.getLine(openBracePos.row));
174
+ doc.replace(new Range(row, 0, row, column-1), indent);
175
+ };
176
+
177
+ this.$getIndent = function(line) {
178
+ var match = line.match(/^(\s+)/);
179
+ if (match) {
180
+ return match[1];
181
+ }
182
+
183
+ return "";
184
+ };
185
+
186
+ }).call(MatchingBraceOutdent.prototype);
187
+
188
+ exports.MatchingBraceOutdent = MatchingBraceOutdent;
189
+ });
@@ -0,0 +1,2138 @@
1
+ /*
2
+ * rhtml.js
3
+ *
4
+ * Copyright (C) 2009-11 by RStudio, Inc.
5
+ *
6
+ * The Initial Developer of the Original Code is
7
+ * Ajax.org B.V.
8
+ * Portions created by the Initial Developer are Copyright (C) 2010
9
+ * the Initial Developer. All Rights Reserved.
10
+ *
11
+ * This program is licensed to you under the terms of version 3 of the
12
+ * GNU Affero General Public License. This program is distributed WITHOUT
13
+ * ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT,
14
+ * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the
15
+ * AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details.
16
+ *
17
+ */
18
+
19
+ define('ace/mode/rhtml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/html', 'ace/tokenizer', 'ace/mode/rhtml_highlight_rules'], function(require, exports, module) {
20
+
21
+
22
+ var oop = require("../lib/oop");
23
+ var HtmlMode = require("./html").Mode;
24
+ var Tokenizer = require("../tokenizer").Tokenizer;
25
+
26
+ var RHtmlHighlightRules = require("./rhtml_highlight_rules").RHtmlHighlightRules;
27
+
28
+ var Mode = function(doc, session) {
29
+ this.$session = session;
30
+ this.$tokenizer = new Tokenizer(new RHtmlHighlightRules().getRules());
31
+ };
32
+ oop.inherits(Mode, HtmlMode);
33
+
34
+ (function() {
35
+ this.insertChunkInfo = {
36
+ value: "<!--begin.rcode\n\nend.rcode-->\n",
37
+ position: {row: 0, column: 15}
38
+ };
39
+
40
+ this.getLanguageMode = function(position)
41
+ {
42
+ return this.$session.getState(position.row).match(/^r-/) ? 'R' : 'HTML';
43
+ };
44
+
45
+ this.getNextLineIndent = function(state, line, tab, tabSize, row)
46
+ {
47
+ return this.codeModel.getNextLineIndent(row, line, state, tab, tabSize);
48
+ };
49
+
50
+ }).call(Mode.prototype);
51
+
52
+ exports.Mode = Mode;
53
+ });
54
+
55
+ 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) {
56
+
57
+
58
+ var oop = require("../lib/oop");
59
+ var TextMode = require("./text").Mode;
60
+ var JavaScriptMode = require("./javascript").Mode;
61
+ var CssMode = require("./css").Mode;
62
+ var Tokenizer = require("../tokenizer").Tokenizer;
63
+ var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
64
+ var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour;
65
+ var HtmlFoldMode = require("./folding/html").FoldMode;
66
+
67
+ var Mode = function() {
68
+ var highlighter = new HtmlHighlightRules();
69
+ this.$tokenizer = new Tokenizer(highlighter.getRules());
70
+ this.$behaviour = new HtmlBehaviour();
71
+
72
+ this.$embeds = highlighter.getEmbeds();
73
+ this.createModeDelegates({
74
+ "js-": JavaScriptMode,
75
+ "css-": CssMode
76
+ });
77
+
78
+ this.foldingRules = new HtmlFoldMode();
79
+ };
80
+ oop.inherits(Mode, TextMode);
81
+
82
+ (function() {
83
+
84
+
85
+ this.toggleCommentLines = function(state, doc, startRow, endRow) {
86
+ return 0;
87
+ };
88
+
89
+ this.getNextLineIndent = function(state, line, tab) {
90
+ return this.$getIndent(line);
91
+ };
92
+
93
+ this.checkOutdent = function(state, line, input) {
94
+ return false;
95
+ };
96
+
97
+ }).call(Mode.prototype);
98
+
99
+ exports.Mode = Mode;
100
+ });
101
+
102
+ 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) {
103
+
104
+
105
+ var oop = require("../lib/oop");
106
+ var TextMode = require("./text").Mode;
107
+ var Tokenizer = require("../tokenizer").Tokenizer;
108
+ var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
109
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
110
+ var Range = require("../range").Range;
111
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
112
+ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
113
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
114
+
115
+ var Mode = function() {
116
+ this.$tokenizer = new Tokenizer(new JavaScriptHighlightRules().getRules());
117
+ this.$outdent = new MatchingBraceOutdent();
118
+ this.$behaviour = new CstyleBehaviour();
119
+ this.foldingRules = new CStyleFoldMode();
120
+ };
121
+ oop.inherits(Mode, TextMode);
122
+
123
+ (function() {
124
+
125
+
126
+ this.toggleCommentLines = function(state, doc, startRow, endRow) {
127
+ var outdent = true;
128
+ var re = /^(\s*)\/\//;
129
+
130
+ for (var i=startRow; i<= endRow; i++) {
131
+ if (!re.test(doc.getLine(i))) {
132
+ outdent = false;
133
+ break;
134
+ }
135
+ }
136
+
137
+ if (outdent) {
138
+ var deleteRange = new Range(0, 0, 0, 0);
139
+ for (var i=startRow; i<= endRow; i++)
140
+ {
141
+ var line = doc.getLine(i);
142
+ var m = line.match(re);
143
+ deleteRange.start.row = i;
144
+ deleteRange.end.row = i;
145
+ deleteRange.end.column = m[0].length;
146
+ doc.replace(deleteRange, m[1]);
147
+ }
148
+ }
149
+ else {
150
+ doc.indentRows(startRow, endRow, "//");
151
+ }
152
+ };
153
+
154
+ this.getNextLineIndent = function(state, line, tab) {
155
+ var indent = this.$getIndent(line);
156
+
157
+ var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
158
+ var tokens = tokenizedLine.tokens;
159
+ var endState = tokenizedLine.state;
160
+
161
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
162
+ return indent;
163
+ }
164
+
165
+ if (state == "start" || state == "regex_allowed") {
166
+ var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
167
+ if (match) {
168
+ indent += tab;
169
+ }
170
+ } else if (state == "doc-start") {
171
+ if (endState == "start" || state == "regex_allowed") {
172
+ return "";
173
+ }
174
+ var match = line.match(/^\s*(\/?)\*/);
175
+ if (match) {
176
+ if (match[1]) {
177
+ indent += " ";
178
+ }
179
+ indent += "* ";
180
+ }
181
+ }
182
+
183
+ return indent;
184
+ };
185
+
186
+ this.checkOutdent = function(state, line, input) {
187
+ return this.$outdent.checkOutdent(line, input);
188
+ };
189
+
190
+ this.autoOutdent = function(state, doc, row) {
191
+ this.$outdent.autoOutdent(doc, row);
192
+ };
193
+
194
+ this.createWorker = function(session) {
195
+ var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
196
+ worker.attachToDocument(session.getDocument());
197
+
198
+ worker.on("jslint", function(results) {
199
+ session.setAnnotations(results.data);
200
+ });
201
+
202
+ worker.on("terminate", function() {
203
+ session.clearAnnotations();
204
+ });
205
+
206
+ return worker;
207
+ };
208
+
209
+ }).call(Mode.prototype);
210
+
211
+ exports.Mode = Mode;
212
+ });
213
+
214
+ 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) {
215
+
216
+
217
+ var oop = require("../lib/oop");
218
+ var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
219
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
220
+
221
+ var JavaScriptHighlightRules = function() {
222
+ var keywordMapper = this.createKeywordMapper({
223
+ "variable.language":
224
+ "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
225
+ "Namespace|QName|XML|XMLList|" + // E4X
226
+ "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
227
+ "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
228
+ "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
229
+ "SyntaxError|TypeError|URIError|" +
230
+ "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
231
+ "isNaN|parseFloat|parseInt|" +
232
+ "JSON|Math|" + // Other
233
+ "this|arguments|prototype|window|document" , // Pseudo
234
+ "keyword":
235
+ "const|yield|import|get|set|" +
236
+ "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
237
+ "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
238
+ "__parent__|__count__|escape|unescape|with|__proto__|" +
239
+ "class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
240
+ "storage.type":
241
+ "const|let|var|function",
242
+ "constant.language":
243
+ "null|Infinity|NaN|undefined",
244
+ "support.function":
245
+ "alert"
246
+ }, "identifier");
247
+ var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
248
+ var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
249
+
250
+ var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
251
+ "u[0-9a-fA-F]{4}|" + // unicode
252
+ "[0-2][0-7]{0,2}|" + // oct
253
+ "3[0-6][0-7]?|" + // oct
254
+ "37[0-7]?|" + // oct
255
+ "[4-7][0-7]?|" + //oct
256
+ ".)";
257
+
258
+ this.$rules = {
259
+ "start" : [
260
+ {
261
+ token : "comment",
262
+ regex : /\/\/.*$/
263
+ },
264
+ DocCommentHighlightRules.getStartRule("doc-start"),
265
+ {
266
+ token : "comment", // multi line comment
267
+ regex : /\/\*/,
268
+ next : "comment"
269
+ }, {
270
+ token : "string",
271
+ regex : "'(?=.)",
272
+ next : "qstring"
273
+ }, {
274
+ token : "string",
275
+ regex : '"(?=.)',
276
+ next : "qqstring"
277
+ }, {
278
+ token : "constant.numeric", // hex
279
+ regex : /0[xX][0-9a-fA-F]+\b/
280
+ }, {
281
+ token : "constant.numeric", // float
282
+ regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
283
+ }, {
284
+ token : [
285
+ "storage.type", "punctuation.operator", "support.function",
286
+ "punctuation.operator", "entity.name.function", "text","keyword.operator"
287
+ ],
288
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
289
+ next: "function_arguments"
290
+ }, {
291
+ token : [
292
+ "storage.type", "punctuation.operator", "entity.name.function", "text",
293
+ "keyword.operator", "text", "storage.type", "text", "paren.lparen"
294
+ ],
295
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
296
+ next: "function_arguments"
297
+ }, {
298
+ token : [
299
+ "entity.name.function", "text", "keyword.operator", "text", "storage.type",
300
+ "text", "paren.lparen"
301
+ ],
302
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
303
+ next: "function_arguments"
304
+ }, {
305
+ token : [
306
+ "storage.type", "punctuation.operator", "entity.name.function", "text",
307
+ "keyword.operator", "text",
308
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
309
+ ],
310
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
311
+ next: "function_arguments"
312
+ }, {
313
+ token : [
314
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
315
+ ],
316
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
317
+ next: "function_arguments"
318
+ }, {
319
+ token : [
320
+ "entity.name.function", "text", "punctuation.operator",
321
+ "text", "storage.type", "text", "paren.lparen"
322
+ ],
323
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
324
+ next: "function_arguments"
325
+ }, {
326
+ token : [
327
+ "text", "text", "storage.type", "text", "paren.lparen"
328
+ ],
329
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
330
+ next: "function_arguments"
331
+ }, {
332
+ token : "constant.language.boolean",
333
+ regex : /(?:true|false)\b/
334
+ }, {
335
+ token : "keyword",
336
+ regex : "(?:" + kwBeforeRe + ")\\b",
337
+ next : "regex_allowed"
338
+ }, {
339
+ token : ["punctuation.operator", "support.function"],
340
+ 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(?=\()/
341
+ }, {
342
+ token : ["punctuation.operator", "support.function.dom"],
343
+ 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(?=\()/
344
+ }, {
345
+ token : ["punctuation.operator", "support.constant"],
346
+ 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/
347
+ }, {
348
+ token : ["storage.type", "punctuation.operator", "support.function.firebug"],
349
+ regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
350
+ }, {
351
+ token : keywordMapper,
352
+ regex : identifierRe
353
+ }, {
354
+ token : "keyword.operator",
355
+ regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/,
356
+ next : "regex_allowed"
357
+ }, {
358
+ token : "punctuation.operator",
359
+ regex : /\?|\:|\,|\;|\./,
360
+ next : "regex_allowed"
361
+ }, {
362
+ token : "paren.lparen",
363
+ regex : /[\[({]/,
364
+ next : "regex_allowed"
365
+ }, {
366
+ token : "paren.rparen",
367
+ regex : /[\])}]/
368
+ }, {
369
+ token : "keyword.operator",
370
+ regex : /\/=?/,
371
+ next : "regex_allowed"
372
+ }, {
373
+ token: "comment",
374
+ regex: /^#!.*$/
375
+ }, {
376
+ token : "text",
377
+ regex : /\s+/
378
+ }
379
+ ],
380
+ "regex_allowed": [
381
+ DocCommentHighlightRules.getStartRule("doc-start"),
382
+ {
383
+ token : "comment", // multi line comment
384
+ regex : "\\/\\*",
385
+ next : "comment_regex_allowed"
386
+ }, {
387
+ token : "comment",
388
+ regex : "\\/\\/.*$"
389
+ }, {
390
+ token: "string.regexp",
391
+ regex: "\\/",
392
+ next: "regex",
393
+ }, {
394
+ token : "text",
395
+ regex : "\\s+"
396
+ }, {
397
+ token: "empty",
398
+ regex: "",
399
+ next: "start"
400
+ }
401
+ ],
402
+ "regex": [
403
+ {
404
+ token: "regexp.keyword.operator",
405
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
406
+ }, {
407
+ token: "string.regexp",
408
+ regex: "/\\w*",
409
+ next: "start",
410
+ }, {
411
+ token : "invalid",
412
+ regex: /\{\d+,?(?:\d+)?}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
413
+ }, {
414
+ token : "constant.language.escape",
415
+ regex: /\(\?[:=!]|\)|{\d+,?(?:\d+)?}|{,\d+}|[+*]\?|[(|)$^+*?]/
416
+ }, {
417
+ token: "string.regexp",
418
+ regex: /{|[^{\[\/\\(|)$^+*?]+/,
419
+ }, {
420
+ token: "constant.language.escape",
421
+ regex: /\[\^?/,
422
+ next: "regex_character_class",
423
+ }, {
424
+ token: "empty",
425
+ regex: "",
426
+ next: "start"
427
+ }
428
+ ],
429
+ "regex_character_class": [
430
+ {
431
+ token: "regexp.keyword.operator",
432
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
433
+ }, {
434
+ token: "constant.language.escape",
435
+ regex: "]",
436
+ next: "regex",
437
+ }, {
438
+ token: "constant.language.escape",
439
+ regex: "-"
440
+ }, {
441
+ token: "string.regexp.charachterclass",
442
+ regex: /[^\]\-\\]+/,
443
+ }, {
444
+ token: "empty",
445
+ regex: "",
446
+ next: "start"
447
+ }
448
+ ],
449
+ "function_arguments": [
450
+ {
451
+ token: "variable.parameter",
452
+ regex: identifierRe
453
+ }, {
454
+ token: "punctuation.operator",
455
+ regex: "[, ]+",
456
+ }, {
457
+ token: "punctuation.operator",
458
+ regex: "$",
459
+ }, {
460
+ token: "empty",
461
+ regex: "",
462
+ next: "start"
463
+ }
464
+ ],
465
+ "comment_regex_allowed" : [
466
+ {
467
+ token : "comment", // closing comment
468
+ regex : ".*?\\*\\/",
469
+ next : "regex_allowed"
470
+ }, {
471
+ token : "comment", // comment spanning whole line
472
+ regex : ".+"
473
+ }
474
+ ],
475
+ "comment" : [
476
+ {
477
+ token : "comment", // closing comment
478
+ regex : ".*?\\*\\/",
479
+ next : "start"
480
+ }, {
481
+ token : "comment", // comment spanning whole line
482
+ regex : ".+"
483
+ }
484
+ ],
485
+ "qqstring" : [
486
+ {
487
+ token : "constant.language.escape",
488
+ regex : escapedRe
489
+ }, {
490
+ token : "string",
491
+ regex : "\\\\$",
492
+ next : "qqstring",
493
+ }, {
494
+ token : "string",
495
+ regex : '"|$',
496
+ next : "start",
497
+ }, {
498
+ token : "string",
499
+ regex : '.|\\w+|\\s+',
500
+ }
501
+ ],
502
+ "qstring" : [
503
+ {
504
+ token : "constant.language.escape",
505
+ regex : escapedRe
506
+ }, {
507
+ token : "string",
508
+ regex : "\\\\$",
509
+ next : "qstring",
510
+ }, {
511
+ token : "string",
512
+ regex : "'|$",
513
+ next : "start",
514
+ }, {
515
+ token : "string",
516
+ regex : '.|\\w+|\\s+',
517
+ }
518
+ ]
519
+ };
520
+
521
+ this.embedRules(DocCommentHighlightRules, "doc-",
522
+ [ DocCommentHighlightRules.getEndRule("start") ]);
523
+ };
524
+
525
+ oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
526
+
527
+ exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
528
+ });
529
+
530
+ define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
531
+
532
+
533
+ var oop = require("../lib/oop");
534
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
535
+
536
+ var DocCommentHighlightRules = function() {
537
+
538
+ this.$rules = {
539
+ "start" : [ {
540
+ token : "comment.doc.tag",
541
+ regex : "@[\\w\\d_]+" // TODO: fix email addresses
542
+ }, {
543
+ token : "comment.doc",
544
+ regex : "\\s+"
545
+ }, {
546
+ token : "comment.doc",
547
+ regex : "TODO"
548
+ }, {
549
+ token : "comment.doc",
550
+ regex : "[^@\\*]+"
551
+ }, {
552
+ token : "comment.doc",
553
+ regex : "."
554
+ }]
555
+ };
556
+ };
557
+
558
+ oop.inherits(DocCommentHighlightRules, TextHighlightRules);
559
+
560
+ DocCommentHighlightRules.getStartRule = function(start) {
561
+ return {
562
+ token : "comment.doc", // doc comment
563
+ regex : "\\/\\*(?=\\*)",
564
+ next : start
565
+ };
566
+ };
567
+
568
+ DocCommentHighlightRules.getEndRule = function (start) {
569
+ return {
570
+ token : "comment.doc", // closing comment
571
+ regex : "\\*\\/",
572
+ next : start
573
+ };
574
+ };
575
+
576
+
577
+ exports.DocCommentHighlightRules = DocCommentHighlightRules;
578
+
579
+ });
580
+
581
+ define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
582
+
583
+
584
+ var Range = require("../range").Range;
585
+
586
+ var MatchingBraceOutdent = function() {};
587
+
588
+ (function() {
589
+
590
+ this.checkOutdent = function(line, input) {
591
+ if (! /^\s+$/.test(line))
592
+ return false;
593
+
594
+ return /^\s*\}/.test(input);
595
+ };
596
+
597
+ this.autoOutdent = function(doc, row) {
598
+ var line = doc.getLine(row);
599
+ var match = line.match(/^(\s*\})/);
600
+
601
+ if (!match) return 0;
602
+
603
+ var column = match[1].length;
604
+ var openBracePos = doc.findMatchingBracket({row: row, column: column});
605
+
606
+ if (!openBracePos || openBracePos.row == row) return 0;
607
+
608
+ var indent = this.$getIndent(doc.getLine(openBracePos.row));
609
+ doc.replace(new Range(row, 0, row, column-1), indent);
610
+ };
611
+
612
+ this.$getIndent = function(line) {
613
+ var match = line.match(/^(\s+)/);
614
+ if (match) {
615
+ return match[1];
616
+ }
617
+
618
+ return "";
619
+ };
620
+
621
+ }).call(MatchingBraceOutdent.prototype);
622
+
623
+ exports.MatchingBraceOutdent = MatchingBraceOutdent;
624
+ });
625
+
626
+ define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) {
627
+
628
+
629
+ var oop = require("../../lib/oop");
630
+ var Behaviour = require("../behaviour").Behaviour;
631
+ var TokenIterator = require("../../token_iterator").TokenIterator;
632
+ var lang = require("../../lib/lang");
633
+
634
+ var SAFE_INSERT_IN_TOKENS =
635
+ ["text", "paren.rparen", "punctuation.operator"];
636
+ var SAFE_INSERT_BEFORE_TOKENS =
637
+ ["text", "paren.rparen", "punctuation.operator", "comment"];
638
+
639
+
640
+ var autoInsertedBrackets = 0;
641
+ var autoInsertedRow = -1;
642
+ var autoInsertedLineEnd = "";
643
+ var maybeInsertedBrackets = 0;
644
+ var maybeInsertedRow = -1;
645
+ var maybeInsertedLineStart = "";
646
+ var maybeInsertedLineEnd = "";
647
+
648
+ var CstyleBehaviour = function () {
649
+
650
+ CstyleBehaviour.isSaneInsertion = function(editor, session) {
651
+ var cursor = editor.getCursorPosition();
652
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
653
+ if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
654
+ var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
655
+ if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
656
+ return false;
657
+ }
658
+ iterator.stepForward();
659
+ return iterator.getCurrentTokenRow() !== cursor.row ||
660
+ this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
661
+ };
662
+
663
+ CstyleBehaviour.$matchTokenType = function(token, types) {
664
+ return types.indexOf(token.type || token) > -1;
665
+ };
666
+
667
+ CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
668
+ var cursor = editor.getCursorPosition();
669
+ var line = session.doc.getLine(cursor.row);
670
+ if (!this.isAutoInsertedClosing(cursor, line, autoInsertedLineEnd[0]))
671
+ autoInsertedBrackets = 0;
672
+ autoInsertedRow = cursor.row;
673
+ autoInsertedLineEnd = bracket + line.substr(cursor.column);
674
+ autoInsertedBrackets++;
675
+ };
676
+
677
+ CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
678
+ var cursor = editor.getCursorPosition();
679
+ var line = session.doc.getLine(cursor.row);
680
+ if (!this.isMaybeInsertedClosing(cursor, line))
681
+ maybeInsertedBrackets = 0;
682
+ maybeInsertedRow = cursor.row;
683
+ maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
684
+ maybeInsertedLineEnd = line.substr(cursor.column);
685
+ maybeInsertedBrackets++;
686
+ };
687
+
688
+ CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
689
+ return autoInsertedBrackets > 0 &&
690
+ cursor.row === autoInsertedRow &&
691
+ bracket === autoInsertedLineEnd[0] &&
692
+ line.substr(cursor.column) === autoInsertedLineEnd;
693
+ };
694
+
695
+ CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
696
+ return maybeInsertedBrackets > 0 &&
697
+ cursor.row === maybeInsertedRow &&
698
+ line.substr(cursor.column) === maybeInsertedLineEnd &&
699
+ line.substr(0, cursor.column) == maybeInsertedLineStart;
700
+ };
701
+
702
+ CstyleBehaviour.popAutoInsertedClosing = function() {
703
+ autoInsertedLineEnd = autoInsertedLineEnd.substr(1);
704
+ autoInsertedBrackets--;
705
+ };
706
+
707
+ CstyleBehaviour.clearMaybeInsertedClosing = function() {
708
+ maybeInsertedBrackets = 0;
709
+ maybeInsertedRow = -1;
710
+ };
711
+
712
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
713
+ var cursor = editor.getCursorPosition();
714
+ var line = session.doc.getLine(cursor.row);
715
+ if (text == '{') {
716
+ var selection = editor.getSelectionRange();
717
+ var selected = session.doc.getTextRange(selection);
718
+ if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
719
+ return {
720
+ text: '{' + selected + '}',
721
+ selection: false
722
+ };
723
+ } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
724
+ if (/[\]\}\)]/.test(line[cursor.column])) {
725
+ CstyleBehaviour.recordAutoInsert(editor, session, "}");
726
+ return {
727
+ text: '{}',
728
+ selection: [1, 1]
729
+ };
730
+ } else {
731
+ CstyleBehaviour.recordMaybeInsert(editor, session, "{");
732
+ return {
733
+ text: '{',
734
+ selection: [1, 1]
735
+ };
736
+ }
737
+ }
738
+ } else if (text == '}') {
739
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
740
+ if (rightChar == '}') {
741
+ var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
742
+ if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
743
+ CstyleBehaviour.popAutoInsertedClosing();
744
+ return {
745
+ text: '',
746
+ selection: [1, 1]
747
+ };
748
+ }
749
+ }
750
+ } else if (text == "\n" || text == "\r\n") {
751
+ var closing = "";
752
+ if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {
753
+ closing = lang.stringRepeat("}", maybeInsertedBrackets);
754
+ CstyleBehaviour.clearMaybeInsertedClosing();
755
+ }
756
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
757
+ if (rightChar == '}' || closing !== "") {
758
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column}, '}');
759
+ if (!openBracePos)
760
+ return null;
761
+
762
+ var indent = this.getNextLineIndent(state, line.substring(0, cursor.column), session.getTabString());
763
+ var next_indent = this.$getIndent(line);
764
+
765
+ return {
766
+ text: '\n' + indent + '\n' + next_indent + closing,
767
+ selection: [1, indent.length, 1, indent.length]
768
+ };
769
+ }
770
+ }
771
+ });
772
+
773
+ this.add("braces", "deletion", function (state, action, editor, session, range) {
774
+ var selected = session.doc.getTextRange(range);
775
+ if (!range.isMultiLine() && selected == '{') {
776
+ var line = session.doc.getLine(range.start.row);
777
+ var rightChar = line.substring(range.end.column, range.end.column + 1);
778
+ if (rightChar == '}') {
779
+ range.end.column++;
780
+ return range;
781
+ } else {
782
+ maybeInsertedBrackets--;
783
+ }
784
+ }
785
+ });
786
+
787
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
788
+ if (text == '(') {
789
+ var selection = editor.getSelectionRange();
790
+ var selected = session.doc.getTextRange(selection);
791
+ if (selected !== "" && editor.getWrapBehavioursEnabled()) {
792
+ return {
793
+ text: '(' + selected + ')',
794
+ selection: false
795
+ };
796
+ } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
797
+ CstyleBehaviour.recordAutoInsert(editor, session, ")");
798
+ return {
799
+ text: '()',
800
+ selection: [1, 1]
801
+ };
802
+ }
803
+ } else if (text == ')') {
804
+ var cursor = editor.getCursorPosition();
805
+ var line = session.doc.getLine(cursor.row);
806
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
807
+ if (rightChar == ')') {
808
+ var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
809
+ if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
810
+ CstyleBehaviour.popAutoInsertedClosing();
811
+ return {
812
+ text: '',
813
+ selection: [1, 1]
814
+ };
815
+ }
816
+ }
817
+ }
818
+ });
819
+
820
+ this.add("parens", "deletion", function (state, action, editor, session, range) {
821
+ var selected = session.doc.getTextRange(range);
822
+ if (!range.isMultiLine() && selected == '(') {
823
+ var line = session.doc.getLine(range.start.row);
824
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
825
+ if (rightChar == ')') {
826
+ range.end.column++;
827
+ return range;
828
+ }
829
+ }
830
+ });
831
+
832
+ this.add("brackets", "insertion", function (state, action, editor, session, text) {
833
+ if (text == '[') {
834
+ var selection = editor.getSelectionRange();
835
+ var selected = session.doc.getTextRange(selection);
836
+ if (selected !== "" && editor.getWrapBehavioursEnabled()) {
837
+ return {
838
+ text: '[' + selected + ']',
839
+ selection: false
840
+ };
841
+ } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
842
+ CstyleBehaviour.recordAutoInsert(editor, session, "]");
843
+ return {
844
+ text: '[]',
845
+ selection: [1, 1]
846
+ };
847
+ }
848
+ } else if (text == ']') {
849
+ var cursor = editor.getCursorPosition();
850
+ var line = session.doc.getLine(cursor.row);
851
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
852
+ if (rightChar == ']') {
853
+ var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row});
854
+ if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
855
+ CstyleBehaviour.popAutoInsertedClosing();
856
+ return {
857
+ text: '',
858
+ selection: [1, 1]
859
+ };
860
+ }
861
+ }
862
+ }
863
+ });
864
+
865
+ this.add("brackets", "deletion", function (state, action, editor, session, range) {
866
+ var selected = session.doc.getTextRange(range);
867
+ if (!range.isMultiLine() && selected == '[') {
868
+ var line = session.doc.getLine(range.start.row);
869
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
870
+ if (rightChar == ']') {
871
+ range.end.column++;
872
+ return range;
873
+ }
874
+ }
875
+ });
876
+
877
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
878
+ if (text == '"' || text == "'") {
879
+ var quote = text;
880
+ var selection = editor.getSelectionRange();
881
+ var selected = session.doc.getTextRange(selection);
882
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
883
+ return {
884
+ text: quote + selected + quote,
885
+ selection: false
886
+ };
887
+ } else {
888
+ var cursor = editor.getCursorPosition();
889
+ var line = session.doc.getLine(cursor.row);
890
+ var leftChar = line.substring(cursor.column-1, cursor.column);
891
+ if (leftChar == '\\') {
892
+ return null;
893
+ }
894
+ var tokens = session.getTokens(selection.start.row);
895
+ var col = 0, token;
896
+ var quotepos = -1; // Track whether we're inside an open quote.
897
+
898
+ for (var x = 0; x < tokens.length; x++) {
899
+ token = tokens[x];
900
+ if (token.type == "string") {
901
+ quotepos = -1;
902
+ } else if (quotepos < 0) {
903
+ quotepos = token.value.indexOf(quote);
904
+ }
905
+ if ((token.value.length + col) > selection.start.column) {
906
+ break;
907
+ }
908
+ col += tokens[x].value.length;
909
+ }
910
+ 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)))) {
911
+ if (!CstyleBehaviour.isSaneInsertion(editor, session))
912
+ return;
913
+ return {
914
+ text: quote + quote,
915
+ selection: [1,1]
916
+ };
917
+ } else if (token && token.type === "string") {
918
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
919
+ if (rightChar == quote) {
920
+ return {
921
+ text: '',
922
+ selection: [1, 1]
923
+ };
924
+ }
925
+ }
926
+ }
927
+ }
928
+ });
929
+
930
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
931
+ var selected = session.doc.getTextRange(range);
932
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
933
+ var line = session.doc.getLine(range.start.row);
934
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
935
+ if (rightChar == '"') {
936
+ range.end.column++;
937
+ return range;
938
+ }
939
+ }
940
+ });
941
+
942
+ };
943
+
944
+ oop.inherits(CstyleBehaviour, Behaviour);
945
+
946
+ exports.CstyleBehaviour = CstyleBehaviour;
947
+ });
948
+
949
+ define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
950
+
951
+
952
+ var oop = require("../../lib/oop");
953
+ var Range = require("../../range").Range;
954
+ var BaseFoldMode = require("./fold_mode").FoldMode;
955
+
956
+ var FoldMode = exports.FoldMode = function() {};
957
+ oop.inherits(FoldMode, BaseFoldMode);
958
+
959
+ (function() {
960
+
961
+ this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
962
+ this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
963
+
964
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
965
+ var line = session.getLine(row);
966
+ var match = line.match(this.foldingStartMarker);
967
+ if (match) {
968
+ var i = match.index;
969
+
970
+ if (match[1])
971
+ return this.openingBracketBlock(session, match[1], row, i);
972
+
973
+ return session.getCommentFoldRange(row, i + match[0].length, 1);
974
+ }
975
+
976
+ if (foldStyle !== "markbeginend")
977
+ return;
978
+
979
+ var match = line.match(this.foldingStopMarker);
980
+ if (match) {
981
+ var i = match.index + match[0].length;
982
+
983
+ if (match[1])
984
+ return this.closingBracketBlock(session, match[1], row, i);
985
+
986
+ return session.getCommentFoldRange(row, i, -1);
987
+ }
988
+ };
989
+
990
+ }).call(FoldMode.prototype);
991
+
992
+ });
993
+
994
+ 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) {
995
+
996
+
997
+ var oop = require("../lib/oop");
998
+ var TextMode = require("./text").Mode;
999
+ var Tokenizer = require("../tokenizer").Tokenizer;
1000
+ var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
1001
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
1002
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
1003
+ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
1004
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
1005
+
1006
+ var Mode = function() {
1007
+ this.$tokenizer = new Tokenizer(new CssHighlightRules().getRules(), "i");
1008
+ this.$outdent = new MatchingBraceOutdent();
1009
+ this.$behaviour = new CstyleBehaviour();
1010
+ this.foldingRules = new CStyleFoldMode();
1011
+ };
1012
+ oop.inherits(Mode, TextMode);
1013
+
1014
+ (function() {
1015
+
1016
+ this.foldingRules = "cStyle";
1017
+
1018
+ this.getNextLineIndent = function(state, line, tab) {
1019
+ var indent = this.$getIndent(line);
1020
+ var tokens = this.$tokenizer.getLineTokens(line, state).tokens;
1021
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
1022
+ return indent;
1023
+ }
1024
+
1025
+ var match = line.match(/^.*\{\s*$/);
1026
+ if (match) {
1027
+ indent += tab;
1028
+ }
1029
+
1030
+ return indent;
1031
+ };
1032
+
1033
+ this.checkOutdent = function(state, line, input) {
1034
+ return this.$outdent.checkOutdent(line, input);
1035
+ };
1036
+
1037
+ this.autoOutdent = function(state, doc, row) {
1038
+ this.$outdent.autoOutdent(doc, row);
1039
+ };
1040
+
1041
+ this.createWorker = function(session) {
1042
+ var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
1043
+ worker.attachToDocument(session.getDocument());
1044
+
1045
+ worker.on("csslint", function(e) {
1046
+ session.setAnnotations(e.data);
1047
+ });
1048
+
1049
+ worker.on("terminate", function() {
1050
+ session.clearAnnotations();
1051
+ });
1052
+
1053
+ return worker;
1054
+ };
1055
+
1056
+ }).call(Mode.prototype);
1057
+
1058
+ exports.Mode = Mode;
1059
+
1060
+ });
1061
+
1062
+ define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
1063
+
1064
+
1065
+ var oop = require("../lib/oop");
1066
+ var lang = require("../lib/lang");
1067
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1068
+ 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";
1069
+ var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
1070
+ 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";
1071
+ var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow";
1072
+ 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";
1073
+
1074
+ var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
1075
+ var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
1076
+ 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";
1077
+
1078
+ var CssHighlightRules = function() {
1079
+
1080
+ var keywordMapper = this.createKeywordMapper({
1081
+ "support.function": supportFunction,
1082
+ "support.constant": supportConstant,
1083
+ "support.type": supportType,
1084
+ "support.constant.color": supportConstantColor,
1085
+ "support.constant.fonts": supportConstantFonts
1086
+ }, "text", true);
1087
+
1088
+ var base_ruleset = [
1089
+ {
1090
+ token : "comment", // multi line comment
1091
+ regex : "\\/\\*",
1092
+ next : "ruleset_comment"
1093
+ }, {
1094
+ token : "string", // single line
1095
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
1096
+ }, {
1097
+ token : "string", // single line
1098
+ regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
1099
+ }, {
1100
+ token : ["constant.numeric", "keyword"],
1101
+ 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|%)"
1102
+ }, {
1103
+ token : "constant.numeric",
1104
+ regex : numRe
1105
+ }, {
1106
+ token : "constant.numeric", // hex6 color
1107
+ regex : "#[a-f0-9]{6}"
1108
+ }, {
1109
+ token : "constant.numeric", // hex3 color
1110
+ regex : "#[a-f0-9]{3}"
1111
+ }, {
1112
+ token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
1113
+ regex : pseudoElements
1114
+ }, {
1115
+ token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
1116
+ regex : pseudoClasses
1117
+ }, {
1118
+ token : keywordMapper,
1119
+ regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
1120
+ }
1121
+ ];
1122
+
1123
+ var ruleset = lang.copyArray(base_ruleset);
1124
+ ruleset.unshift({
1125
+ token : "paren.rparen",
1126
+ regex : "\\}",
1127
+ next: "start"
1128
+ });
1129
+
1130
+ var media_ruleset = lang.copyArray( base_ruleset );
1131
+ media_ruleset.unshift({
1132
+ token : "paren.rparen",
1133
+ regex : "\\}",
1134
+ next: "media"
1135
+ });
1136
+
1137
+ var base_comment = [{
1138
+ token : "comment", // comment spanning whole line
1139
+ regex : ".+"
1140
+ }];
1141
+
1142
+ var comment = lang.copyArray(base_comment);
1143
+ comment.unshift({
1144
+ token : "comment", // closing comment
1145
+ regex : ".*?\\*\\/",
1146
+ next : "start"
1147
+ });
1148
+
1149
+ var media_comment = lang.copyArray(base_comment);
1150
+ media_comment.unshift({
1151
+ token : "comment", // closing comment
1152
+ regex : ".*?\\*\\/",
1153
+ next : "media"
1154
+ });
1155
+
1156
+ var ruleset_comment = lang.copyArray(base_comment);
1157
+ ruleset_comment.unshift({
1158
+ token : "comment", // closing comment
1159
+ regex : ".*?\\*\\/",
1160
+ next : "ruleset"
1161
+ });
1162
+
1163
+ this.$rules = {
1164
+ "start" : [{
1165
+ token : "comment", // multi line comment
1166
+ regex : "\\/\\*",
1167
+ next : "comment"
1168
+ }, {
1169
+ token: "paren.lparen",
1170
+ regex: "\\{",
1171
+ next: "ruleset"
1172
+ }, {
1173
+ token: "string",
1174
+ regex: "@.*?{",
1175
+ next: "media"
1176
+ },{
1177
+ token: "keyword",
1178
+ regex: "#[a-z0-9-_]+"
1179
+ },{
1180
+ token: "variable",
1181
+ regex: "\\.[a-z0-9-_]+"
1182
+ },{
1183
+ token: "string",
1184
+ regex: ":[a-z0-9-_]+"
1185
+ },{
1186
+ token: "constant",
1187
+ regex: "[a-z0-9-_]+"
1188
+ }],
1189
+
1190
+ "media" : [ {
1191
+ token : "comment", // multi line comment
1192
+ regex : "\\/\\*",
1193
+ next : "media_comment"
1194
+ }, {
1195
+ token: "paren.lparen",
1196
+ regex: "\\{",
1197
+ next: "media_ruleset"
1198
+ },{
1199
+ token: "string",
1200
+ regex: "\\}",
1201
+ next: "start"
1202
+ },{
1203
+ token: "keyword",
1204
+ regex: "#[a-z0-9-_]+"
1205
+ },{
1206
+ token: "variable",
1207
+ regex: "\\.[a-z0-9-_]+"
1208
+ },{
1209
+ token: "string",
1210
+ regex: ":[a-z0-9-_]+"
1211
+ },{
1212
+ token: "constant",
1213
+ regex: "[a-z0-9-_]+"
1214
+ }],
1215
+
1216
+ "comment" : comment,
1217
+
1218
+ "ruleset" : ruleset,
1219
+ "ruleset_comment" : ruleset_comment,
1220
+
1221
+ "media_ruleset" : media_ruleset,
1222
+ "media_comment" : media_comment
1223
+ };
1224
+ };
1225
+
1226
+ oop.inherits(CssHighlightRules, TextHighlightRules);
1227
+
1228
+ exports.CssHighlightRules = CssHighlightRules;
1229
+
1230
+ });
1231
+
1232
+ 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) {
1233
+
1234
+
1235
+ var oop = require("../lib/oop");
1236
+ var lang = require("../lib/lang");
1237
+ var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
1238
+ var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
1239
+ var xmlUtil = require("./xml_util");
1240
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1241
+
1242
+ var tagMap = lang.createMap({
1243
+ a : 'anchor',
1244
+ button : 'form',
1245
+ form : 'form',
1246
+ img : 'image',
1247
+ input : 'form',
1248
+ label : 'form',
1249
+ script : 'script',
1250
+ select : 'form',
1251
+ textarea : 'form',
1252
+ style : 'style',
1253
+ table : 'table',
1254
+ tbody : 'table',
1255
+ td : 'table',
1256
+ tfoot : 'table',
1257
+ th : 'table',
1258
+ tr : 'table'
1259
+ });
1260
+
1261
+ var HtmlHighlightRules = function() {
1262
+ this.$rules = {
1263
+ start : [{
1264
+ token : "text",
1265
+ regex : "<\\!\\[CDATA\\[",
1266
+ next : "cdata"
1267
+ }, {
1268
+ token : "xml-pe",
1269
+ regex : "<\\?.*?\\?>"
1270
+ }, {
1271
+ token : "comment",
1272
+ regex : "<\\!--",
1273
+ next : "comment"
1274
+ }, {
1275
+ token : "xml-pe",
1276
+ regex : "<\\!.*?>"
1277
+ }, {
1278
+ token : "meta.tag",
1279
+ regex : "<(?=script\\b)",
1280
+ next : "script"
1281
+ }, {
1282
+ token : "meta.tag",
1283
+ regex : "<(?=style\\b)",
1284
+ next : "style"
1285
+ }, {
1286
+ token : "meta.tag", // opening tag
1287
+ regex : "<\\/?",
1288
+ next : "tag"
1289
+ }, {
1290
+ token : "text",
1291
+ regex : "\\s+"
1292
+ }, {
1293
+ token : "constant.character.entity",
1294
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
1295
+ }, {
1296
+ token : "text",
1297
+ regex : "[^<]+"
1298
+ } ],
1299
+
1300
+ cdata : [ {
1301
+ token : "text",
1302
+ regex : "\\]\\]>",
1303
+ next : "start"
1304
+ }, {
1305
+ token : "text",
1306
+ regex : "\\s+"
1307
+ }, {
1308
+ token : "text",
1309
+ regex : ".+"
1310
+ } ],
1311
+
1312
+ comment : [ {
1313
+ token : "comment",
1314
+ regex : ".*?-->",
1315
+ next : "start"
1316
+ }, {
1317
+ token : "comment",
1318
+ regex : ".+"
1319
+ } ]
1320
+ };
1321
+
1322
+ xmlUtil.tag(this.$rules, "tag", "start", tagMap);
1323
+ xmlUtil.tag(this.$rules, "style", "css-start", tagMap);
1324
+ xmlUtil.tag(this.$rules, "script", "js-start", tagMap);
1325
+
1326
+ this.embedRules(JavaScriptHighlightRules, "js-", [{
1327
+ token: "comment",
1328
+ regex: "\\/\\/.*(?=<\\/script>)",
1329
+ next: "tag"
1330
+ }, {
1331
+ token: "meta.tag",
1332
+ regex: "<\\/(?=script)",
1333
+ next: "tag"
1334
+ }]);
1335
+
1336
+ this.embedRules(CssHighlightRules, "css-", [{
1337
+ token: "meta.tag",
1338
+ regex: "<\\/(?=style)",
1339
+ next: "tag"
1340
+ }]);
1341
+ };
1342
+
1343
+ oop.inherits(HtmlHighlightRules, TextHighlightRules);
1344
+
1345
+ exports.HtmlHighlightRules = HtmlHighlightRules;
1346
+ });
1347
+
1348
+ define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) {
1349
+
1350
+
1351
+ function string(state) {
1352
+ return [{
1353
+ token : "string",
1354
+ regex : '"',
1355
+ next : state + "_qqstring"
1356
+ }, {
1357
+ token : "string",
1358
+ regex : "'",
1359
+ next : state + "_qstring"
1360
+ }];
1361
+ }
1362
+
1363
+ function multiLineString(quote, state) {
1364
+ return [
1365
+ {token : "string", regex : quote, next : state},
1366
+ {
1367
+ token : "constant.language.escape",
1368
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
1369
+ },
1370
+ {token : "string", regex : '\\w+|.|\\s+'}
1371
+ ];
1372
+ }
1373
+
1374
+ exports.tag = function(states, name, nextState, tagMap) {
1375
+ states[name] = [{
1376
+ token : "text",
1377
+ regex : "\\s+"
1378
+ }, {
1379
+
1380
+ token : !tagMap ? "meta.tag.tag-name" : function(value) {
1381
+ if (tagMap[value])
1382
+ return "meta.tag.tag-name." + tagMap[value];
1383
+ else
1384
+ return "meta.tag.tag-name";
1385
+ },
1386
+ regex : "[-_a-zA-Z0-9:]+",
1387
+ next : name + "_embed_attribute_list"
1388
+ }, {
1389
+ token: "empty",
1390
+ regex: "",
1391
+ next : name + "_embed_attribute_list"
1392
+ }];
1393
+
1394
+ states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list");
1395
+ states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list");
1396
+
1397
+ states[name + "_embed_attribute_list"] = [{
1398
+ token : "meta.tag.r",
1399
+ regex : "/?>",
1400
+ next : nextState
1401
+ }, {
1402
+ token : "keyword.operator",
1403
+ regex : "="
1404
+ }, {
1405
+ token : "entity.other.attribute-name",
1406
+ regex : "[-_a-zA-Z0-9:]+"
1407
+ }, {
1408
+ token : "constant.numeric", // float
1409
+ regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
1410
+ }, {
1411
+ token : "text",
1412
+ regex : "\\s+"
1413
+ }].concat(string(name));
1414
+ };
1415
+
1416
+ });
1417
+
1418
+ 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) {
1419
+
1420
+
1421
+ var oop = require("../../lib/oop");
1422
+ var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
1423
+ var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
1424
+ var TokenIterator = require("../../token_iterator").TokenIterator;
1425
+ var voidElements = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr'];
1426
+
1427
+ function hasType(token, type) {
1428
+ var hasType = true;
1429
+ var typeList = token.type.split('.');
1430
+ var needleList = type.split('.');
1431
+ needleList.forEach(function(needle){
1432
+ if (typeList.indexOf(needle) == -1) {
1433
+ hasType = false;
1434
+ return false;
1435
+ }
1436
+ });
1437
+ return hasType;
1438
+ }
1439
+
1440
+ var HtmlBehaviour = function () {
1441
+
1442
+ this.inherit(XmlBehaviour); // Get xml behaviour
1443
+
1444
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
1445
+ if (text == '>') {
1446
+ var position = editor.getCursorPosition();
1447
+ var iterator = new TokenIterator(session, position.row, position.column);
1448
+ var token = iterator.getCurrentToken();
1449
+ var atCursor = false;
1450
+ if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){
1451
+ do {
1452
+ token = iterator.stepBackward();
1453
+ } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text')));
1454
+ } else {
1455
+ atCursor = true;
1456
+ }
1457
+ if (!token || !hasType(token, 'meta.tag-name') || iterator.stepBackward().value.match('/')) {
1458
+ return
1459
+ }
1460
+ var element = token.value;
1461
+ if (atCursor){
1462
+ var element = element.substring(0, position.column - token.start);
1463
+ }
1464
+ if (voidElements.indexOf(element) !== -1){
1465
+ return;
1466
+ }
1467
+ return {
1468
+ text: '>' + '</' + element + '>',
1469
+ selection: [1, 1]
1470
+ }
1471
+ }
1472
+ });
1473
+ }
1474
+ oop.inherits(HtmlBehaviour, XmlBehaviour);
1475
+
1476
+ exports.HtmlBehaviour = HtmlBehaviour;
1477
+ });
1478
+
1479
+ 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) {
1480
+
1481
+
1482
+ var oop = require("../../lib/oop");
1483
+ var Behaviour = require("../behaviour").Behaviour;
1484
+ var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
1485
+ var TokenIterator = require("../../token_iterator").TokenIterator;
1486
+
1487
+ function hasType(token, type) {
1488
+ var hasType = true;
1489
+ var typeList = token.type.split('.');
1490
+ var needleList = type.split('.');
1491
+ needleList.forEach(function(needle){
1492
+ if (typeList.indexOf(needle) == -1) {
1493
+ hasType = false;
1494
+ return false;
1495
+ }
1496
+ });
1497
+ return hasType;
1498
+ }
1499
+
1500
+ var XmlBehaviour = function () {
1501
+
1502
+ this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour
1503
+
1504
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
1505
+ if (text == '>') {
1506
+ var position = editor.getCursorPosition();
1507
+ var iterator = new TokenIterator(session, position.row, position.column);
1508
+ var token = iterator.getCurrentToken();
1509
+ var atCursor = false;
1510
+ if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){
1511
+ do {
1512
+ token = iterator.stepBackward();
1513
+ } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text')));
1514
+ } else {
1515
+ atCursor = true;
1516
+ }
1517
+ if (!token || !hasType(token, 'meta.tag-name') || iterator.stepBackward().value.match('/')) {
1518
+ return
1519
+ }
1520
+ var tag = token.value;
1521
+ if (atCursor){
1522
+ var tag = tag.substring(0, position.column - token.start);
1523
+ }
1524
+
1525
+ return {
1526
+ text: '>' + '</' + tag + '>',
1527
+ selection: [1, 1]
1528
+ }
1529
+ }
1530
+ });
1531
+
1532
+ this.add('autoindent', 'insertion', function (state, action, editor, session, text) {
1533
+ if (text == "\n") {
1534
+ var cursor = editor.getCursorPosition();
1535
+ var line = session.doc.getLine(cursor.row);
1536
+ var rightChars = line.substring(cursor.column, cursor.column + 2);
1537
+ if (rightChars == '</') {
1538
+ var indent = this.$getIndent(session.doc.getLine(cursor.row)) + session.getTabString();
1539
+ var next_indent = this.$getIndent(session.doc.getLine(cursor.row));
1540
+
1541
+ return {
1542
+ text: '\n' + indent + '\n' + next_indent,
1543
+ selection: [1, indent.length, 1, indent.length]
1544
+ }
1545
+ }
1546
+ }
1547
+ });
1548
+
1549
+ }
1550
+ oop.inherits(XmlBehaviour, Behaviour);
1551
+
1552
+ exports.XmlBehaviour = XmlBehaviour;
1553
+ });
1554
+
1555
+ 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) {
1556
+
1557
+
1558
+ var oop = require("../../lib/oop");
1559
+ var MixedFoldMode = require("./mixed").FoldMode;
1560
+ var XmlFoldMode = require("./xml").FoldMode;
1561
+ var CStyleFoldMode = require("./cstyle").FoldMode;
1562
+
1563
+ var FoldMode = exports.FoldMode = function() {
1564
+ MixedFoldMode.call(this, new XmlFoldMode({
1565
+ "area": 1,
1566
+ "base": 1,
1567
+ "br": 1,
1568
+ "col": 1,
1569
+ "command": 1,
1570
+ "embed": 1,
1571
+ "hr": 1,
1572
+ "img": 1,
1573
+ "input": 1,
1574
+ "keygen": 1,
1575
+ "link": 1,
1576
+ "meta": 1,
1577
+ "param": 1,
1578
+ "source": 1,
1579
+ "track": 1,
1580
+ "wbr": 1,
1581
+ "li": 1,
1582
+ "dt": 1,
1583
+ "dd": 1,
1584
+ "p": 1,
1585
+ "rt": 1,
1586
+ "rp": 1,
1587
+ "optgroup": 1,
1588
+ "option": 1,
1589
+ "colgroup": 1,
1590
+ "td": 1,
1591
+ "th": 1
1592
+ }), {
1593
+ "js-": new CStyleFoldMode(),
1594
+ "css-": new CStyleFoldMode()
1595
+ });
1596
+ };
1597
+
1598
+ oop.inherits(FoldMode, MixedFoldMode);
1599
+
1600
+ });
1601
+
1602
+ define('ace/mode/folding/mixed', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
1603
+
1604
+
1605
+ var oop = require("../../lib/oop");
1606
+ var BaseFoldMode = require("./fold_mode").FoldMode;
1607
+
1608
+ var FoldMode = exports.FoldMode = function(defaultMode, subModes) {
1609
+ this.defaultMode = defaultMode;
1610
+ this.subModes = subModes;
1611
+ };
1612
+ oop.inherits(FoldMode, BaseFoldMode);
1613
+
1614
+ (function() {
1615
+
1616
+
1617
+ this.$getMode = function(state) {
1618
+ for (var key in this.subModes) {
1619
+ if (state.indexOf(key) === 0)
1620
+ return this.subModes[key];
1621
+ }
1622
+ return null;
1623
+ };
1624
+
1625
+ this.$tryMode = function(state, session, foldStyle, row) {
1626
+ var mode = this.$getMode(state);
1627
+ return (mode ? mode.getFoldWidget(session, foldStyle, row) : "");
1628
+ };
1629
+
1630
+ this.getFoldWidget = function(session, foldStyle, row) {
1631
+ return (
1632
+ this.$tryMode(session.getState(row-1), session, foldStyle, row) ||
1633
+ this.$tryMode(session.getState(row), session, foldStyle, row) ||
1634
+ this.defaultMode.getFoldWidget(session, foldStyle, row)
1635
+ );
1636
+ };
1637
+
1638
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
1639
+ var mode = this.$getMode(session.getState(row-1));
1640
+
1641
+ if (!mode || !mode.getFoldWidget(session, foldStyle, row))
1642
+ mode = this.$getMode(session.getState(row));
1643
+
1644
+ if (!mode || !mode.getFoldWidget(session, foldStyle, row))
1645
+ mode = this.defaultMode;
1646
+
1647
+ return mode.getFoldWidgetRange(session, foldStyle, row);
1648
+ };
1649
+
1650
+ }).call(FoldMode.prototype);
1651
+
1652
+ });
1653
+
1654
+ define('ace/mode/folding/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/range', 'ace/mode/folding/fold_mode', 'ace/token_iterator'], function(require, exports, module) {
1655
+
1656
+
1657
+ var oop = require("../../lib/oop");
1658
+ var lang = require("../../lib/lang");
1659
+ var Range = require("../../range").Range;
1660
+ var BaseFoldMode = require("./fold_mode").FoldMode;
1661
+ var TokenIterator = require("../../token_iterator").TokenIterator;
1662
+
1663
+ var FoldMode = exports.FoldMode = function(voidElements) {
1664
+ BaseFoldMode.call(this);
1665
+ this.voidElements = voidElements || {};
1666
+ };
1667
+ oop.inherits(FoldMode, BaseFoldMode);
1668
+
1669
+ (function() {
1670
+
1671
+ this.getFoldWidget = function(session, foldStyle, row) {
1672
+ var tag = this._getFirstTagInLine(session, row);
1673
+
1674
+ if (tag.closing)
1675
+ return foldStyle == "markbeginend" ? "end" : "";
1676
+
1677
+ if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()])
1678
+ return "";
1679
+
1680
+ if (tag.selfClosing)
1681
+ return "";
1682
+
1683
+ if (tag.value.indexOf("/" + tag.tagName) !== -1)
1684
+ return "";
1685
+
1686
+ return "start";
1687
+ };
1688
+
1689
+ this._getFirstTagInLine = function(session, row) {
1690
+ var tokens = session.getTokens(row);
1691
+ var value = "";
1692
+ for (var i = 0; i < tokens.length; i++) {
1693
+ var token = tokens[i];
1694
+ if (token.type.indexOf("meta.tag") === 0)
1695
+ value += token.value;
1696
+ else
1697
+ value += lang.stringRepeat(" ", token.value.length);
1698
+ }
1699
+
1700
+ return this._parseTag(value);
1701
+ };
1702
+
1703
+ this.tagRe = /^(\s*)(<?(\/?)([-_a-zA-Z0-9:!]*)\s*(\/?)>?)/;
1704
+ this._parseTag = function(tag) {
1705
+
1706
+ var match = this.tagRe.exec(tag);
1707
+ var column = this.tagRe.lastIndex || 0;
1708
+ this.tagRe.lastIndex = 0;
1709
+
1710
+ return {
1711
+ value: tag,
1712
+ match: match ? match[2] : "",
1713
+ closing: match ? !!match[3] : false,
1714
+ selfClosing: match ? !!match[5] || match[2] == "/>" : false,
1715
+ tagName: match ? match[4] : "",
1716
+ column: match[1] ? column + match[1].length : column
1717
+ };
1718
+ };
1719
+ this._readTagForward = function(iterator) {
1720
+ var token = iterator.getCurrentToken();
1721
+ if (!token)
1722
+ return null;
1723
+
1724
+ var value = "";
1725
+ var start;
1726
+
1727
+ do {
1728
+ if (token.type.indexOf("meta.tag") === 0) {
1729
+ if (!start) {
1730
+ var start = {
1731
+ row: iterator.getCurrentTokenRow(),
1732
+ column: iterator.getCurrentTokenColumn()
1733
+ };
1734
+ }
1735
+ value += token.value;
1736
+ if (value.indexOf(">") !== -1) {
1737
+ var tag = this._parseTag(value);
1738
+ tag.start = start;
1739
+ tag.end = {
1740
+ row: iterator.getCurrentTokenRow(),
1741
+ column: iterator.getCurrentTokenColumn() + token.value.length
1742
+ };
1743
+ iterator.stepForward();
1744
+ return tag;
1745
+ }
1746
+ }
1747
+ } while(token = iterator.stepForward());
1748
+
1749
+ return null;
1750
+ };
1751
+
1752
+ this._readTagBackward = function(iterator) {
1753
+ var token = iterator.getCurrentToken();
1754
+ if (!token)
1755
+ return null;
1756
+
1757
+ var value = "";
1758
+ var end;
1759
+
1760
+ do {
1761
+ if (token.type.indexOf("meta.tag") === 0) {
1762
+ if (!end) {
1763
+ end = {
1764
+ row: iterator.getCurrentTokenRow(),
1765
+ column: iterator.getCurrentTokenColumn() + token.value.length
1766
+ };
1767
+ }
1768
+ value = token.value + value;
1769
+ if (value.indexOf("<") !== -1) {
1770
+ var tag = this._parseTag(value);
1771
+ tag.end = end;
1772
+ tag.start = {
1773
+ row: iterator.getCurrentTokenRow(),
1774
+ column: iterator.getCurrentTokenColumn()
1775
+ };
1776
+ iterator.stepBackward();
1777
+ return tag;
1778
+ }
1779
+ }
1780
+ } while(token = iterator.stepBackward());
1781
+
1782
+ return null;
1783
+ };
1784
+
1785
+ this._pop = function(stack, tag) {
1786
+ while (stack.length) {
1787
+
1788
+ var top = stack[stack.length-1];
1789
+ if (!tag || top.tagName == tag.tagName) {
1790
+ return stack.pop();
1791
+ }
1792
+ else if (this.voidElements[tag.tagName]) {
1793
+ return;
1794
+ }
1795
+ else if (this.voidElements[top.tagName]) {
1796
+ stack.pop();
1797
+ continue;
1798
+ } else {
1799
+ return null;
1800
+ }
1801
+ }
1802
+ };
1803
+
1804
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
1805
+ var firstTag = this._getFirstTagInLine(session, row);
1806
+
1807
+ if (!firstTag.match)
1808
+ return null;
1809
+
1810
+ var isBackward = firstTag.closing || firstTag.selfClosing;
1811
+ var stack = [];
1812
+ var tag;
1813
+
1814
+ if (!isBackward) {
1815
+ var iterator = new TokenIterator(session, row, firstTag.column);
1816
+ var start = {
1817
+ row: row,
1818
+ column: firstTag.column + firstTag.tagName.length + 2
1819
+ };
1820
+ while (tag = this._readTagForward(iterator)) {
1821
+ if (tag.selfClosing) {
1822
+ if (!stack.length) {
1823
+ tag.start.column += tag.tagName.length + 2;
1824
+ tag.end.column -= 2;
1825
+ return Range.fromPoints(tag.start, tag.end);
1826
+ } else
1827
+ continue;
1828
+ }
1829
+
1830
+ if (tag.closing) {
1831
+ this._pop(stack, tag);
1832
+ if (stack.length == 0)
1833
+ return Range.fromPoints(start, tag.start);
1834
+ }
1835
+ else {
1836
+ stack.push(tag)
1837
+ }
1838
+ }
1839
+ }
1840
+ else {
1841
+ var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length);
1842
+ var end = {
1843
+ row: row,
1844
+ column: firstTag.column
1845
+ };
1846
+
1847
+ while (tag = this._readTagBackward(iterator)) {
1848
+ if (tag.selfClosing) {
1849
+ if (!stack.length) {
1850
+ tag.start.column += tag.tagName.length + 2;
1851
+ tag.end.column -= 2;
1852
+ return Range.fromPoints(tag.start, tag.end);
1853
+ } else
1854
+ continue;
1855
+ }
1856
+
1857
+ if (!tag.closing) {
1858
+ this._pop(stack, tag);
1859
+ if (stack.length == 0) {
1860
+ tag.start.column += tag.tagName.length + 2;
1861
+ return Range.fromPoints(tag.start, end);
1862
+ }
1863
+ }
1864
+ else {
1865
+ stack.push(tag)
1866
+ }
1867
+ }
1868
+ }
1869
+
1870
+ };
1871
+
1872
+ }).call(FoldMode.prototype);
1873
+
1874
+ });
1875
+ define('ace/mode/rhtml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/r_highlight_rules', 'ace/mode/html_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
1876
+
1877
+
1878
+ var oop = require("../lib/oop");
1879
+ var RHighlightRules = require("./r_highlight_rules").RHighlightRules;
1880
+ var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
1881
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1882
+
1883
+ var RHtmlHighlightRules = function() {
1884
+
1885
+ this.$rules = new HtmlHighlightRules().getRules();
1886
+ this.$rules["start"].unshift({
1887
+ token: "support.function.codebegin",
1888
+ regex: "^<" + "!--\\s*begin.rcode\\s*(?:.*)",
1889
+ next: "r-start"
1890
+ });
1891
+
1892
+ var rRules = new RHighlightRules().getRules();
1893
+ this.addRules(rRules, "r-");
1894
+ this.$rules["r-start"].unshift({
1895
+ token: "support.function.codeend",
1896
+ regex: "^\\s*end.rcode\\s*-->",
1897
+ next: "start"
1898
+ });
1899
+ };
1900
+ oop.inherits(RHtmlHighlightRules, TextHighlightRules);
1901
+
1902
+ exports.RHtmlHighlightRules = RHtmlHighlightRules;
1903
+ });
1904
+ define('ace/mode/r_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules', 'ace/mode/tex_highlight_rules'], function(require, exports, module) {
1905
+
1906
+ var oop = require("../lib/oop");
1907
+ var lang = require("../lib/lang");
1908
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1909
+ var TexHighlightRules = require("./tex_highlight_rules").TexHighlightRules;
1910
+
1911
+ var RHighlightRules = function()
1912
+ {
1913
+
1914
+ var keywords = lang.arrayToMap(
1915
+ ("function|if|in|break|next|repeat|else|for|return|switch|while|try|tryCatch|stop|warning|require|library|attach|detach|source|setMethod|setGeneric|setGroupGeneric|setClass")
1916
+ .split("|")
1917
+ );
1918
+
1919
+ var buildinConstants = lang.arrayToMap(
1920
+ ("NULL|NA|TRUE|FALSE|T|F|Inf|NaN|NA_integer_|NA_real_|NA_character_|" +
1921
+ "NA_complex_").split("|")
1922
+ );
1923
+
1924
+ this.$rules = {
1925
+ "start" : [
1926
+ {
1927
+ token : "comment.sectionhead",
1928
+ regex : "#+(?!').*(?:----|====|####)\\s*$"
1929
+ },
1930
+ {
1931
+ token : "comment",
1932
+ regex : "#+'",
1933
+ next : "rd-start"
1934
+ },
1935
+ {
1936
+ token : "comment",
1937
+ regex : "#.*$"
1938
+ },
1939
+ {
1940
+ token : "string", // multi line string start
1941
+ regex : '["]',
1942
+ next : "qqstring"
1943
+ },
1944
+ {
1945
+ token : "string", // multi line string start
1946
+ regex : "[']",
1947
+ next : "qstring"
1948
+ },
1949
+ {
1950
+ token : "constant.numeric", // hex
1951
+ regex : "0[xX][0-9a-fA-F]+[Li]?\\b"
1952
+ },
1953
+ {
1954
+ token : "constant.numeric", // explicit integer
1955
+ regex : "\\d+L\\b"
1956
+ },
1957
+ {
1958
+ token : "constant.numeric", // number
1959
+ regex : "\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b"
1960
+ },
1961
+ {
1962
+ token : "constant.numeric", // number with leading decimal
1963
+ regex : "\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b"
1964
+ },
1965
+ {
1966
+ token : "constant.language.boolean",
1967
+ regex : "(?:TRUE|FALSE|T|F)\\b"
1968
+ },
1969
+ {
1970
+ token : "identifier",
1971
+ regex : "`.*?`"
1972
+ },
1973
+ {
1974
+ token : function(value)
1975
+ {
1976
+ if (keywords[value])
1977
+ return "keyword";
1978
+ else if (buildinConstants[value])
1979
+ return "constant.language";
1980
+ else if (value == '...' || value.match(/^\.\.\d+$/))
1981
+ return "variable.language";
1982
+ else
1983
+ return "identifier";
1984
+ },
1985
+ regex : "[a-zA-Z.][a-zA-Z0-9._]*\\b"
1986
+ },
1987
+ {
1988
+ token : "keyword.operator",
1989
+ regex : "%%|>=|<=|==|!=|\\->|<\\-|\\|\\||&&|=|\\+|\\-|\\*|/|\\^|>|<|!|&|\\||~|\\$|:"
1990
+ },
1991
+ {
1992
+ token : "keyword.operator", // infix operators
1993
+ regex : "%.*?%"
1994
+ },
1995
+ {
1996
+ token : "paren.keyword.operator",
1997
+ regex : "[[({]"
1998
+ },
1999
+ {
2000
+ token : "paren.keyword.operator",
2001
+ regex : "[\\])}]"
2002
+ },
2003
+ {
2004
+ token : "text",
2005
+ regex : "\\s+"
2006
+ }
2007
+ ],
2008
+ "qqstring" : [
2009
+ {
2010
+ token : "string",
2011
+ regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
2012
+ next : "start"
2013
+ },
2014
+ {
2015
+ token : "string",
2016
+ regex : '.+'
2017
+ }
2018
+ ],
2019
+ "qstring" : [
2020
+ {
2021
+ token : "string",
2022
+ regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
2023
+ next : "start"
2024
+ },
2025
+ {
2026
+ token : "string",
2027
+ regex : '.+'
2028
+ }
2029
+ ]
2030
+ };
2031
+
2032
+ var rdRules = new TexHighlightRules("comment").getRules();
2033
+ for (var i = 0; i < rdRules["start"].length; i++) {
2034
+ rdRules["start"][i].token += ".virtual-comment";
2035
+ }
2036
+
2037
+ this.addRules(rdRules, "rd-");
2038
+ this.$rules["rd-start"].unshift({
2039
+ token: "text",
2040
+ regex: "^",
2041
+ next: "start"
2042
+ });
2043
+ this.$rules["rd-start"].unshift({
2044
+ token : "keyword",
2045
+ regex : "@(?!@)[^ ]*"
2046
+ });
2047
+ this.$rules["rd-start"].unshift({
2048
+ token : "comment",
2049
+ regex : "@@"
2050
+ });
2051
+ this.$rules["rd-start"].push({
2052
+ token : "comment",
2053
+ regex : "[^%\\\\[({\\])}]+"
2054
+ });
2055
+ };
2056
+
2057
+ oop.inherits(RHighlightRules, TextHighlightRules);
2058
+
2059
+ exports.RHighlightRules = RHighlightRules;
2060
+ });
2061
+ define('ace/mode/tex_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
2062
+
2063
+
2064
+ var oop = require("../lib/oop");
2065
+ var lang = require("../lib/lang");
2066
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
2067
+
2068
+ var TexHighlightRules = function(textClass) {
2069
+
2070
+ if (!textClass)
2071
+ textClass = "text";
2072
+
2073
+ this.$rules = {
2074
+ "start" : [
2075
+ {
2076
+ token : "comment",
2077
+ regex : "%.*$"
2078
+ }, {
2079
+ token : textClass, // non-command
2080
+ regex : "\\\\[$&%#\\{\\}]"
2081
+ }, {
2082
+ token : "keyword", // command
2083
+ regex : "\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b",
2084
+ next : "nospell"
2085
+ }, {
2086
+ token : "keyword", // command
2087
+ regex : "\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])"
2088
+ }, {
2089
+ token : "paren.keyword.operator",
2090
+ regex : "[[({]"
2091
+ }, {
2092
+ token : "paren.keyword.operator",
2093
+ regex : "[\\])}]"
2094
+ }, {
2095
+ token : textClass,
2096
+ regex : "\\s+"
2097
+ }
2098
+ ],
2099
+ "nospell" : [
2100
+ {
2101
+ token : "comment",
2102
+ regex : "%.*$",
2103
+ next : "start"
2104
+ }, {
2105
+ token : "nospell." + textClass, // non-command
2106
+ regex : "\\\\[$&%#\\{\\}]"
2107
+ }, {
2108
+ token : "keyword", // command
2109
+ regex : "\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b"
2110
+ }, {
2111
+ token : "keyword", // command
2112
+ regex : "\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])",
2113
+ next : "start"
2114
+ }, {
2115
+ token : "paren.keyword.operator",
2116
+ regex : "[[({]"
2117
+ }, {
2118
+ token : "paren.keyword.operator",
2119
+ regex : "[\\])]"
2120
+ }, {
2121
+ token : "paren.keyword.operator",
2122
+ regex : "}",
2123
+ next : "start"
2124
+ }, {
2125
+ token : "nospell." + textClass,
2126
+ regex : "\\s+"
2127
+ }, {
2128
+ token : "nospell." + textClass,
2129
+ regex : "\\w+"
2130
+ }
2131
+ ]
2132
+ };
2133
+ };
2134
+
2135
+ oop.inherits(TexHighlightRules, TextHighlightRules);
2136
+
2137
+ exports.TexHighlightRules = TexHighlightRules;
2138
+ });