pollypost 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1132) hide show
  1. data/.gitignore +15 -0
  2. data/Gemfile +4 -0
  3. data/LICENSE.txt +674 -0
  4. data/README.md +165 -0
  5. data/Rakefile +9 -0
  6. data/assets/fonts/font-awesome-custom/fontawesome-custom.eot +0 -0
  7. data/assets/fonts/font-awesome-custom/fontawesome-custom.svg +15 -0
  8. data/assets/fonts/font-awesome-custom/fontawesome-custom.ttf +0 -0
  9. data/assets/fonts/font-awesome-custom/fontawesome-custom.woff +0 -0
  10. data/assets/javascripts/app.js +35 -0
  11. data/assets/javascripts/application.js +8 -0
  12. data/assets/javascripts/dom-tweaking.js +36 -0
  13. data/assets/javascripts/main.js +36 -0
  14. data/assets/javascripts/models/page_content.js +39 -0
  15. data/assets/javascripts/templates/bar_edit_mode.html +14 -0
  16. data/assets/javascripts/templates/bar_view_mode.html +13 -0
  17. data/assets/javascripts/templates/duplicate_page.html +20 -0
  18. data/assets/javascripts/templates/html_editor.html +18 -0
  19. data/assets/javascripts/templates/loading.html +9 -0
  20. data/assets/javascripts/templates/new_page.html +23 -0
  21. data/assets/javascripts/templates/settings.html +15 -0
  22. data/assets/javascripts/views/bar_edit_mode.js +117 -0
  23. data/assets/javascripts/views/bar_view_mode.js +40 -0
  24. data/assets/javascripts/views/duplicate_page.js +76 -0
  25. data/assets/javascripts/views/editier_bar.js +171 -0
  26. data/assets/javascripts/views/html_editor.js +116 -0
  27. data/assets/javascripts/views/loading.js +31 -0
  28. data/assets/javascripts/views/new_page.js +77 -0
  29. data/assets/javascripts/views/page_content.js +26 -0
  30. data/assets/javascripts/views/settings.js +89 -0
  31. data/assets/stylesheets/_bootstrap-custom.scss +50 -0
  32. data/assets/stylesheets/_editor.scss +303 -0
  33. data/assets/stylesheets/_font-awesome-custom.scss +17 -0
  34. data/assets/stylesheets/_variable-overrides.scss +13 -0
  35. data/assets/stylesheets/application.scss +41 -0
  36. data/assets/stylesheets/bootstrap/_normalize.scss +427 -0
  37. data/assets/stylesheets/bootstrap/_scaffolding.scss +150 -0
  38. data/assets/stylesheets/font-awesome/_core.scss +12 -0
  39. data/assets/stylesheets/font-awesome/_mixins.scss +26 -0
  40. data/assets/stylesheets/font-awesome/_path.scss +14 -0
  41. data/lib/pollypost.rb +13 -0
  42. data/lib/pollypost/rake.rb +55 -0
  43. data/lib/pollypost/version.rb +11 -0
  44. data/pollypost.gemspec +27 -0
  45. data/test/README.md +55 -0
  46. data/test/basic.html +19 -0
  47. data/test/page_content_test.js +69 -0
  48. data/test/qunit-1.17.1.css +280 -0
  49. data/test/qunit-1.17.1.js +2875 -0
  50. data/test/sinon-1.14.1.js +5931 -0
  51. data/test/sinon-qunit-1.0.0.js +62 -0
  52. data/test/test.html +16 -0
  53. data/test/testmain.js +28 -0
  54. data/test/tests.js +58 -0
  55. data/vendor/assets/ace-1.1.8/ace.js +129 -0
  56. data/vendor/assets/ace-1.1.8/anchor.js +245 -0
  57. data/vendor/assets/ace-1.1.8/anchor_test.js +223 -0
  58. data/vendor/assets/ace-1.1.8/autocomplete.js +485 -0
  59. data/vendor/assets/ace-1.1.8/autocomplete/popup.js +338 -0
  60. data/vendor/assets/ace-1.1.8/autocomplete/text_completer.js +78 -0
  61. data/vendor/assets/ace-1.1.8/autocomplete/util.js +74 -0
  62. data/vendor/assets/ace-1.1.8/background_tokenizer.js +250 -0
  63. data/vendor/assets/ace-1.1.8/background_tokenizer_test.js +85 -0
  64. data/vendor/assets/ace-1.1.8/commands/command_manager.js +118 -0
  65. data/vendor/assets/ace-1.1.8/commands/command_manager_test.js +199 -0
  66. data/vendor/assets/ace-1.1.8/commands/default_commands.js +708 -0
  67. data/vendor/assets/ace-1.1.8/commands/incremental_search_commands.js +232 -0
  68. data/vendor/assets/ace-1.1.8/commands/multi_select_commands.js +102 -0
  69. data/vendor/assets/ace-1.1.8/commands/occur_commands.js +110 -0
  70. data/vendor/assets/ace-1.1.8/config.js +301 -0
  71. data/vendor/assets/ace-1.1.8/config_test.js +128 -0
  72. data/vendor/assets/ace-1.1.8/css/codefolding-fold-button-states.png +0 -0
  73. data/vendor/assets/ace-1.1.8/css/editor.css +422 -0
  74. data/vendor/assets/ace-1.1.8/css/expand-marker.png +0 -0
  75. data/vendor/assets/ace-1.1.8/document.js +645 -0
  76. data/vendor/assets/ace-1.1.8/document_test.js +306 -0
  77. data/vendor/assets/ace-1.1.8/edit_session.js +2554 -0
  78. data/vendor/assets/ace-1.1.8/edit_session/bracket_match.js +221 -0
  79. data/vendor/assets/ace-1.1.8/edit_session/fold.js +140 -0
  80. data/vendor/assets/ace-1.1.8/edit_session/fold_line.js +269 -0
  81. data/vendor/assets/ace-1.1.8/edit_session/folding.js +851 -0
  82. data/vendor/assets/ace-1.1.8/edit_session_test.js +1075 -0
  83. data/vendor/assets/ace-1.1.8/editor.js +2658 -0
  84. data/vendor/assets/ace-1.1.8/editor_change_document_test.js +188 -0
  85. data/vendor/assets/ace-1.1.8/editor_highlight_selected_word_test.js +223 -0
  86. data/vendor/assets/ace-1.1.8/editor_navigation_test.js +164 -0
  87. data/vendor/assets/ace-1.1.8/editor_text_edit_test.js +557 -0
  88. data/vendor/assets/ace-1.1.8/ext/beautify.js +57 -0
  89. data/vendor/assets/ace-1.1.8/ext/beautify/php_rules.js +366 -0
  90. data/vendor/assets/ace-1.1.8/ext/chromevox.js +980 -0
  91. data/vendor/assets/ace-1.1.8/ext/elastic_tabstops_lite.js +319 -0
  92. data/vendor/assets/ace-1.1.8/ext/emmet.js +434 -0
  93. data/vendor/assets/ace-1.1.8/ext/error_marker.js +214 -0
  94. data/vendor/assets/ace-1.1.8/ext/keybinding_menu.js +86 -0
  95. data/vendor/assets/ace-1.1.8/ext/language_tools.js +229 -0
  96. data/vendor/assets/ace-1.1.8/ext/linking.js +78 -0
  97. data/vendor/assets/ace-1.1.8/ext/menu_tools/add_editor_menu_options.js +109 -0
  98. data/vendor/assets/ace-1.1.8/ext/menu_tools/element_generator.js +148 -0
  99. data/vendor/assets/ace-1.1.8/ext/menu_tools/generate_settings_menu.js +264 -0
  100. data/vendor/assets/ace-1.1.8/ext/menu_tools/get_editor_keyboard_shortcuts.js +91 -0
  101. data/vendor/assets/ace-1.1.8/ext/menu_tools/get_set_functions.js +141 -0
  102. data/vendor/assets/ace-1.1.8/ext/menu_tools/overlay_page.js +116 -0
  103. data/vendor/assets/ace-1.1.8/ext/menu_tools/settings_menu.css +48 -0
  104. data/vendor/assets/ace-1.1.8/ext/modelist.js +191 -0
  105. data/vendor/assets/ace-1.1.8/ext/old_ie.js +114 -0
  106. data/vendor/assets/ace-1.1.8/ext/old_ie_test.js +77 -0
  107. data/vendor/assets/ace-1.1.8/ext/searchbox.css +153 -0
  108. data/vendor/assets/ace-1.1.8/ext/searchbox.js +308 -0
  109. data/vendor/assets/ace-1.1.8/ext/settings_menu.js +76 -0
  110. data/vendor/assets/ace-1.1.8/ext/spellcheck.js +69 -0
  111. data/vendor/assets/ace-1.1.8/ext/split.js +40 -0
  112. data/vendor/assets/ace-1.1.8/ext/static.css +31 -0
  113. data/vendor/assets/ace-1.1.8/ext/static_highlight.js +190 -0
  114. data/vendor/assets/ace-1.1.8/ext/static_highlight_test.js +96 -0
  115. data/vendor/assets/ace-1.1.8/ext/statusbar.js +48 -0
  116. data/vendor/assets/ace-1.1.8/ext/textarea.js +521 -0
  117. data/vendor/assets/ace-1.1.8/ext/themelist.js +100 -0
  118. data/vendor/assets/ace-1.1.8/ext/whitespace.js +213 -0
  119. data/vendor/assets/ace-1.1.8/ext/whitespace_test.js +116 -0
  120. data/vendor/assets/ace-1.1.8/incremental_search.js +317 -0
  121. data/vendor/assets/ace-1.1.8/incremental_search_test.js +213 -0
  122. data/vendor/assets/ace-1.1.8/keyboard/emacs.js +652 -0
  123. data/vendor/assets/ace-1.1.8/keyboard/emacs_test.js +151 -0
  124. data/vendor/assets/ace-1.1.8/keyboard/hash_handler.js +231 -0
  125. data/vendor/assets/ace-1.1.8/keyboard/keybinding.js +145 -0
  126. data/vendor/assets/ace-1.1.8/keyboard/keybinding_test.js +69 -0
  127. data/vendor/assets/ace-1.1.8/keyboard/state_handler.js +249 -0
  128. data/vendor/assets/ace-1.1.8/keyboard/textarea.js +82 -0
  129. data/vendor/assets/ace-1.1.8/keyboard/textinput.js +495 -0
  130. data/vendor/assets/ace-1.1.8/keyboard/vim.js +199 -0
  131. data/vendor/assets/ace-1.1.8/keyboard/vim/commands.js +618 -0
  132. data/vendor/assets/ace-1.1.8/keyboard/vim/maps/aliases.js +94 -0
  133. data/vendor/assets/ace-1.1.8/keyboard/vim/maps/motions.js +681 -0
  134. data/vendor/assets/ace-1.1.8/keyboard/vim/maps/operators.js +201 -0
  135. data/vendor/assets/ace-1.1.8/keyboard/vim/maps/util.js +132 -0
  136. data/vendor/assets/ace-1.1.8/keyboard/vim/registers.js +42 -0
  137. data/vendor/assets/ace-1.1.8/keyboard/vim_test.js +528 -0
  138. data/vendor/assets/ace-1.1.8/layer/cursor.js +234 -0
  139. data/vendor/assets/ace-1.1.8/layer/font_metrics.js +176 -0
  140. data/vendor/assets/ace-1.1.8/layer/gutter.js +287 -0
  141. data/vendor/assets/ace-1.1.8/layer/marker.js +218 -0
  142. data/vendor/assets/ace-1.1.8/layer/text.js +575 -0
  143. data/vendor/assets/ace-1.1.8/layer/text_test.js +126 -0
  144. data/vendor/assets/ace-1.1.8/lib/dom.js +283 -0
  145. data/vendor/assets/ace-1.1.8/lib/es5-shim.js +1062 -0
  146. data/vendor/assets/ace-1.1.8/lib/event.js +381 -0
  147. data/vendor/assets/ace-1.1.8/lib/event_emitter.js +155 -0
  148. data/vendor/assets/ace-1.1.8/lib/event_emitter_test.js +65 -0
  149. data/vendor/assets/ace-1.1.8/lib/fixoldbrowsers.js +19 -0
  150. data/vendor/assets/ace-1.1.8/lib/keys.js +163 -0
  151. data/vendor/assets/ace-1.1.8/lib/lang.js +221 -0
  152. data/vendor/assets/ace-1.1.8/lib/net.js +51 -0
  153. data/vendor/assets/ace-1.1.8/lib/oop.js +57 -0
  154. data/vendor/assets/ace-1.1.8/lib/regexp.js +113 -0
  155. data/vendor/assets/ace-1.1.8/lib/useragent.js +106 -0
  156. data/vendor/assets/ace-1.1.8/line_widgets.js +297 -0
  157. data/vendor/assets/ace-1.1.8/mode/_test/Readme.md +9 -0
  158. data/vendor/assets/ace-1.1.8/mode/_test/highlight_rules_test.js +210 -0
  159. data/vendor/assets/ace-1.1.8/mode/_test/package.json +8 -0
  160. data/vendor/assets/ace-1.1.8/mode/_test/text_asciidoc.txt +111 -0
  161. data/vendor/assets/ace-1.1.8/mode/_test/text_coffee.txt +57 -0
  162. data/vendor/assets/ace-1.1.8/mode/_test/text_curly.txt +9 -0
  163. data/vendor/assets/ace-1.1.8/mode/_test/text_html.txt +10 -0
  164. data/vendor/assets/ace-1.1.8/mode/_test/text_javascript.txt +86 -0
  165. data/vendor/assets/ace-1.1.8/mode/_test/text_livescript.txt +1 -0
  166. data/vendor/assets/ace-1.1.8/mode/_test/text_lucene.txt +16 -0
  167. data/vendor/assets/ace-1.1.8/mode/_test/text_markdown.txt +22 -0
  168. data/vendor/assets/ace-1.1.8/mode/_test/text_php.txt +24 -0
  169. data/vendor/assets/ace-1.1.8/mode/_test/text_ruby.txt +34 -0
  170. data/vendor/assets/ace-1.1.8/mode/_test/text_xml.txt +7 -0
  171. data/vendor/assets/ace-1.1.8/mode/_test/tokens_abap.json +189 -0
  172. data/vendor/assets/ace-1.1.8/mode/_test/tokens_actionscript.json +263 -0
  173. data/vendor/assets/ace-1.1.8/mode/_test/tokens_ada.json +39 -0
  174. data/vendor/assets/ace-1.1.8/mode/_test/tokens_asciidoc.json +422 -0
  175. data/vendor/assets/ace-1.1.8/mode/_test/tokens_assembly_x86.json +114 -0
  176. data/vendor/assets/ace-1.1.8/mode/_test/tokens_autohotkey.json +261 -0
  177. data/vendor/assets/ace-1.1.8/mode/_test/tokens_batchfile.json +70 -0
  178. data/vendor/assets/ace-1.1.8/mode/_test/tokens_c9search.json +131 -0
  179. data/vendor/assets/ace-1.1.8/mode/_test/tokens_c_cpp.json +185 -0
  180. data/vendor/assets/ace-1.1.8/mode/_test/tokens_cirru.json +267 -0
  181. data/vendor/assets/ace-1.1.8/mode/_test/tokens_clojure.json +162 -0
  182. data/vendor/assets/ace-1.1.8/mode/_test/tokens_cobol.json +4 -0
  183. data/vendor/assets/ace-1.1.8/mode/_test/tokens_coffee.json +545 -0
  184. data/vendor/assets/ace-1.1.8/mode/_test/tokens_coldfusion.json +26 -0
  185. data/vendor/assets/ace-1.1.8/mode/_test/tokens_csharp.json +31 -0
  186. data/vendor/assets/ace-1.1.8/mode/_test/tokens_css.json +148 -0
  187. data/vendor/assets/ace-1.1.8/mode/_test/tokens_curly.json +56 -0
  188. data/vendor/assets/ace-1.1.8/mode/_test/tokens_d.json +111 -0
  189. data/vendor/assets/ace-1.1.8/mode/_test/tokens_dart.json +368 -0
  190. data/vendor/assets/ace-1.1.8/mode/_test/tokens_diff.json +262 -0
  191. data/vendor/assets/ace-1.1.8/mode/_test/tokens_dot.json +2254 -0
  192. data/vendor/assets/ace-1.1.8/mode/_test/tokens_eiffel.json +141 -0
  193. data/vendor/assets/ace-1.1.8/mode/_test/tokens_ejs.json +296 -0
  194. data/vendor/assets/ace-1.1.8/mode/_test/tokens_elixir.json +196 -0
  195. data/vendor/assets/ace-1.1.8/mode/_test/tokens_elm.json +198 -0
  196. data/vendor/assets/ace-1.1.8/mode/_test/tokens_erlang.json +166 -0
  197. data/vendor/assets/ace-1.1.8/mode/_test/tokens_forth.json +219 -0
  198. data/vendor/assets/ace-1.1.8/mode/_test/tokens_ftl.json +341 -0
  199. data/vendor/assets/ace-1.1.8/mode/_test/tokens_gcode.json +296 -0
  200. data/vendor/assets/ace-1.1.8/mode/_test/tokens_gherkin.json +142 -0
  201. data/vendor/assets/ace-1.1.8/mode/_test/tokens_gitignore.json +33 -0
  202. data/vendor/assets/ace-1.1.8/mode/_test/tokens_glsl.json +127 -0
  203. data/vendor/assets/ace-1.1.8/mode/_test/tokens_golang.json +256 -0
  204. data/vendor/assets/ace-1.1.8/mode/_test/tokens_groovy.json +410 -0
  205. data/vendor/assets/ace-1.1.8/mode/_test/tokens_haml.json +174 -0
  206. data/vendor/assets/ace-1.1.8/mode/_test/tokens_handlebars.json +81 -0
  207. data/vendor/assets/ace-1.1.8/mode/_test/tokens_haskell.json +156 -0
  208. data/vendor/assets/ace-1.1.8/mode/_test/tokens_haxe.json +143 -0
  209. data/vendor/assets/ace-1.1.8/mode/_test/tokens_html.json +63 -0
  210. data/vendor/assets/ace-1.1.8/mode/_test/tokens_html_ruby.json +257 -0
  211. data/vendor/assets/ace-1.1.8/mode/_test/tokens_ini.json +23 -0
  212. data/vendor/assets/ace-1.1.8/mode/_test/tokens_io.json +49 -0
  213. data/vendor/assets/ace-1.1.8/mode/_test/tokens_jack.json +1786 -0
  214. data/vendor/assets/ace-1.1.8/mode/_test/tokens_jade.json +188 -0
  215. data/vendor/assets/ace-1.1.8/mode/_test/tokens_java.json +95 -0
  216. data/vendor/assets/ace-1.1.8/mode/_test/tokens_javascript.json +593 -0
  217. data/vendor/assets/ace-1.1.8/mode/_test/tokens_json.json +412 -0
  218. data/vendor/assets/ace-1.1.8/mode/_test/tokens_jsoniq.json +4 -0
  219. data/vendor/assets/ace-1.1.8/mode/_test/tokens_jsp.json +435 -0
  220. data/vendor/assets/ace-1.1.8/mode/_test/tokens_jsx.json +51 -0
  221. data/vendor/assets/ace-1.1.8/mode/_test/tokens_julia.json +111 -0
  222. data/vendor/assets/ace-1.1.8/mode/_test/tokens_latex.json +127 -0
  223. data/vendor/assets/ace-1.1.8/mode/_test/tokens_less.json +204 -0
  224. data/vendor/assets/ace-1.1.8/mode/_test/tokens_liquid.json +551 -0
  225. data/vendor/assets/ace-1.1.8/mode/_test/tokens_lisp.json +248 -0
  226. data/vendor/assets/ace-1.1.8/mode/_test/tokens_livescript.json +6 -0
  227. data/vendor/assets/ace-1.1.8/mode/_test/tokens_logiql.json +190 -0
  228. data/vendor/assets/ace-1.1.8/mode/_test/tokens_lsl.json +503 -0
  229. data/vendor/assets/ace-1.1.8/mode/_test/tokens_lua.json +348 -0
  230. data/vendor/assets/ace-1.1.8/mode/_test/tokens_luapage.json +633 -0
  231. data/vendor/assets/ace-1.1.8/mode/_test/tokens_lucene.json +92 -0
  232. data/vendor/assets/ace-1.1.8/mode/_test/tokens_markdown.json +114 -0
  233. data/vendor/assets/ace-1.1.8/mode/_test/tokens_matlab.json +90 -0
  234. data/vendor/assets/ace-1.1.8/mode/_test/tokens_mel.json +257 -0
  235. data/vendor/assets/ace-1.1.8/mode/_test/tokens_mushcode.json +790 -0
  236. data/vendor/assets/ace-1.1.8/mode/_test/tokens_mysql.json +4 -0
  237. data/vendor/assets/ace-1.1.8/mode/_test/tokens_nix.json +360 -0
  238. data/vendor/assets/ace-1.1.8/mode/_test/tokens_objectivec.json +792 -0
  239. data/vendor/assets/ace-1.1.8/mode/_test/tokens_ocaml.json +200 -0
  240. data/vendor/assets/ace-1.1.8/mode/_test/tokens_pascal.json +297 -0
  241. data/vendor/assets/ace-1.1.8/mode/_test/tokens_perl.json +227 -0
  242. data/vendor/assets/ace-1.1.8/mode/_test/tokens_pgsql.json +889 -0
  243. data/vendor/assets/ace-1.1.8/mode/_test/tokens_php.json +171 -0
  244. data/vendor/assets/ace-1.1.8/mode/_test/tokens_powershell.json +184 -0
  245. data/vendor/assets/ace-1.1.8/mode/_test/tokens_prolog.json +245 -0
  246. data/vendor/assets/ace-1.1.8/mode/_test/tokens_properties.json +68 -0
  247. data/vendor/assets/ace-1.1.8/mode/_test/tokens_protobuf.json +136 -0
  248. data/vendor/assets/ace-1.1.8/mode/_test/tokens_python.json +152 -0
  249. data/vendor/assets/ace-1.1.8/mode/_test/tokens_r.json +235 -0
  250. data/vendor/assets/ace-1.1.8/mode/_test/tokens_rdoc.json +441 -0
  251. data/vendor/assets/ace-1.1.8/mode/_test/tokens_rhtml.json +106 -0
  252. data/vendor/assets/ace-1.1.8/mode/_test/tokens_ruby.json +234 -0
  253. data/vendor/assets/ace-1.1.8/mode/_test/tokens_rust.json +136 -0
  254. data/vendor/assets/ace-1.1.8/mode/_test/tokens_sass.json +229 -0
  255. data/vendor/assets/ace-1.1.8/mode/_test/tokens_scad.json +194 -0
  256. data/vendor/assets/ace-1.1.8/mode/_test/tokens_scala.json +542 -0
  257. data/vendor/assets/ace-1.1.8/mode/_test/tokens_scheme.json +216 -0
  258. data/vendor/assets/ace-1.1.8/mode/_test/tokens_scss.json +123 -0
  259. data/vendor/assets/ace-1.1.8/mode/_test/tokens_sh.json +334 -0
  260. data/vendor/assets/ace-1.1.8/mode/_test/tokens_sjs.json +276 -0
  261. data/vendor/assets/ace-1.1.8/mode/_test/tokens_smarty.json +98 -0
  262. data/vendor/assets/ace-1.1.8/mode/_test/tokens_snippets.json +159 -0
  263. data/vendor/assets/ace-1.1.8/mode/_test/tokens_soy_template.json +286 -0
  264. data/vendor/assets/ace-1.1.8/mode/_test/tokens_space.json +322 -0
  265. data/vendor/assets/ace-1.1.8/mode/_test/tokens_sql.json +54 -0
  266. data/vendor/assets/ace-1.1.8/mode/_test/tokens_stylus.json +271 -0
  267. data/vendor/assets/ace-1.1.8/mode/_test/tokens_svg.json +684 -0
  268. data/vendor/assets/ace-1.1.8/mode/_test/tokens_tcl.json +385 -0
  269. data/vendor/assets/ace-1.1.8/mode/_test/tokens_tex.json +130 -0
  270. data/vendor/assets/ace-1.1.8/mode/_test/tokens_text.json +29 -0
  271. data/vendor/assets/ace-1.1.8/mode/_test/tokens_textile.json +113 -0
  272. data/vendor/assets/ace-1.1.8/mode/_test/tokens_toml.json +131 -0
  273. data/vendor/assets/ace-1.1.8/mode/_test/tokens_twig.json +288 -0
  274. data/vendor/assets/ace-1.1.8/mode/_test/tokens_typescript.json +559 -0
  275. data/vendor/assets/ace-1.1.8/mode/_test/tokens_vala.json +158 -0
  276. data/vendor/assets/ace-1.1.8/mode/_test/tokens_vbscript.json +205 -0
  277. data/vendor/assets/ace-1.1.8/mode/_test/tokens_velocity.json +285 -0
  278. data/vendor/assets/ace-1.1.8/mode/_test/tokens_verilog.json +113 -0
  279. data/vendor/assets/ace-1.1.8/mode/_test/tokens_vhdl.json +271 -0
  280. data/vendor/assets/ace-1.1.8/mode/_test/tokens_xml.json +43 -0
  281. data/vendor/assets/ace-1.1.8/mode/_test/tokens_xquery.json +44 -0
  282. data/vendor/assets/ace-1.1.8/mode/_test/tokens_yaml.json +150 -0
  283. data/vendor/assets/ace-1.1.8/mode/abap.js +77 -0
  284. data/vendor/assets/ace-1.1.8/mode/abap_highlight_rules.js +134 -0
  285. data/vendor/assets/ace-1.1.8/mode/actionscript.js +58 -0
  286. data/vendor/assets/ace-1.1.8/mode/actionscript_highlight_rules.js +141 -0
  287. data/vendor/assets/ace-1.1.8/mode/ada.js +54 -0
  288. data/vendor/assets/ace-1.1.8/mode/ada_highlight_rules.js +93 -0
  289. data/vendor/assets/ace-1.1.8/mode/apache_conf.js +62 -0
  290. data/vendor/assets/ace-1.1.8/mode/apache_conf_highlight_rules.js +231 -0
  291. data/vendor/assets/ace-1.1.8/mode/applescript.js +55 -0
  292. data/vendor/assets/ace-1.1.8/mode/applescript_highlight_rules.js +139 -0
  293. data/vendor/assets/ace-1.1.8/mode/asciidoc.js +64 -0
  294. data/vendor/assets/ace-1.1.8/mode/asciidoc_highlight_rules.js +234 -0
  295. data/vendor/assets/ace-1.1.8/mode/assembly_x86.js +56 -0
  296. data/vendor/assets/ace-1.1.8/mode/assembly_x86_highlight_rules.js +114 -0
  297. data/vendor/assets/ace-1.1.8/mode/autohotkey.js +57 -0
  298. data/vendor/assets/ace-1.1.8/mode/autohotkey_highlight_rules.js +107 -0
  299. data/vendor/assets/ace-1.1.8/mode/batchfile.js +61 -0
  300. data/vendor/assets/ace-1.1.8/mode/batchfile_highlight_rules.js +97 -0
  301. data/vendor/assets/ace-1.1.8/mode/behaviour.js +90 -0
  302. data/vendor/assets/ace-1.1.8/mode/behaviour/behaviour_test.js +133 -0
  303. data/vendor/assets/ace-1.1.8/mode/behaviour/css.js +108 -0
  304. data/vendor/assets/ace-1.1.8/mode/behaviour/cstyle.js +400 -0
  305. data/vendor/assets/ace-1.1.8/mode/behaviour/html.js +46 -0
  306. data/vendor/assets/ace-1.1.8/mode/behaviour/xml.js +202 -0
  307. data/vendor/assets/ace-1.1.8/mode/behaviour/xquery.js +92 -0
  308. data/vendor/assets/ace-1.1.8/mode/c9search.js +67 -0
  309. data/vendor/assets/ace-1.1.8/mode/c9search_highlight_rules.js +182 -0
  310. data/vendor/assets/ace-1.1.8/mode/c_cpp.js +101 -0
  311. data/vendor/assets/ace-1.1.8/mode/c_cpp_highlight_rules.js +196 -0
  312. data/vendor/assets/ace-1.1.8/mode/cirru.js +51 -0
  313. data/vendor/assets/ace-1.1.8/mode/cirru_highlight_rules.js +125 -0
  314. data/vendor/assets/ace-1.1.8/mode/clojure.js +128 -0
  315. data/vendor/assets/ace-1.1.8/mode/clojure_highlight_rules.js +200 -0
  316. data/vendor/assets/ace-1.1.8/mode/cobol.js +53 -0
  317. data/vendor/assets/ace-1.1.8/mode/cobol_highlight_rules.js +100 -0
  318. data/vendor/assets/ace-1.1.8/mode/coffee.js +135 -0
  319. data/vendor/assets/ace-1.1.8/mode/coffee/coffee-script.js +62 -0
  320. data/vendor/assets/ace-1.1.8/mode/coffee/helpers.js +271 -0
  321. data/vendor/assets/ace-1.1.8/mode/coffee/lexer.js +935 -0
  322. data/vendor/assets/ace-1.1.8/mode/coffee/nodes.js +3106 -0
  323. data/vendor/assets/ace-1.1.8/mode/coffee/parser.js +724 -0
  324. data/vendor/assets/ace-1.1.8/mode/coffee/parser_test.js +88 -0
  325. data/vendor/assets/ace-1.1.8/mode/coffee/rewriter.js +516 -0
  326. data/vendor/assets/ace-1.1.8/mode/coffee/scope.js +174 -0
  327. data/vendor/assets/ace-1.1.8/mode/coffee_highlight_rules.js +233 -0
  328. data/vendor/assets/ace-1.1.8/mode/coffee_worker.js +74 -0
  329. data/vendor/assets/ace-1.1.8/mode/coldfusion.js +61 -0
  330. data/vendor/assets/ace-1.1.8/mode/coldfusion_highlight_rules.js +49 -0
  331. data/vendor/assets/ace-1.1.8/mode/coldfusion_test.js +67 -0
  332. data/vendor/assets/ace-1.1.8/mode/csharp.js +61 -0
  333. data/vendor/assets/ace-1.1.8/mode/csharp_highlight_rules.js +93 -0
  334. data/vendor/assets/ace-1.1.8/mode/css.js +100 -0
  335. data/vendor/assets/ace-1.1.8/mode/css/csslint.js +9628 -0
  336. data/vendor/assets/ace-1.1.8/mode/css_highlight_rules.js +179 -0
  337. data/vendor/assets/ace-1.1.8/mode/css_test.js +78 -0
  338. data/vendor/assets/ace-1.1.8/mode/css_worker.js +100 -0
  339. data/vendor/assets/ace-1.1.8/mode/css_worker_test.js +68 -0
  340. data/vendor/assets/ace-1.1.8/mode/curly.js +63 -0
  341. data/vendor/assets/ace-1.1.8/mode/curly_highlight_rules.js +66 -0
  342. data/vendor/assets/ace-1.1.8/mode/d.js +56 -0
  343. data/vendor/assets/ace-1.1.8/mode/d_highlight_rules.js +334 -0
  344. data/vendor/assets/ace-1.1.8/mode/dart.js +62 -0
  345. data/vendor/assets/ace-1.1.8/mode/dart_highlight_rules.js +186 -0
  346. data/vendor/assets/ace-1.1.8/mode/diff.js +52 -0
  347. data/vendor/assets/ace-1.1.8/mode/diff_highlight_rules.js +108 -0
  348. data/vendor/assets/ace-1.1.8/mode/django.js +119 -0
  349. data/vendor/assets/ace-1.1.8/mode/doc_comment_highlight_rules.js +79 -0
  350. data/vendor/assets/ace-1.1.8/mode/dockerfile.js +52 -0
  351. data/vendor/assets/ace-1.1.8/mode/dockerfile_highlight_rules.js +57 -0
  352. data/vendor/assets/ace-1.1.8/mode/dot.js +55 -0
  353. data/vendor/assets/ace-1.1.8/mode/dot_highlight_rules.js +126 -0
  354. data/vendor/assets/ace-1.1.8/mode/eiffel.js +52 -0
  355. data/vendor/assets/ace-1.1.8/mode/eiffel_highlight_rules.js +143 -0
  356. data/vendor/assets/ace-1.1.8/mode/ejs.js +109 -0
  357. data/vendor/assets/ace-1.1.8/mode/elixir.js +58 -0
  358. data/vendor/assets/ace-1.1.8/mode/elixir_highlight_rules.js +433 -0
  359. data/vendor/assets/ace-1.1.8/mode/elm.js +58 -0
  360. data/vendor/assets/ace-1.1.8/mode/elm_highlight_rules.js +162 -0
  361. data/vendor/assets/ace-1.1.8/mode/erlang.js +57 -0
  362. data/vendor/assets/ace-1.1.8/mode/erlang_highlight_rules.js +876 -0
  363. data/vendor/assets/ace-1.1.8/mode/folding/asciidoc.js +142 -0
  364. data/vendor/assets/ace-1.1.8/mode/folding/c9search.js +83 -0
  365. data/vendor/assets/ace-1.1.8/mode/folding/coffee.js +120 -0
  366. data/vendor/assets/ace-1.1.8/mode/folding/coffee_test.js +101 -0
  367. data/vendor/assets/ace-1.1.8/mode/folding/csharp.js +138 -0
  368. data/vendor/assets/ace-1.1.8/mode/folding/cstyle.js +124 -0
  369. data/vendor/assets/ace-1.1.8/mode/folding/cstyle_test.js +109 -0
  370. data/vendor/assets/ace-1.1.8/mode/folding/diff.js +69 -0
  371. data/vendor/assets/ace-1.1.8/mode/folding/fold_mode.js +120 -0
  372. data/vendor/assets/ace-1.1.8/mode/folding/html.js +48 -0
  373. data/vendor/assets/ace-1.1.8/mode/folding/html_test.js +162 -0
  374. data/vendor/assets/ace-1.1.8/mode/folding/ini.js +80 -0
  375. data/vendor/assets/ace-1.1.8/mode/folding/latex.js +162 -0
  376. data/vendor/assets/ace-1.1.8/mode/folding/lua.js +163 -0
  377. data/vendor/assets/ace-1.1.8/mode/folding/markdown.js +125 -0
  378. data/vendor/assets/ace-1.1.8/mode/folding/mixed.js +83 -0
  379. data/vendor/assets/ace-1.1.8/mode/folding/pythonic.js +58 -0
  380. data/vendor/assets/ace-1.1.8/mode/folding/pythonic_test.js +98 -0
  381. data/vendor/assets/ace-1.1.8/mode/folding/velocity.js +120 -0
  382. data/vendor/assets/ace-1.1.8/mode/folding/xml.js +277 -0
  383. data/vendor/assets/ace-1.1.8/mode/folding/xml_test.js +110 -0
  384. data/vendor/assets/ace-1.1.8/mode/forth.js +58 -0
  385. data/vendor/assets/ace-1.1.8/mode/forth_highlight_rules.js +164 -0
  386. data/vendor/assets/ace-1.1.8/mode/ftl.js +49 -0
  387. data/vendor/assets/ace-1.1.8/mode/ftl_highlight_rules.js +195 -0
  388. data/vendor/assets/ace-1.1.8/mode/gcode.js +51 -0
  389. data/vendor/assets/ace-1.1.8/mode/gcode_highlight_rules.js +94 -0
  390. data/vendor/assets/ace-1.1.8/mode/gherkin.js +80 -0
  391. data/vendor/assets/ace-1.1.8/mode/gherkin_highlight_rules.js +113 -0
  392. data/vendor/assets/ace-1.1.8/mode/gitignore.js +20 -0
  393. data/vendor/assets/ace-1.1.8/mode/gitignore_highlight_rules.js +31 -0
  394. data/vendor/assets/ace-1.1.8/mode/glsl.js +56 -0
  395. data/vendor/assets/ace-1.1.8/mode/glsl_highlight_rules.js +81 -0
  396. data/vendor/assets/ace-1.1.8/mode/golang.js +55 -0
  397. data/vendor/assets/ace-1.1.8/mode/golang_highlight_rules.js +108 -0
  398. data/vendor/assets/ace-1.1.8/mode/groovy.js +24 -0
  399. data/vendor/assets/ace-1.1.8/mode/groovy_highlight_rules.js +173 -0
  400. data/vendor/assets/ace-1.1.8/mode/haml.js +61 -0
  401. data/vendor/assets/ace-1.1.8/mode/haml_highlight_rules.js +132 -0
  402. data/vendor/assets/ace-1.1.8/mode/handlebars.js +29 -0
  403. data/vendor/assets/ace-1.1.8/mode/handlebars_highlight_rules.js +72 -0
  404. data/vendor/assets/ace-1.1.8/mode/haskell.js +62 -0
  405. data/vendor/assets/ace-1.1.8/mode/haskell_highlight_rules.js +246 -0
  406. data/vendor/assets/ace-1.1.8/mode/haxe.js +56 -0
  407. data/vendor/assets/ace-1.1.8/mode/haxe_highlight_rules.js +98 -0
  408. data/vendor/assets/ace-1.1.8/mode/html.js +106 -0
  409. data/vendor/assets/ace-1.1.8/mode/html/saxparser.js +10430 -0
  410. data/vendor/assets/ace-1.1.8/mode/html_completions.js +305 -0
  411. data/vendor/assets/ace-1.1.8/mode/html_highlight_rules.js +111 -0
  412. data/vendor/assets/ace-1.1.8/mode/html_ruby.js +59 -0
  413. data/vendor/assets/ace-1.1.8/mode/html_ruby_highlight_rules.js +84 -0
  414. data/vendor/assets/ace-1.1.8/mode/html_test.js +67 -0
  415. data/vendor/assets/ace-1.1.8/mode/html_worker.js +92 -0
  416. data/vendor/assets/ace-1.1.8/mode/ini.js +53 -0
  417. data/vendor/assets/ace-1.1.8/mode/ini_highlight_rules.js +112 -0
  418. data/vendor/assets/ace-1.1.8/mode/io.js +58 -0
  419. data/vendor/assets/ace-1.1.8/mode/io_highlight_rules.js +120 -0
  420. data/vendor/assets/ace-1.1.8/mode/jack.js +79 -0
  421. data/vendor/assets/ace-1.1.8/mode/jack_highlight_rules.js +142 -0
  422. data/vendor/assets/ace-1.1.8/mode/jade.js +57 -0
  423. data/vendor/assets/ace-1.1.8/mode/jade_highlight_rules.js +341 -0
  424. data/vendor/assets/ace-1.1.8/mode/java.js +24 -0
  425. data/vendor/assets/ace-1.1.8/mode/java_highlight_rules.js +128 -0
  426. data/vendor/assets/ace-1.1.8/mode/javascript.js +116 -0
  427. data/vendor/assets/ace-1.1.8/mode/javascript/jshint.js +9459 -0
  428. data/vendor/assets/ace-1.1.8/mode/javascript_highlight_rules.js +405 -0
  429. data/vendor/assets/ace-1.1.8/mode/javascript_test.js +213 -0
  430. data/vendor/assets/ace-1.1.8/mode/javascript_worker.js +187 -0
  431. data/vendor/assets/ace-1.1.8/mode/javascript_worker_test.js +106 -0
  432. data/vendor/assets/ace-1.1.8/mode/js_regex_highlight_rules.js +94 -0
  433. data/vendor/assets/ace-1.1.8/mode/json.js +93 -0
  434. data/vendor/assets/ace-1.1.8/mode/json/json_parse.js +346 -0
  435. data/vendor/assets/ace-1.1.8/mode/json_highlight_rules.js +100 -0
  436. data/vendor/assets/ace-1.1.8/mode/json_worker.js +68 -0
  437. data/vendor/assets/ace-1.1.8/mode/json_worker_test.js +101 -0
  438. data/vendor/assets/ace-1.1.8/mode/jsoniq.js +203 -0
  439. data/vendor/assets/ace-1.1.8/mode/jsp.js +55 -0
  440. data/vendor/assets/ace-1.1.8/mode/jsp_highlight_rules.js +91 -0
  441. data/vendor/assets/ace-1.1.8/mode/jsx.js +56 -0
  442. data/vendor/assets/ace-1.1.8/mode/jsx_highlight_rules.js +120 -0
  443. data/vendor/assets/ace-1.1.8/mode/julia.js +62 -0
  444. data/vendor/assets/ace-1.1.8/mode/julia_highlight_rules.js +170 -0
  445. data/vendor/assets/ace-1.1.8/mode/latex.js +26 -0
  446. data/vendor/assets/ace-1.1.8/mode/latex_highlight_rules.js +73 -0
  447. data/vendor/assets/ace-1.1.8/mode/less.js +84 -0
  448. data/vendor/assets/ace-1.1.8/mode/less_highlight_rules.js +271 -0
  449. data/vendor/assets/ace-1.1.8/mode/liquid.js +82 -0
  450. data/vendor/assets/ace-1.1.8/mode/liquid_highlight_rules.js +131 -0
  451. data/vendor/assets/ace-1.1.8/mode/lisp.js +56 -0
  452. data/vendor/assets/ace-1.1.8/mode/lisp_highlight_rules.js +124 -0
  453. data/vendor/assets/ace-1.1.8/mode/livescript.js +249 -0
  454. data/vendor/assets/ace-1.1.8/mode/logiql.js +139 -0
  455. data/vendor/assets/ace-1.1.8/mode/logiql_highlight_rules.js +119 -0
  456. data/vendor/assets/ace-1.1.8/mode/logiql_test.js +98 -0
  457. data/vendor/assets/ace-1.1.8/mode/lsl.js +92 -0
  458. data/vendor/assets/ace-1.1.8/mode/lsl_highlight_rules.js +123 -0
  459. data/vendor/assets/ace-1.1.8/mode/lua.js +168 -0
  460. data/vendor/assets/ace-1.1.8/mode/lua/luaparse.js +1989 -0
  461. data/vendor/assets/ace-1.1.8/mode/lua_highlight_rules.js +193 -0
  462. data/vendor/assets/ace-1.1.8/mode/lua_worker.js +71 -0
  463. data/vendor/assets/ace-1.1.8/mode/luapage.js +24 -0
  464. data/vendor/assets/ace-1.1.8/mode/luapage_highlight_rules.js +49 -0
  465. data/vendor/assets/ace-1.1.8/mode/lucene.js +19 -0
  466. data/vendor/assets/ace-1.1.8/mode/lucene_highlight_rules.js +49 -0
  467. data/vendor/assets/ace-1.1.8/mode/makefile.js +58 -0
  468. data/vendor/assets/ace-1.1.8/mode/makefile_highlight_rules.js +75 -0
  469. data/vendor/assets/ace-1.1.8/mode/markdown.js +76 -0
  470. data/vendor/assets/ace-1.1.8/mode/markdown_highlight_rules.js +228 -0
  471. data/vendor/assets/ace-1.1.8/mode/matching_brace_outdent.js +69 -0
  472. data/vendor/assets/ace-1.1.8/mode/matching_parens_outdent.js +74 -0
  473. data/vendor/assets/ace-1.1.8/mode/matlab.js +55 -0
  474. data/vendor/assets/ace-1.1.8/mode/matlab_highlight_rules.js +262 -0
  475. data/vendor/assets/ace-1.1.8/mode/mel.js +56 -0
  476. data/vendor/assets/ace-1.1.8/mode/mel_highlight_rules.js +133 -0
  477. data/vendor/assets/ace-1.1.8/mode/mushcode.js +116 -0
  478. data/vendor/assets/ace-1.1.8/mode/mushcode_highlight_rules.js +569 -0
  479. data/vendor/assets/ace-1.1.8/mode/mysql.js +51 -0
  480. data/vendor/assets/ace-1.1.8/mode/mysql_highlight_rules.js +122 -0
  481. data/vendor/assets/ace-1.1.8/mode/nix.js +62 -0
  482. data/vendor/assets/ace-1.1.8/mode/nix_highlight_rules.js +119 -0
  483. data/vendor/assets/ace-1.1.8/mode/objectivec.js +61 -0
  484. data/vendor/assets/ace-1.1.8/mode/objectivec_highlight_rules.js +331 -0
  485. data/vendor/assets/ace-1.1.8/mode/ocaml.js +97 -0
  486. data/vendor/assets/ace-1.1.8/mode/ocaml_highlight_rules.js +337 -0
  487. data/vendor/assets/ace-1.1.8/mode/pascal.js +67 -0
  488. data/vendor/assets/ace-1.1.8/mode/pascal_highlight_rules.js +127 -0
  489. data/vendor/assets/ace-1.1.8/mode/perl.js +90 -0
  490. data/vendor/assets/ace-1.1.8/mode/perl_highlight_rules.js +165 -0
  491. data/vendor/assets/ace-1.1.8/mode/pgsql.js +59 -0
  492. data/vendor/assets/ace-1.1.8/mode/pgsql_highlight_rules.js +619 -0
  493. data/vendor/assets/ace-1.1.8/mode/php.js +158 -0
  494. data/vendor/assets/ace-1.1.8/mode/php/php.js +5031 -0
  495. data/vendor/assets/ace-1.1.8/mode/php_highlight_rules.js +1085 -0
  496. data/vendor/assets/ace-1.1.8/mode/php_test.js +65 -0
  497. data/vendor/assets/ace-1.1.8/mode/php_worker.js +81 -0
  498. data/vendor/assets/ace-1.1.8/mode/plain_text.js +55 -0
  499. data/vendor/assets/ace-1.1.8/mode/plain_text_test.js +56 -0
  500. data/vendor/assets/ace-1.1.8/mode/powershell.js +61 -0
  501. data/vendor/assets/ace-1.1.8/mode/powershell_highlight_rules.js +145 -0
  502. data/vendor/assets/ace-1.1.8/mode/praat.js +84 -0
  503. data/vendor/assets/ace-1.1.8/mode/praat_highlight_rules.js +262 -0
  504. data/vendor/assets/ace-1.1.8/mode/prolog.js +62 -0
  505. data/vendor/assets/ace-1.1.8/mode/prolog_highlight_rules.js +238 -0
  506. data/vendor/assets/ace-1.1.8/mode/properties.js +48 -0
  507. data/vendor/assets/ace-1.1.8/mode/properties_highlight_rules.js +86 -0
  508. data/vendor/assets/ace-1.1.8/mode/protobuf.js +63 -0
  509. data/vendor/assets/ace-1.1.8/mode/protobuf_highlight_rules.js +66 -0
  510. data/vendor/assets/ace-1.1.8/mode/python.js +113 -0
  511. data/vendor/assets/ace-1.1.8/mode/python_highlight_rules.js +191 -0
  512. data/vendor/assets/ace-1.1.8/mode/python_test.js +79 -0
  513. data/vendor/assets/ace-1.1.8/mode/r.js +154 -0
  514. data/vendor/assets/ace-1.1.8/mode/r_highlight_rules.js +208 -0
  515. data/vendor/assets/ace-1.1.8/mode/rdoc.js +61 -0
  516. data/vendor/assets/ace-1.1.8/mode/rdoc_highlight_rules.js +119 -0
  517. data/vendor/assets/ace-1.1.8/mode/rhtml.js +87 -0
  518. data/vendor/assets/ace-1.1.8/mode/rhtml_highlight_rules.js +66 -0
  519. data/vendor/assets/ace-1.1.8/mode/ruby.js +100 -0
  520. data/vendor/assets/ace-1.1.8/mode/ruby_highlight_rules.js +323 -0
  521. data/vendor/assets/ace-1.1.8/mode/ruby_test.js +77 -0
  522. data/vendor/assets/ace-1.1.8/mode/rust.js +58 -0
  523. data/vendor/assets/ace-1.1.8/mode/rust_highlight_rules.js +158 -0
  524. data/vendor/assets/ace-1.1.8/mode/sass.js +52 -0
  525. data/vendor/assets/ace-1.1.8/mode/sass_highlight_rules.js +79 -0
  526. data/vendor/assets/ace-1.1.8/mode/scad.js +99 -0
  527. data/vendor/assets/ace-1.1.8/mode/scad_highlight_rules.js +142 -0
  528. data/vendor/assets/ace-1.1.8/mode/scala.js +25 -0
  529. data/vendor/assets/ace-1.1.8/mode/scala_highlight_rules.js +160 -0
  530. data/vendor/assets/ace-1.1.8/mode/scheme.js +56 -0
  531. data/vendor/assets/ace-1.1.8/mode/scheme_highlight_rules.js +123 -0
  532. data/vendor/assets/ace-1.1.8/mode/scss.js +84 -0
  533. data/vendor/assets/ace-1.1.8/mode/scss_highlight_rules.js +296 -0
  534. data/vendor/assets/ace-1.1.8/mode/sh.js +116 -0
  535. data/vendor/assets/ace-1.1.8/mode/sh_highlight_rules.js +203 -0
  536. data/vendor/assets/ace-1.1.8/mode/sjs.js +56 -0
  537. data/vendor/assets/ace-1.1.8/mode/sjs_highlight_rules.js +233 -0
  538. data/vendor/assets/ace-1.1.8/mode/smarty.js +51 -0
  539. data/vendor/assets/ace-1.1.8/mode/smarty_highlight_rules.js +139 -0
  540. data/vendor/assets/ace-1.1.8/mode/snippets.js +113 -0
  541. data/vendor/assets/ace-1.1.8/mode/soy_template.js +60 -0
  542. data/vendor/assets/ace-1.1.8/mode/soy_template_highlight_rules.js +356 -0
  543. data/vendor/assets/ace-1.1.8/mode/space.js +21 -0
  544. data/vendor/assets/ace-1.1.8/mode/space_highlight_rules.js +56 -0
  545. data/vendor/assets/ace-1.1.8/mode/sql.js +53 -0
  546. data/vendor/assets/ace-1.1.8/mode/sql_highlight_rules.js +99 -0
  547. data/vendor/assets/ace-1.1.8/mode/stylus.js +62 -0
  548. data/vendor/assets/ace-1.1.8/mode/stylus_highlight_rules.js +165 -0
  549. data/vendor/assets/ace-1.1.8/mode/svg.js +69 -0
  550. data/vendor/assets/ace-1.1.8/mode/svg_highlight_rules.js +49 -0
  551. data/vendor/assets/ace-1.1.8/mode/tcl.js +84 -0
  552. data/vendor/assets/ace-1.1.8/mode/tcl_highlight_rules.js +172 -0
  553. data/vendor/assets/ace-1.1.8/mode/tex.js +68 -0
  554. data/vendor/assets/ace-1.1.8/mode/tex_highlight_rules.js +127 -0
  555. data/vendor/assets/ace-1.1.8/mode/text.js +386 -0
  556. data/vendor/assets/ace-1.1.8/mode/text_highlight_rules.js +234 -0
  557. data/vendor/assets/ace-1.1.8/mode/text_test.js +64 -0
  558. data/vendor/assets/ace-1.1.8/mode/textile.js +67 -0
  559. data/vendor/assets/ace-1.1.8/mode/textile_highlight_rules.js +93 -0
  560. data/vendor/assets/ace-1.1.8/mode/toml.js +56 -0
  561. data/vendor/assets/ace-1.1.8/mode/toml_highlight_rules.js +103 -0
  562. data/vendor/assets/ace-1.1.8/mode/twig.js +81 -0
  563. data/vendor/assets/ace-1.1.8/mode/twig_highlight_rules.js +166 -0
  564. data/vendor/assets/ace-1.1.8/mode/typescript.js +62 -0
  565. data/vendor/assets/ace-1.1.8/mode/typescript_highlight_rules.js +98 -0
  566. data/vendor/assets/ace-1.1.8/mode/vala.js +105 -0
  567. data/vendor/assets/ace-1.1.8/mode/vala_highlight_rules.js +457 -0
  568. data/vendor/assets/ace-1.1.8/mode/vbscript.js +60 -0
  569. data/vendor/assets/ace-1.1.8/mode/vbscript_highlight_rules.js +246 -0
  570. data/vendor/assets/ace-1.1.8/mode/velocity.js +58 -0
  571. data/vendor/assets/ace-1.1.8/mode/velocity_highlight_rules.js +177 -0
  572. data/vendor/assets/ace-1.1.8/mode/verilog.js +54 -0
  573. data/vendor/assets/ace-1.1.8/mode/verilog_highlight_rules.js +101 -0
  574. data/vendor/assets/ace-1.1.8/mode/vhdl.js +52 -0
  575. data/vendor/assets/ace-1.1.8/mode/vhdl_highlight_rules.js +115 -0
  576. data/vendor/assets/ace-1.1.8/mode/xml.js +59 -0
  577. data/vendor/assets/ace-1.1.8/mode/xml_highlight_rules.js +242 -0
  578. data/vendor/assets/ace-1.1.8/mode/xml_test.js +75 -0
  579. data/vendor/assets/ace-1.1.8/mode/xquery.js +216 -0
  580. data/vendor/assets/ace-1.1.8/mode/xquery/Readme.md +1 -0
  581. data/vendor/assets/ace-1.1.8/mode/xquery/jsoniq_lexer.js +4453 -0
  582. data/vendor/assets/ace-1.1.8/mode/xquery/modules.js +4 -0
  583. data/vendor/assets/ace-1.1.8/mode/xquery/xqlint.js +78912 -0
  584. data/vendor/assets/ace-1.1.8/mode/xquery/xquery_lexer.js +4422 -0
  585. data/vendor/assets/ace-1.1.8/mode/xquery_worker.js +115 -0
  586. data/vendor/assets/ace-1.1.8/mode/yaml.js +78 -0
  587. data/vendor/assets/ace-1.1.8/mode/yaml_highlight_rules.js +113 -0
  588. data/vendor/assets/ace-1.1.8/model/editor.js +62 -0
  589. data/vendor/assets/ace-1.1.8/mouse/default_gutter_handler.js +181 -0
  590. data/vendor/assets/ace-1.1.8/mouse/default_handlers.js +278 -0
  591. data/vendor/assets/ace-1.1.8/mouse/dragdrop_handler.js +428 -0
  592. data/vendor/assets/ace-1.1.8/mouse/fold_handler.js +93 -0
  593. data/vendor/assets/ace-1.1.8/mouse/mouse_event.js +129 -0
  594. data/vendor/assets/ace-1.1.8/mouse/mouse_handler.js +203 -0
  595. data/vendor/assets/ace-1.1.8/mouse/mouse_handler_test.js +77 -0
  596. data/vendor/assets/ace-1.1.8/mouse/multi_select_handler.js +208 -0
  597. data/vendor/assets/ace-1.1.8/multi_select.js +996 -0
  598. data/vendor/assets/ace-1.1.8/multi_select_test.js +199 -0
  599. data/vendor/assets/ace-1.1.8/occur.js +193 -0
  600. data/vendor/assets/ace-1.1.8/occur_test.js +154 -0
  601. data/vendor/assets/ace-1.1.8/placeholder.js +274 -0
  602. data/vendor/assets/ace-1.1.8/placeholder_test.js +156 -0
  603. data/vendor/assets/ace-1.1.8/range.js +549 -0
  604. data/vendor/assets/ace-1.1.8/range_list.js +240 -0
  605. data/vendor/assets/ace-1.1.8/range_list_test.js +182 -0
  606. data/vendor/assets/ace-1.1.8/range_test.js +191 -0
  607. data/vendor/assets/ace-1.1.8/renderloop.js +75 -0
  608. data/vendor/assets/ace-1.1.8/requirejs/text.js +52 -0
  609. data/vendor/assets/ace-1.1.8/requirejs/text_build.js +60 -0
  610. data/vendor/assets/ace-1.1.8/scrollbar.js +270 -0
  611. data/vendor/assets/ace-1.1.8/search.js +396 -0
  612. data/vendor/assets/ace-1.1.8/search_highlight.js +82 -0
  613. data/vendor/assets/ace-1.1.8/search_test.js +461 -0
  614. data/vendor/assets/ace-1.1.8/selection.js +955 -0
  615. data/vendor/assets/ace-1.1.8/selection_test.js +480 -0
  616. data/vendor/assets/ace-1.1.8/snippets.js +949 -0
  617. data/vendor/assets/ace-1.1.8/snippets/_.snippets +240 -0
  618. data/vendor/assets/ace-1.1.8/snippets/_all_modes.js +7 -0
  619. data/vendor/assets/ace-1.1.8/snippets/_all_modes.snippets +0 -0
  620. data/vendor/assets/ace-1.1.8/snippets/abap.js +7 -0
  621. data/vendor/assets/ace-1.1.8/snippets/abap.snippets +0 -0
  622. data/vendor/assets/ace-1.1.8/snippets/actionscript.js +7 -0
  623. data/vendor/assets/ace-1.1.8/snippets/actionscript.snippets +157 -0
  624. data/vendor/assets/ace-1.1.8/snippets/ada.js +7 -0
  625. data/vendor/assets/ace-1.1.8/snippets/ada.snippets +0 -0
  626. data/vendor/assets/ace-1.1.8/snippets/all_modes.js +7 -0
  627. data/vendor/assets/ace-1.1.8/snippets/all_modes.snippets +0 -0
  628. data/vendor/assets/ace-1.1.8/snippets/apache.snippets +35 -0
  629. data/vendor/assets/ace-1.1.8/snippets/apache_conf.js +7 -0
  630. data/vendor/assets/ace-1.1.8/snippets/apache_conf.snippets +0 -0
  631. data/vendor/assets/ace-1.1.8/snippets/applescript.js +7 -0
  632. data/vendor/assets/ace-1.1.8/snippets/applescript.snippets +0 -0
  633. data/vendor/assets/ace-1.1.8/snippets/asciidoc.js +7 -0
  634. data/vendor/assets/ace-1.1.8/snippets/asciidoc.snippets +0 -0
  635. data/vendor/assets/ace-1.1.8/snippets/assembly_x86.js +7 -0
  636. data/vendor/assets/ace-1.1.8/snippets/assembly_x86.snippets +0 -0
  637. data/vendor/assets/ace-1.1.8/snippets/autohotkey.js +7 -0
  638. data/vendor/assets/ace-1.1.8/snippets/autohotkey.snippets +0 -0
  639. data/vendor/assets/ace-1.1.8/snippets/autoit.snippets +66 -0
  640. data/vendor/assets/ace-1.1.8/snippets/batchfile.js +7 -0
  641. data/vendor/assets/ace-1.1.8/snippets/batchfile.snippets +0 -0
  642. data/vendor/assets/ace-1.1.8/snippets/c.snippets +235 -0
  643. data/vendor/assets/ace-1.1.8/snippets/c9search.js +7 -0
  644. data/vendor/assets/ace-1.1.8/snippets/c9search.snippets +0 -0
  645. data/vendor/assets/ace-1.1.8/snippets/c_cpp.js +7 -0
  646. data/vendor/assets/ace-1.1.8/snippets/c_cpp.snippets +131 -0
  647. data/vendor/assets/ace-1.1.8/snippets/chef.snippets +204 -0
  648. data/vendor/assets/ace-1.1.8/snippets/cirru.js +7 -0
  649. data/vendor/assets/ace-1.1.8/snippets/cirru.snippets +0 -0
  650. data/vendor/assets/ace-1.1.8/snippets/clojure.js +7 -0
  651. data/vendor/assets/ace-1.1.8/snippets/clojure.snippets +90 -0
  652. data/vendor/assets/ace-1.1.8/snippets/cmake.snippets +58 -0
  653. data/vendor/assets/ace-1.1.8/snippets/cobol.js +7 -0
  654. data/vendor/assets/ace-1.1.8/snippets/cobol.snippets +0 -0
  655. data/vendor/assets/ace-1.1.8/snippets/coffee.js +7 -0
  656. data/vendor/assets/ace-1.1.8/snippets/coffee.snippets +95 -0
  657. data/vendor/assets/ace-1.1.8/snippets/coldfusion.js +7 -0
  658. data/vendor/assets/ace-1.1.8/snippets/coldfusion.snippets +0 -0
  659. data/vendor/assets/ace-1.1.8/snippets/cs.snippets +374 -0
  660. data/vendor/assets/ace-1.1.8/snippets/csharp.js +7 -0
  661. data/vendor/assets/ace-1.1.8/snippets/csharp.snippets +0 -0
  662. data/vendor/assets/ace-1.1.8/snippets/css.js +7 -0
  663. data/vendor/assets/ace-1.1.8/snippets/css.snippets +967 -0
  664. data/vendor/assets/ace-1.1.8/snippets/curly.js +7 -0
  665. data/vendor/assets/ace-1.1.8/snippets/curly.snippets +0 -0
  666. data/vendor/assets/ace-1.1.8/snippets/d.js +7 -0
  667. data/vendor/assets/ace-1.1.8/snippets/d.snippets +0 -0
  668. data/vendor/assets/ace-1.1.8/snippets/dart.js +7 -0
  669. data/vendor/assets/ace-1.1.8/snippets/dart.snippets +83 -0
  670. data/vendor/assets/ace-1.1.8/snippets/diff.js +7 -0
  671. data/vendor/assets/ace-1.1.8/snippets/diff.snippets +11 -0
  672. data/vendor/assets/ace-1.1.8/snippets/django.js +7 -0
  673. data/vendor/assets/ace-1.1.8/snippets/django.snippets +108 -0
  674. data/vendor/assets/ace-1.1.8/snippets/dockerfile.js +7 -0
  675. data/vendor/assets/ace-1.1.8/snippets/dockerfile.snippets +0 -0
  676. data/vendor/assets/ace-1.1.8/snippets/dot.js +7 -0
  677. data/vendor/assets/ace-1.1.8/snippets/dot.snippets +0 -0
  678. data/vendor/assets/ace-1.1.8/snippets/dummy.js +7 -0
  679. data/vendor/assets/ace-1.1.8/snippets/dummy_syntax.js +7 -0
  680. data/vendor/assets/ace-1.1.8/snippets/eiffel.js +7 -0
  681. data/vendor/assets/ace-1.1.8/snippets/eiffel.snippets +0 -0
  682. data/vendor/assets/ace-1.1.8/snippets/ejs.js +7 -0
  683. data/vendor/assets/ace-1.1.8/snippets/ejs.snippets +0 -0
  684. data/vendor/assets/ace-1.1.8/snippets/elixir.js +7 -0
  685. data/vendor/assets/ace-1.1.8/snippets/elixir.snippets +0 -0
  686. data/vendor/assets/ace-1.1.8/snippets/elm.js +7 -0
  687. data/vendor/assets/ace-1.1.8/snippets/elm.snippets +0 -0
  688. data/vendor/assets/ace-1.1.8/snippets/erlang.js +7 -0
  689. data/vendor/assets/ace-1.1.8/snippets/erlang.snippets +160 -0
  690. data/vendor/assets/ace-1.1.8/snippets/eruby.snippets +113 -0
  691. data/vendor/assets/ace-1.1.8/snippets/falcon.snippets +71 -0
  692. data/vendor/assets/ace-1.1.8/snippets/forth.js +7 -0
  693. data/vendor/assets/ace-1.1.8/snippets/forth.snippets +0 -0
  694. data/vendor/assets/ace-1.1.8/snippets/ftl.js +7 -0
  695. data/vendor/assets/ace-1.1.8/snippets/ftl.snippets +0 -0
  696. data/vendor/assets/ace-1.1.8/snippets/gcode.js +7 -0
  697. data/vendor/assets/ace-1.1.8/snippets/gcode.snippets +0 -0
  698. data/vendor/assets/ace-1.1.8/snippets/gherkin.js +7 -0
  699. data/vendor/assets/ace-1.1.8/snippets/gherkin.snippets +0 -0
  700. data/vendor/assets/ace-1.1.8/snippets/gitignore.js +7 -0
  701. data/vendor/assets/ace-1.1.8/snippets/gitignore.snippets +0 -0
  702. data/vendor/assets/ace-1.1.8/snippets/glsl.js +7 -0
  703. data/vendor/assets/ace-1.1.8/snippets/glsl.snippets +0 -0
  704. data/vendor/assets/ace-1.1.8/snippets/go.snippets +201 -0
  705. data/vendor/assets/ace-1.1.8/snippets/golang.js +7 -0
  706. data/vendor/assets/ace-1.1.8/snippets/golang.snippets +0 -0
  707. data/vendor/assets/ace-1.1.8/snippets/groovy.js +7 -0
  708. data/vendor/assets/ace-1.1.8/snippets/groovy.snippets +0 -0
  709. data/vendor/assets/ace-1.1.8/snippets/haml.js +7 -0
  710. data/vendor/assets/ace-1.1.8/snippets/haml.snippets +20 -0
  711. data/vendor/assets/ace-1.1.8/snippets/handlebars.js +7 -0
  712. data/vendor/assets/ace-1.1.8/snippets/handlebars.snippets +0 -0
  713. data/vendor/assets/ace-1.1.8/snippets/haskell.js +7 -0
  714. data/vendor/assets/ace-1.1.8/snippets/haskell.snippets +82 -0
  715. data/vendor/assets/ace-1.1.8/snippets/haxe.js +7 -0
  716. data/vendor/assets/ace-1.1.8/snippets/haxe.snippets +0 -0
  717. data/vendor/assets/ace-1.1.8/snippets/html.js +7 -0
  718. data/vendor/assets/ace-1.1.8/snippets/html.snippets +828 -0
  719. data/vendor/assets/ace-1.1.8/snippets/html_ruby.js +7 -0
  720. data/vendor/assets/ace-1.1.8/snippets/html_ruby.snippets +0 -0
  721. data/vendor/assets/ace-1.1.8/snippets/htmldjango.snippets +136 -0
  722. data/vendor/assets/ace-1.1.8/snippets/htmltornado.snippets +55 -0
  723. data/vendor/assets/ace-1.1.8/snippets/ini.js +7 -0
  724. data/vendor/assets/ace-1.1.8/snippets/ini.snippets +0 -0
  725. data/vendor/assets/ace-1.1.8/snippets/io.js +69 -0
  726. data/vendor/assets/ace-1.1.8/snippets/io.snippets +0 -0
  727. data/vendor/assets/ace-1.1.8/snippets/jack.js +7 -0
  728. data/vendor/assets/ace-1.1.8/snippets/jack.snippets +0 -0
  729. data/vendor/assets/ace-1.1.8/snippets/jade.js +7 -0
  730. data/vendor/assets/ace-1.1.8/snippets/jade.snippets +0 -0
  731. data/vendor/assets/ace-1.1.8/snippets/java.js +7 -0
  732. data/vendor/assets/ace-1.1.8/snippets/java.snippets +240 -0
  733. data/vendor/assets/ace-1.1.8/snippets/javascript-jquery.snippets +589 -0
  734. data/vendor/assets/ace-1.1.8/snippets/javascript.js +7 -0
  735. data/vendor/assets/ace-1.1.8/snippets/javascript.snippets +195 -0
  736. data/vendor/assets/ace-1.1.8/snippets/json.js +7 -0
  737. data/vendor/assets/ace-1.1.8/snippets/json.snippets +0 -0
  738. data/vendor/assets/ace-1.1.8/snippets/jsoniq.js +7 -0
  739. data/vendor/assets/ace-1.1.8/snippets/jsoniq.snippets +61 -0
  740. data/vendor/assets/ace-1.1.8/snippets/jsp.js +7 -0
  741. data/vendor/assets/ace-1.1.8/snippets/jsp.snippets +99 -0
  742. data/vendor/assets/ace-1.1.8/snippets/jsx.js +7 -0
  743. data/vendor/assets/ace-1.1.8/snippets/jsx.snippets +0 -0
  744. data/vendor/assets/ace-1.1.8/snippets/julia.js +7 -0
  745. data/vendor/assets/ace-1.1.8/snippets/julia.snippets +0 -0
  746. data/vendor/assets/ace-1.1.8/snippets/latex.js +7 -0
  747. data/vendor/assets/ace-1.1.8/snippets/latex.snippets +0 -0
  748. data/vendor/assets/ace-1.1.8/snippets/ledger.snippets +5 -0
  749. data/vendor/assets/ace-1.1.8/snippets/less.js +7 -0
  750. data/vendor/assets/ace-1.1.8/snippets/less.snippets +0 -0
  751. data/vendor/assets/ace-1.1.8/snippets/liquid.js +7 -0
  752. data/vendor/assets/ace-1.1.8/snippets/liquid.snippets +0 -0
  753. data/vendor/assets/ace-1.1.8/snippets/lisp.js +7 -0
  754. data/vendor/assets/ace-1.1.8/snippets/lisp.snippets +0 -0
  755. data/vendor/assets/ace-1.1.8/snippets/livescript.js +7 -0
  756. data/vendor/assets/ace-1.1.8/snippets/livescript.snippets +0 -0
  757. data/vendor/assets/ace-1.1.8/snippets/logiql.js +7 -0
  758. data/vendor/assets/ace-1.1.8/snippets/logiql.snippets +0 -0
  759. data/vendor/assets/ace-1.1.8/snippets/lsl.js +7 -0
  760. data/vendor/assets/ace-1.1.8/snippets/lsl.snippets +1066 -0
  761. data/vendor/assets/ace-1.1.8/snippets/lua.js +7 -0
  762. data/vendor/assets/ace-1.1.8/snippets/lua.snippets +21 -0
  763. data/vendor/assets/ace-1.1.8/snippets/luapage.js +7 -0
  764. data/vendor/assets/ace-1.1.8/snippets/luapage.snippets +0 -0
  765. data/vendor/assets/ace-1.1.8/snippets/lucene.js +7 -0
  766. data/vendor/assets/ace-1.1.8/snippets/lucene.snippets +0 -0
  767. data/vendor/assets/ace-1.1.8/snippets/makefile.js +7 -0
  768. data/vendor/assets/ace-1.1.8/snippets/makefile.snippets +4 -0
  769. data/vendor/assets/ace-1.1.8/snippets/mako.snippets +54 -0
  770. data/vendor/assets/ace-1.1.8/snippets/markdown.js +7 -0
  771. data/vendor/assets/ace-1.1.8/snippets/markdown.snippets +88 -0
  772. data/vendor/assets/ace-1.1.8/snippets/matlab.js +7 -0
  773. data/vendor/assets/ace-1.1.8/snippets/matlab.snippets +0 -0
  774. data/vendor/assets/ace-1.1.8/snippets/mel.js +7 -0
  775. data/vendor/assets/ace-1.1.8/snippets/mel.snippets +0 -0
  776. data/vendor/assets/ace-1.1.8/snippets/mushcode.js +7 -0
  777. data/vendor/assets/ace-1.1.8/snippets/mushcode.snippets +0 -0
  778. data/vendor/assets/ace-1.1.8/snippets/mushcode_high_rules.js +7 -0
  779. data/vendor/assets/ace-1.1.8/snippets/mushcode_high_rules.snippets +0 -0
  780. data/vendor/assets/ace-1.1.8/snippets/mysql.js +7 -0
  781. data/vendor/assets/ace-1.1.8/snippets/mysql.snippets +0 -0
  782. data/vendor/assets/ace-1.1.8/snippets/nix.js +7 -0
  783. data/vendor/assets/ace-1.1.8/snippets/nix.snippets +0 -0
  784. data/vendor/assets/ace-1.1.8/snippets/objc.snippets +247 -0
  785. data/vendor/assets/ace-1.1.8/snippets/objectivec.js +7 -0
  786. data/vendor/assets/ace-1.1.8/snippets/objectivec.snippets +0 -0
  787. data/vendor/assets/ace-1.1.8/snippets/ocaml.js +7 -0
  788. data/vendor/assets/ace-1.1.8/snippets/ocaml.snippets +0 -0
  789. data/vendor/assets/ace-1.1.8/snippets/pascal.js +7 -0
  790. data/vendor/assets/ace-1.1.8/snippets/pascal.snippets +0 -0
  791. data/vendor/assets/ace-1.1.8/snippets/perl.js +7 -0
  792. data/vendor/assets/ace-1.1.8/snippets/perl.snippets +347 -0
  793. data/vendor/assets/ace-1.1.8/snippets/pgsql.js +7 -0
  794. data/vendor/assets/ace-1.1.8/snippets/pgsql.snippets +0 -0
  795. data/vendor/assets/ace-1.1.8/snippets/php.js +7 -0
  796. data/vendor/assets/ace-1.1.8/snippets/php.snippets +377 -0
  797. data/vendor/assets/ace-1.1.8/snippets/plain_text.js +7 -0
  798. data/vendor/assets/ace-1.1.8/snippets/plain_text.snippets +0 -0
  799. data/vendor/assets/ace-1.1.8/snippets/powershell.js +7 -0
  800. data/vendor/assets/ace-1.1.8/snippets/powershell.snippets +0 -0
  801. data/vendor/assets/ace-1.1.8/snippets/praat.js +7 -0
  802. data/vendor/assets/ace-1.1.8/snippets/praat.snippets +0 -0
  803. data/vendor/assets/ace-1.1.8/snippets/prolog.js +7 -0
  804. data/vendor/assets/ace-1.1.8/snippets/prolog.snippets +0 -0
  805. data/vendor/assets/ace-1.1.8/snippets/properties.js +7 -0
  806. data/vendor/assets/ace-1.1.8/snippets/properties.snippets +0 -0
  807. data/vendor/assets/ace-1.1.8/snippets/protobuf.js +7 -0
  808. data/vendor/assets/ace-1.1.8/snippets/protobuf.snippets +0 -0
  809. data/vendor/assets/ace-1.1.8/snippets/python.js +7 -0
  810. data/vendor/assets/ace-1.1.8/snippets/python.snippets +158 -0
  811. data/vendor/assets/ace-1.1.8/snippets/r.js +7 -0
  812. data/vendor/assets/ace-1.1.8/snippets/r.snippets +121 -0
  813. data/vendor/assets/ace-1.1.8/snippets/rdoc.js +7 -0
  814. data/vendor/assets/ace-1.1.8/snippets/rdoc.snippets +0 -0
  815. data/vendor/assets/ace-1.1.8/snippets/rhtml.js +7 -0
  816. data/vendor/assets/ace-1.1.8/snippets/rhtml.snippets +0 -0
  817. data/vendor/assets/ace-1.1.8/snippets/rst.snippets +22 -0
  818. data/vendor/assets/ace-1.1.8/snippets/ruby.js +7 -0
  819. data/vendor/assets/ace-1.1.8/snippets/ruby.snippets +928 -0
  820. data/vendor/assets/ace-1.1.8/snippets/rust.js +7 -0
  821. data/vendor/assets/ace-1.1.8/snippets/rust.snippets +0 -0
  822. data/vendor/assets/ace-1.1.8/snippets/sass.js +7 -0
  823. data/vendor/assets/ace-1.1.8/snippets/sass.snippets +0 -0
  824. data/vendor/assets/ace-1.1.8/snippets/scad.js +7 -0
  825. data/vendor/assets/ace-1.1.8/snippets/scad.snippets +0 -0
  826. data/vendor/assets/ace-1.1.8/snippets/scala.js +7 -0
  827. data/vendor/assets/ace-1.1.8/snippets/scala.snippets +0 -0
  828. data/vendor/assets/ace-1.1.8/snippets/scheme.js +7 -0
  829. data/vendor/assets/ace-1.1.8/snippets/scheme.snippets +0 -0
  830. data/vendor/assets/ace-1.1.8/snippets/scss.js +7 -0
  831. data/vendor/assets/ace-1.1.8/snippets/scss.snippets +0 -0
  832. data/vendor/assets/ace-1.1.8/snippets/sh.js +7 -0
  833. data/vendor/assets/ace-1.1.8/snippets/sh.snippets +83 -0
  834. data/vendor/assets/ace-1.1.8/snippets/sjs.js +7 -0
  835. data/vendor/assets/ace-1.1.8/snippets/sjs.snippets +0 -0
  836. data/vendor/assets/ace-1.1.8/snippets/smarty.js +7 -0
  837. data/vendor/assets/ace-1.1.8/snippets/smarty.snippets +0 -0
  838. data/vendor/assets/ace-1.1.8/snippets/snippets.js +7 -0
  839. data/vendor/assets/ace-1.1.8/snippets/snippets.snippets +9 -0
  840. data/vendor/assets/ace-1.1.8/snippets/soy_template.js +7 -0
  841. data/vendor/assets/ace-1.1.8/snippets/soy_template.snippets +0 -0
  842. data/vendor/assets/ace-1.1.8/snippets/space.js +7 -0
  843. data/vendor/assets/ace-1.1.8/snippets/space.snippets +0 -0
  844. data/vendor/assets/ace-1.1.8/snippets/sql.js +7 -0
  845. data/vendor/assets/ace-1.1.8/snippets/sql.snippets +26 -0
  846. data/vendor/assets/ace-1.1.8/snippets/stylus.js +7 -0
  847. data/vendor/assets/ace-1.1.8/snippets/stylus.snippets +0 -0
  848. data/vendor/assets/ace-1.1.8/snippets/svg.js +7 -0
  849. data/vendor/assets/ace-1.1.8/snippets/svg.snippets +0 -0
  850. data/vendor/assets/ace-1.1.8/snippets/tcl.js +7 -0
  851. data/vendor/assets/ace-1.1.8/snippets/tcl.snippets +92 -0
  852. data/vendor/assets/ace-1.1.8/snippets/tex.js +7 -0
  853. data/vendor/assets/ace-1.1.8/snippets/tex.snippets +191 -0
  854. data/vendor/assets/ace-1.1.8/snippets/text.js +7 -0
  855. data/vendor/assets/ace-1.1.8/snippets/text.snippets +0 -0
  856. data/vendor/assets/ace-1.1.8/snippets/textile.js +7 -0
  857. data/vendor/assets/ace-1.1.8/snippets/textile.snippets +30 -0
  858. data/vendor/assets/ace-1.1.8/snippets/tmsnippet.snippets +0 -0
  859. data/vendor/assets/ace-1.1.8/snippets/toml.js +7 -0
  860. data/vendor/assets/ace-1.1.8/snippets/toml.snippets +0 -0
  861. data/vendor/assets/ace-1.1.8/snippets/twig.js +7 -0
  862. data/vendor/assets/ace-1.1.8/snippets/twig.snippets +0 -0
  863. data/vendor/assets/ace-1.1.8/snippets/typescript.js +7 -0
  864. data/vendor/assets/ace-1.1.8/snippets/typescript.snippets +0 -0
  865. data/vendor/assets/ace-1.1.8/snippets/vala.js +195 -0
  866. data/vendor/assets/ace-1.1.8/snippets/vala.snippets +0 -0
  867. data/vendor/assets/ace-1.1.8/snippets/vbscript.js +7 -0
  868. data/vendor/assets/ace-1.1.8/snippets/vbscript.snippets +0 -0
  869. data/vendor/assets/ace-1.1.8/snippets/velocity.js +8 -0
  870. data/vendor/assets/ace-1.1.8/snippets/velocity.snippets +28 -0
  871. data/vendor/assets/ace-1.1.8/snippets/verilog.js +7 -0
  872. data/vendor/assets/ace-1.1.8/snippets/verilog.snippets +0 -0
  873. data/vendor/assets/ace-1.1.8/snippets/vhdl.js +7 -0
  874. data/vendor/assets/ace-1.1.8/snippets/vhdl.snippets +0 -0
  875. data/vendor/assets/ace-1.1.8/snippets/xml.js +7 -0
  876. data/vendor/assets/ace-1.1.8/snippets/xml.snippets +0 -0
  877. data/vendor/assets/ace-1.1.8/snippets/xquery.js +7 -0
  878. data/vendor/assets/ace-1.1.8/snippets/xquery.snippets +61 -0
  879. data/vendor/assets/ace-1.1.8/snippets/xslt.snippets +97 -0
  880. data/vendor/assets/ace-1.1.8/snippets/yaml.js +7 -0
  881. data/vendor/assets/ace-1.1.8/snippets/yaml.snippets +0 -0
  882. data/vendor/assets/ace-1.1.8/snippets_test.js +131 -0
  883. data/vendor/assets/ace-1.1.8/split.js +373 -0
  884. data/vendor/assets/ace-1.1.8/test/all.js +35 -0
  885. data/vendor/assets/ace-1.1.8/test/all_browser.js +141 -0
  886. data/vendor/assets/ace-1.1.8/test/assertions.js +56 -0
  887. data/vendor/assets/ace-1.1.8/test/asyncjs/assert.js +313 -0
  888. data/vendor/assets/ace-1.1.8/test/asyncjs/async.js +529 -0
  889. data/vendor/assets/ace-1.1.8/test/asyncjs/index.js +13 -0
  890. data/vendor/assets/ace-1.1.8/test/asyncjs/test.js +195 -0
  891. data/vendor/assets/ace-1.1.8/test/asyncjs/utils.js +65 -0
  892. data/vendor/assets/ace-1.1.8/test/benchmark.js +78 -0
  893. data/vendor/assets/ace-1.1.8/test/mockdom.js +10 -0
  894. data/vendor/assets/ace-1.1.8/test/mockrenderer.js +208 -0
  895. data/vendor/assets/ace-1.1.8/test/tests.html +46 -0
  896. data/vendor/assets/ace-1.1.8/theme/ambiance.css +221 -0
  897. data/vendor/assets/ace-1.1.8/theme/ambiance.js +33 -0
  898. data/vendor/assets/ace-1.1.8/theme/chaos.css +154 -0
  899. data/vendor/assets/ace-1.1.8/theme/chaos.js +33 -0
  900. data/vendor/assets/ace-1.1.8/theme/chrome.css +154 -0
  901. data/vendor/assets/ace-1.1.8/theme/chrome.js +39 -0
  902. data/vendor/assets/ace-1.1.8/theme/clouds.css +112 -0
  903. data/vendor/assets/ace-1.1.8/theme/clouds.js +39 -0
  904. data/vendor/assets/ace-1.1.8/theme/clouds_midnight.css +113 -0
  905. data/vendor/assets/ace-1.1.8/theme/clouds_midnight.js +39 -0
  906. data/vendor/assets/ace-1.1.8/theme/cobalt.css +134 -0
  907. data/vendor/assets/ace-1.1.8/theme/cobalt.js +39 -0
  908. data/vendor/assets/ace-1.1.8/theme/crimson_editor.css +143 -0
  909. data/vendor/assets/ace-1.1.8/theme/crimson_editor.js +39 -0
  910. data/vendor/assets/ace-1.1.8/theme/dawn.css +127 -0
  911. data/vendor/assets/ace-1.1.8/theme/dawn.js +39 -0
  912. data/vendor/assets/ace-1.1.8/theme/dreamweaver.css +176 -0
  913. data/vendor/assets/ace-1.1.8/theme/dreamweaver.js +38 -0
  914. data/vendor/assets/ace-1.1.8/theme/eclipse.css +113 -0
  915. data/vendor/assets/ace-1.1.8/theme/eclipse.js +41 -0
  916. data/vendor/assets/ace-1.1.8/theme/github.css +119 -0
  917. data/vendor/assets/ace-1.1.8/theme/github.js +39 -0
  918. data/vendor/assets/ace-1.1.8/theme/idle_fingers.css +113 -0
  919. data/vendor/assets/ace-1.1.8/theme/idle_fingers.js +39 -0
  920. data/vendor/assets/ace-1.1.8/theme/katzenmilch.css +140 -0
  921. data/vendor/assets/ace-1.1.8/theme/katzenmilch.js +39 -0
  922. data/vendor/assets/ace-1.1.8/theme/kr_theme.css +124 -0
  923. data/vendor/assets/ace-1.1.8/theme/kr_theme.js +39 -0
  924. data/vendor/assets/ace-1.1.8/theme/kuroir.css +67 -0
  925. data/vendor/assets/ace-1.1.8/theme/kuroir.js +39 -0
  926. data/vendor/assets/ace-1.1.8/theme/merbivore.css +110 -0
  927. data/vendor/assets/ace-1.1.8/theme/merbivore.js +39 -0
  928. data/vendor/assets/ace-1.1.8/theme/merbivore_soft.css +111 -0
  929. data/vendor/assets/ace-1.1.8/theme/merbivore_soft.js +39 -0
  930. data/vendor/assets/ace-1.1.8/theme/mono_industrial.css +126 -0
  931. data/vendor/assets/ace-1.1.8/theme/mono_industrial.js +39 -0
  932. data/vendor/assets/ace-1.1.8/theme/monokai.css +122 -0
  933. data/vendor/assets/ace-1.1.8/theme/monokai.js +39 -0
  934. data/vendor/assets/ace-1.1.8/theme/pastel_on_dark.css +129 -0
  935. data/vendor/assets/ace-1.1.8/theme/pastel_on_dark.js +39 -0
  936. data/vendor/assets/ace-1.1.8/theme/solarized_dark.css +101 -0
  937. data/vendor/assets/ace-1.1.8/theme/solarized_dark.js +39 -0
  938. data/vendor/assets/ace-1.1.8/theme/solarized_light.css +106 -0
  939. data/vendor/assets/ace-1.1.8/theme/solarized_light.js +39 -0
  940. data/vendor/assets/ace-1.1.8/theme/terminal.css +132 -0
  941. data/vendor/assets/ace-1.1.8/theme/terminal.js +39 -0
  942. data/vendor/assets/ace-1.1.8/theme/textmate.css +155 -0
  943. data/vendor/assets/ace-1.1.8/theme/textmate.js +40 -0
  944. data/vendor/assets/ace-1.1.8/theme/tomorrow.css +125 -0
  945. data/vendor/assets/ace-1.1.8/theme/tomorrow.js +39 -0
  946. data/vendor/assets/ace-1.1.8/theme/tomorrow_night.css +125 -0
  947. data/vendor/assets/ace-1.1.8/theme/tomorrow_night.js +39 -0
  948. data/vendor/assets/ace-1.1.8/theme/tomorrow_night_blue.css +122 -0
  949. data/vendor/assets/ace-1.1.8/theme/tomorrow_night_blue.js +39 -0
  950. data/vendor/assets/ace-1.1.8/theme/tomorrow_night_bright.css +141 -0
  951. data/vendor/assets/ace-1.1.8/theme/tomorrow_night_bright.js +39 -0
  952. data/vendor/assets/ace-1.1.8/theme/tomorrow_night_eighties.css +125 -0
  953. data/vendor/assets/ace-1.1.8/theme/tomorrow_night_eighties.js +39 -0
  954. data/vendor/assets/ace-1.1.8/theme/twilight.css +128 -0
  955. data/vendor/assets/ace-1.1.8/theme/twilight.js +39 -0
  956. data/vendor/assets/ace-1.1.8/theme/vibrant_ink.css +110 -0
  957. data/vendor/assets/ace-1.1.8/theme/vibrant_ink.js +39 -0
  958. data/vendor/assets/ace-1.1.8/theme/xcode.css +103 -0
  959. data/vendor/assets/ace-1.1.8/theme/xcode.js +39 -0
  960. data/vendor/assets/ace-1.1.8/token_iterator.js +150 -0
  961. data/vendor/assets/ace-1.1.8/token_iterator_test.js +212 -0
  962. data/vendor/assets/ace-1.1.8/tokenizer.js +366 -0
  963. data/vendor/assets/ace-1.1.8/tokenizer_dev.js +183 -0
  964. data/vendor/assets/ace-1.1.8/tokenizer_test.js +97 -0
  965. data/vendor/assets/ace-1.1.8/tooltip.js +138 -0
  966. data/vendor/assets/ace-1.1.8/undomanager.js +168 -0
  967. data/vendor/assets/ace-1.1.8/unicode.js +107 -0
  968. data/vendor/assets/ace-1.1.8/virtual_renderer.js +1759 -0
  969. data/vendor/assets/ace-1.1.8/virtual_renderer_test.js +86 -0
  970. data/vendor/assets/ace-1.1.8/worker/mirror.js +49 -0
  971. data/vendor/assets/ace-1.1.8/worker/worker.js +193 -0
  972. data/vendor/assets/ace-1.1.8/worker/worker_client.js +255 -0
  973. data/vendor/assets/ace-1.1.8/worker/worker_test.js +125 -0
  974. data/vendor/assets/ckeditor-4.4.7/CHANGES.md +720 -0
  975. data/vendor/assets/ckeditor-4.4.7/LICENSE.md +1264 -0
  976. data/vendor/assets/ckeditor-4.4.7/README.md +39 -0
  977. data/vendor/assets/ckeditor-4.4.7/adapters/jquery.js +10 -0
  978. data/vendor/assets/ckeditor-4.4.7/build-config.js +83 -0
  979. data/vendor/assets/ckeditor-4.4.7/ckeditor.js +829 -0
  980. data/vendor/assets/ckeditor-4.4.7/config.js +34 -0
  981. data/vendor/assets/ckeditor-4.4.7/contents.css +134 -0
  982. data/vendor/assets/ckeditor-4.4.7/lang/en.js +5 -0
  983. data/vendor/assets/ckeditor-4.4.7/plugins/clipboard/dialogs/paste.js +11 -0
  984. data/vendor/assets/ckeditor-4.4.7/plugins/dialog/dialogDefinition.js +4 -0
  985. data/vendor/assets/ckeditor-4.4.7/plugins/icons.png +0 -0
  986. data/vendor/assets/ckeditor-4.4.7/plugins/icons_hidpi.png +0 -0
  987. data/vendor/assets/ckeditor-4.4.7/plugins/image/dialogs/image.js +43 -0
  988. data/vendor/assets/ckeditor-4.4.7/plugins/image/images/noimage.png +0 -0
  989. data/vendor/assets/ckeditor-4.4.7/plugins/link/dialogs/anchor.js +7 -0
  990. data/vendor/assets/ckeditor-4.4.7/plugins/link/dialogs/link.js +26 -0
  991. data/vendor/assets/ckeditor-4.4.7/plugins/link/images/anchor.png +0 -0
  992. data/vendor/assets/ckeditor-4.4.7/plugins/link/images/hidpi/anchor.png +0 -0
  993. data/vendor/assets/ckeditor-4.4.7/plugins/magicline/images/hidpi/icon-rtl.png +0 -0
  994. data/vendor/assets/ckeditor-4.4.7/plugins/magicline/images/hidpi/icon.png +0 -0
  995. data/vendor/assets/ckeditor-4.4.7/plugins/magicline/images/icon-rtl.png +0 -0
  996. data/vendor/assets/ckeditor-4.4.7/plugins/magicline/images/icon.png +0 -0
  997. data/vendor/assets/ckeditor-4.4.7/plugins/pastefromword/filter/default.js +31 -0
  998. data/vendor/assets/ckeditor-4.4.7/plugins/showblocks/images/block_address.png +0 -0
  999. data/vendor/assets/ckeditor-4.4.7/plugins/showblocks/images/block_blockquote.png +0 -0
  1000. data/vendor/assets/ckeditor-4.4.7/plugins/showblocks/images/block_div.png +0 -0
  1001. data/vendor/assets/ckeditor-4.4.7/plugins/showblocks/images/block_h1.png +0 -0
  1002. data/vendor/assets/ckeditor-4.4.7/plugins/showblocks/images/block_h2.png +0 -0
  1003. data/vendor/assets/ckeditor-4.4.7/plugins/showblocks/images/block_h3.png +0 -0
  1004. data/vendor/assets/ckeditor-4.4.7/plugins/showblocks/images/block_h4.png +0 -0
  1005. data/vendor/assets/ckeditor-4.4.7/plugins/showblocks/images/block_h5.png +0 -0
  1006. data/vendor/assets/ckeditor-4.4.7/plugins/showblocks/images/block_h6.png +0 -0
  1007. data/vendor/assets/ckeditor-4.4.7/plugins/showblocks/images/block_p.png +0 -0
  1008. data/vendor/assets/ckeditor-4.4.7/plugins/showblocks/images/block_pre.png +0 -0
  1009. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/_translationstatus.txt +20 -0
  1010. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/af.js +13 -0
  1011. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/ar.js +13 -0
  1012. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/bg.js +13 -0
  1013. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/ca.js +14 -0
  1014. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/cs.js +13 -0
  1015. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/cy.js +14 -0
  1016. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/da.js +13 -0
  1017. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/de.js +13 -0
  1018. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/el.js +13 -0
  1019. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/en-gb.js +13 -0
  1020. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/en.js +13 -0
  1021. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/eo.js +12 -0
  1022. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/es.js +13 -0
  1023. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/et.js +13 -0
  1024. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/fa.js +12 -0
  1025. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/fi.js +13 -0
  1026. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/fr-ca.js +10 -0
  1027. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/fr.js +11 -0
  1028. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/gl.js +13 -0
  1029. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/he.js +12 -0
  1030. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/hr.js +13 -0
  1031. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/hu.js +12 -0
  1032. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/id.js +13 -0
  1033. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/it.js +14 -0
  1034. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/ja.js +9 -0
  1035. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/km.js +13 -0
  1036. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/ku.js +13 -0
  1037. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/lt.js +13 -0
  1038. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/lv.js +13 -0
  1039. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/nb.js +11 -0
  1040. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/nl.js +13 -0
  1041. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/no.js +11 -0
  1042. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/pl.js +12 -0
  1043. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/pt-br.js +11 -0
  1044. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/pt.js +13 -0
  1045. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/ru.js +13 -0
  1046. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/si.js +13 -0
  1047. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/sk.js +13 -0
  1048. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/sl.js +12 -0
  1049. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/sq.js +13 -0
  1050. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/sv.js +11 -0
  1051. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/th.js +13 -0
  1052. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/tr.js +12 -0
  1053. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/tt.js +13 -0
  1054. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/ug.js +13 -0
  1055. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/uk.js +12 -0
  1056. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/vi.js +14 -0
  1057. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/zh-cn.js +9 -0
  1058. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/lang/zh.js +12 -0
  1059. data/vendor/assets/ckeditor-4.4.7/plugins/specialchar/dialogs/specialchar.js +14 -0
  1060. data/vendor/assets/ckeditor-4.4.7/plugins/table/dialogs/table.js +21 -0
  1061. data/vendor/assets/ckeditor-4.4.7/plugins/templates/dialogs/templates.css +84 -0
  1062. data/vendor/assets/ckeditor-4.4.7/plugins/templates/dialogs/templates.js +10 -0
  1063. data/vendor/assets/ckeditor-4.4.7/plugins/templates/templates/default.js +6 -0
  1064. data/vendor/assets/ckeditor-4.4.7/plugins/templates/templates/images/template1.gif +0 -0
  1065. data/vendor/assets/ckeditor-4.4.7/plugins/templates/templates/images/template2.gif +0 -0
  1066. data/vendor/assets/ckeditor-4.4.7/plugins/templates/templates/images/template3.gif +0 -0
  1067. data/vendor/assets/ckeditor-4.4.7/plugins/uploadcare/README.md +64 -0
  1068. data/vendor/assets/ckeditor-4.4.7/plugins/uploadcare/icons/hidpi/uploadcare.png +0 -0
  1069. data/vendor/assets/ckeditor-4.4.7/plugins/uploadcare/icons/uploadcare.png +0 -0
  1070. data/vendor/assets/ckeditor-4.4.7/samples/ajax.html +82 -0
  1071. data/vendor/assets/ckeditor-4.4.7/samples/api.html +207 -0
  1072. data/vendor/assets/ckeditor-4.4.7/samples/appendto.html +56 -0
  1073. data/vendor/assets/ckeditor-4.4.7/samples/assets/inlineall/logo.png +0 -0
  1074. data/vendor/assets/ckeditor-4.4.7/samples/assets/outputxhtml/outputxhtml.css +204 -0
  1075. data/vendor/assets/ckeditor-4.4.7/samples/assets/posteddata.php +59 -0
  1076. data/vendor/assets/ckeditor-4.4.7/samples/assets/sample.jpg +0 -0
  1077. data/vendor/assets/ckeditor-4.4.7/samples/assets/uilanguages/languages.js +7 -0
  1078. data/vendor/assets/ckeditor-4.4.7/samples/datafiltering.html +401 -0
  1079. data/vendor/assets/ckeditor-4.4.7/samples/divreplace.html +141 -0
  1080. data/vendor/assets/ckeditor-4.4.7/samples/index.html +119 -0
  1081. data/vendor/assets/ckeditor-4.4.7/samples/inlineall.html +311 -0
  1082. data/vendor/assets/ckeditor-4.4.7/samples/inlinebycode.html +121 -0
  1083. data/vendor/assets/ckeditor-4.4.7/samples/inlinetextarea.html +110 -0
  1084. data/vendor/assets/ckeditor-4.4.7/samples/jquery.html +100 -0
  1085. data/vendor/assets/ckeditor-4.4.7/samples/plugins/dialog/assets/my_dialog.js +48 -0
  1086. data/vendor/assets/ckeditor-4.4.7/samples/plugins/dialog/dialog.html +187 -0
  1087. data/vendor/assets/ckeditor-4.4.7/samples/plugins/enterkey/enterkey.html +103 -0
  1088. data/vendor/assets/ckeditor-4.4.7/samples/plugins/magicline/magicline.html +206 -0
  1089. data/vendor/assets/ckeditor-4.4.7/samples/plugins/toolbar/toolbar.html +232 -0
  1090. data/vendor/assets/ckeditor-4.4.7/samples/readonly.html +73 -0
  1091. data/vendor/assets/ckeditor-4.4.7/samples/replacebyclass.html +57 -0
  1092. data/vendor/assets/ckeditor-4.4.7/samples/replacebycode.html +56 -0
  1093. data/vendor/assets/ckeditor-4.4.7/samples/sample.css +365 -0
  1094. data/vendor/assets/ckeditor-4.4.7/samples/sample.js +50 -0
  1095. data/vendor/assets/ckeditor-4.4.7/samples/sample_posteddata.php +16 -0
  1096. data/vendor/assets/ckeditor-4.4.7/samples/tabindex.html +75 -0
  1097. data/vendor/assets/ckeditor-4.4.7/samples/uicolor.html +69 -0
  1098. data/vendor/assets/ckeditor-4.4.7/samples/uilanguages.html +119 -0
  1099. data/vendor/assets/ckeditor-4.4.7/samples/xhtmlstyle.html +231 -0
  1100. data/vendor/assets/ckeditor-4.4.7/skins/flat/dialog.css +5 -0
  1101. data/vendor/assets/ckeditor-4.4.7/skins/flat/dialog_ie.css +5 -0
  1102. data/vendor/assets/ckeditor-4.4.7/skins/flat/dialog_ie7.css +5 -0
  1103. data/vendor/assets/ckeditor-4.4.7/skins/flat/dialog_ie8.css +5 -0
  1104. data/vendor/assets/ckeditor-4.4.7/skins/flat/dialog_iequirks.css +5 -0
  1105. data/vendor/assets/ckeditor-4.4.7/skins/flat/editor.css +5 -0
  1106. data/vendor/assets/ckeditor-4.4.7/skins/flat/editor_gecko.css +5 -0
  1107. data/vendor/assets/ckeditor-4.4.7/skins/flat/editor_ie.css +5 -0
  1108. data/vendor/assets/ckeditor-4.4.7/skins/flat/editor_ie7.css +5 -0
  1109. data/vendor/assets/ckeditor-4.4.7/skins/flat/editor_ie8.css +5 -0
  1110. data/vendor/assets/ckeditor-4.4.7/skins/flat/editor_iequirks.css +5 -0
  1111. data/vendor/assets/ckeditor-4.4.7/skins/flat/icons.png +0 -0
  1112. data/vendor/assets/ckeditor-4.4.7/skins/flat/icons_hidpi.png +0 -0
  1113. data/vendor/assets/ckeditor-4.4.7/skins/flat/images/arrow.png +0 -0
  1114. data/vendor/assets/ckeditor-4.4.7/skins/flat/images/close.png +0 -0
  1115. data/vendor/assets/ckeditor-4.4.7/skins/flat/images/hidpi/close.png +0 -0
  1116. data/vendor/assets/ckeditor-4.4.7/skins/flat/images/hidpi/lock-open.png +0 -0
  1117. data/vendor/assets/ckeditor-4.4.7/skins/flat/images/hidpi/lock.png +0 -0
  1118. data/vendor/assets/ckeditor-4.4.7/skins/flat/images/hidpi/refresh.png +0 -0
  1119. data/vendor/assets/ckeditor-4.4.7/skins/flat/images/lock-open.png +0 -0
  1120. data/vendor/assets/ckeditor-4.4.7/skins/flat/images/lock.png +0 -0
  1121. data/vendor/assets/ckeditor-4.4.7/skins/flat/images/refresh.png +0 -0
  1122. data/vendor/assets/ckeditor-4.4.7/skins/flat/readme.md +8 -0
  1123. data/vendor/assets/ckeditor-4.4.7/styles.js +111 -0
  1124. data/vendor/assets/javascripts/backbone.js +1608 -0
  1125. data/vendor/assets/javascripts/backbone.memento.js +159 -0
  1126. data/vendor/assets/javascripts/jquery-ui.js +14987 -0
  1127. data/vendor/assets/javascripts/jquery.js +10346 -0
  1128. data/vendor/assets/javascripts/jquery.noty.js +1436 -0
  1129. data/vendor/assets/javascripts/require.js +36 -0
  1130. data/vendor/assets/javascripts/text.js +391 -0
  1131. data/vendor/assets/javascripts/underscore.js +1536 -0
  1132. metadata +1287 -0
@@ -0,0 +1,2658 @@
1
+ /* ***** BEGIN LICENSE BLOCK *****
2
+ * Distributed under the BSD license:
3
+ *
4
+ * Copyright (c) 2010, Ajax.org B.V.
5
+ * All rights reserved.
6
+ *
7
+ * Redistribution and use in source and binary forms, with or without
8
+ * modification, are permitted provided that the following conditions are met:
9
+ * * Redistributions of source code must retain the above copyright
10
+ * notice, this list of conditions and the following disclaimer.
11
+ * * Redistributions in binary form must reproduce the above copyright
12
+ * notice, this list of conditions and the following disclaimer in the
13
+ * documentation and/or other materials provided with the distribution.
14
+ * * Neither the name of Ajax.org B.V. nor the
15
+ * names of its contributors may be used to endorse or promote products
16
+ * derived from this software without specific prior written permission.
17
+ *
18
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
22
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
+ *
29
+ * ***** END LICENSE BLOCK ***** */
30
+
31
+ define(function(require, exports, module) {
32
+ "use strict";
33
+
34
+ require("./lib/fixoldbrowsers");
35
+
36
+ var oop = require("./lib/oop");
37
+ var dom = require("./lib/dom");
38
+ var lang = require("./lib/lang");
39
+ var useragent = require("./lib/useragent");
40
+ var TextInput = require("./keyboard/textinput").TextInput;
41
+ var MouseHandler = require("./mouse/mouse_handler").MouseHandler;
42
+ var FoldHandler = require("./mouse/fold_handler").FoldHandler;
43
+ var KeyBinding = require("./keyboard/keybinding").KeyBinding;
44
+ var EditSession = require("./edit_session").EditSession;
45
+ var Search = require("./search").Search;
46
+ var Range = require("./range").Range;
47
+ var EventEmitter = require("./lib/event_emitter").EventEmitter;
48
+ var CommandManager = require("./commands/command_manager").CommandManager;
49
+ var defaultCommands = require("./commands/default_commands").commands;
50
+ var config = require("./config");
51
+ var TokenIterator = require("./token_iterator").TokenIterator;
52
+
53
+ /**
54
+ * The main entry point into the Ace functionality.
55
+ *
56
+ * The `Editor` manages the [[EditSession]] (which manages [[Document]]s), as well as the [[VirtualRenderer]], which draws everything to the screen.
57
+ *
58
+ * Event sessions dealing with the mouse and keyboard are bubbled up from `Document` to the `Editor`, which decides what to do with them.
59
+ * @class Editor
60
+ **/
61
+
62
+ /**
63
+ * Creates a new `Editor` object.
64
+ *
65
+ * @param {VirtualRenderer} renderer Associated `VirtualRenderer` that draws everything
66
+ * @param {EditSession} session The `EditSession` to refer to
67
+ *
68
+ *
69
+ * @constructor
70
+ **/
71
+ var Editor = function(renderer, session) {
72
+ var container = renderer.getContainerElement();
73
+ this.container = container;
74
+ this.renderer = renderer;
75
+
76
+ this.commands = new CommandManager(useragent.isMac ? "mac" : "win", defaultCommands);
77
+ this.textInput = new TextInput(renderer.getTextAreaContainer(), this);
78
+ this.renderer.textarea = this.textInput.getElement();
79
+ this.keyBinding = new KeyBinding(this);
80
+
81
+ // TODO detect touch event support
82
+ this.$mouseHandler = new MouseHandler(this);
83
+ new FoldHandler(this);
84
+
85
+ this.$blockScrolling = 0;
86
+ this.$search = new Search().set({
87
+ wrap: true
88
+ });
89
+
90
+ this.$historyTracker = this.$historyTracker.bind(this);
91
+ this.commands.on("exec", this.$historyTracker);
92
+
93
+ this.$initOperationListeners();
94
+
95
+ this._$emitInputEvent = lang.delayedCall(function() {
96
+ this._signal("input", {});
97
+ if (this.session && this.session.bgTokenizer)
98
+ this.session.bgTokenizer.scheduleStart();
99
+ }.bind(this));
100
+
101
+ this.on("change", function(_, _self) {
102
+ _self._$emitInputEvent.schedule(31);
103
+ });
104
+
105
+ this.setSession(session || new EditSession(""));
106
+ config.resetOptions(this);
107
+ config._signal("editor", this);
108
+ };
109
+
110
+ (function(){
111
+
112
+ oop.implement(this, EventEmitter);
113
+
114
+ this.$initOperationListeners = function() {
115
+ function last(a) {return a[a.length - 1]}
116
+
117
+ this.selections = [];
118
+ this.commands.on("exec", this.startOperation.bind(this), true);
119
+ this.commands.on("afterExec", this.endOperation.bind(this), true);
120
+
121
+ this.$opResetTimer = lang.delayedCall(this.endOperation.bind(this));
122
+
123
+ this.on("change", function() {
124
+ this.curOp || this.startOperation();
125
+ this.curOp.docChanged = true;
126
+ }.bind(this), true);
127
+
128
+ this.on("changeSelection", function() {
129
+ this.curOp || this.startOperation();
130
+ this.curOp.selectionChanged = true;
131
+ }.bind(this), true);
132
+ };
133
+
134
+ this.curOp = null;
135
+ this.prevOp = {};
136
+ this.startOperation = function(commadEvent) {
137
+ if (this.curOp) {
138
+ if (!commadEvent || this.curOp.command)
139
+ return;
140
+ this.prevOp = this.curOp;
141
+ }
142
+ if (!commadEvent) {
143
+ this.previousCommand = null;
144
+ commadEvent = {};
145
+ }
146
+
147
+ this.$opResetTimer.schedule();
148
+ this.curOp = {
149
+ command: commadEvent.command || {},
150
+ args: commadEvent.args,
151
+ scrollTop: this.renderer.scrollTop
152
+ };
153
+
154
+ // this.selections.push(this.selection.toJSON());
155
+ };
156
+
157
+ this.endOperation = function(e) {
158
+ if (this.curOp) {
159
+ if (e && e.returnValue === false)
160
+ return this.curOp = null;
161
+
162
+ var command = this.curOp.command;
163
+ if (command && command.scrollIntoView) {
164
+ switch (command.scrollIntoView) {
165
+ case "center":
166
+ this.renderer.scrollCursorIntoView(null, 0.5);
167
+ break;
168
+ case "animate":
169
+ case "cursor":
170
+ this.renderer.scrollCursorIntoView();
171
+ break;
172
+ case "selectionPart":
173
+ var range = this.selection.getRange();
174
+ var config = this.renderer.layerConfig;
175
+ if (range.start.row >= config.lastRow || range.end.row <= config.firstRow) {
176
+ this.renderer.scrollSelectionIntoView(this.selection.anchor, this.selection.lead);
177
+ }
178
+ break;
179
+ default:
180
+ break;
181
+ }
182
+ if (command.scrollIntoView == "animate")
183
+ this.renderer.animateScrolling(this.curOp.scrollTop);
184
+ }
185
+
186
+ this.prevOp = this.curOp;
187
+ this.curOp = null;
188
+ }
189
+ };
190
+
191
+ // TODO use property on commands instead of this
192
+ this.$mergeableCommands = ["backspace", "del", "insertstring"];
193
+ this.$historyTracker = function(e) {
194
+ if (!this.$mergeUndoDeltas)
195
+ return;
196
+
197
+ var prev = this.prevOp;
198
+ var mergeableCommands = this.$mergeableCommands;
199
+ // previous command was the same
200
+ var shouldMerge = prev.command && (e.command.name == prev.command.name);
201
+ if (e.command.name == "insertstring") {
202
+ var text = e.args;
203
+ if (this.mergeNextCommand === undefined)
204
+ this.mergeNextCommand = true;
205
+
206
+ shouldMerge = shouldMerge
207
+ && this.mergeNextCommand // previous command allows to coalesce with
208
+ && (!/\s/.test(text) || /\s/.test(prev.args)); // previous insertion was of same type
209
+
210
+ this.mergeNextCommand = true;
211
+ } else {
212
+ shouldMerge = shouldMerge
213
+ && mergeableCommands.indexOf(e.command.name) !== -1; // the command is mergeable
214
+ }
215
+
216
+ if (
217
+ this.$mergeUndoDeltas != "always"
218
+ && Date.now() - this.sequenceStartTime > 2000
219
+ ) {
220
+ shouldMerge = false; // the sequence is too long
221
+ }
222
+
223
+ if (shouldMerge)
224
+ this.session.mergeUndoDeltas = true;
225
+ else if (mergeableCommands.indexOf(e.command.name) !== -1)
226
+ this.sequenceStartTime = Date.now();
227
+ };
228
+
229
+ /**
230
+ * Sets a new key handler, such as "vim" or "windows".
231
+ * @param {String} keyboardHandler The new key handler
232
+ *
233
+ **/
234
+ this.setKeyboardHandler = function(keyboardHandler, cb) {
235
+ if (keyboardHandler && typeof keyboardHandler === "string") {
236
+ this.$keybindingId = keyboardHandler;
237
+ var _self = this;
238
+ config.loadModule(["keybinding", keyboardHandler], function(module) {
239
+ if (_self.$keybindingId == keyboardHandler)
240
+ _self.keyBinding.setKeyboardHandler(module && module.handler);
241
+ cb && cb();
242
+ });
243
+ } else {
244
+ this.$keybindingId = null;
245
+ this.keyBinding.setKeyboardHandler(keyboardHandler);
246
+ cb && cb();
247
+ }
248
+ };
249
+
250
+ /**
251
+ * Returns the keyboard handler, such as "vim" or "windows".
252
+ *
253
+ * @returns {String}
254
+ *
255
+ **/
256
+ this.getKeyboardHandler = function() {
257
+ return this.keyBinding.getKeyboardHandler();
258
+ };
259
+
260
+
261
+ /**
262
+ * Emitted whenever the [[EditSession]] changes.
263
+ * @event changeSession
264
+ * @param {Object} e An object with two properties, `oldSession` and `session`, that represent the old and new [[EditSession]]s.
265
+ *
266
+ **/
267
+ /**
268
+ * Sets a new editsession to use. This method also emits the `'changeSession'` event.
269
+ * @param {EditSession} session The new session to use
270
+ *
271
+ **/
272
+ this.setSession = function(session) {
273
+ if (this.session == session)
274
+ return;
275
+
276
+ var oldSession = this.session;
277
+ if (oldSession) {
278
+ this.session.removeEventListener("change", this.$onDocumentChange);
279
+ this.session.removeEventListener("changeMode", this.$onChangeMode);
280
+ this.session.removeEventListener("tokenizerUpdate", this.$onTokenizerUpdate);
281
+ this.session.removeEventListener("changeTabSize", this.$onChangeTabSize);
282
+ this.session.removeEventListener("changeWrapLimit", this.$onChangeWrapLimit);
283
+ this.session.removeEventListener("changeWrapMode", this.$onChangeWrapMode);
284
+ this.session.removeEventListener("onChangeFold", this.$onChangeFold);
285
+ this.session.removeEventListener("changeFrontMarker", this.$onChangeFrontMarker);
286
+ this.session.removeEventListener("changeBackMarker", this.$onChangeBackMarker);
287
+ this.session.removeEventListener("changeBreakpoint", this.$onChangeBreakpoint);
288
+ this.session.removeEventListener("changeAnnotation", this.$onChangeAnnotation);
289
+ this.session.removeEventListener("changeOverwrite", this.$onCursorChange);
290
+ this.session.removeEventListener("changeScrollTop", this.$onScrollTopChange);
291
+ this.session.removeEventListener("changeScrollLeft", this.$onScrollLeftChange);
292
+
293
+ var selection = this.session.getSelection();
294
+ selection.removeEventListener("changeCursor", this.$onCursorChange);
295
+ selection.removeEventListener("changeSelection", this.$onSelectionChange);
296
+ }
297
+
298
+ this.session = session;
299
+ if (session) {
300
+ this.$onDocumentChange = this.onDocumentChange.bind(this);
301
+ session.addEventListener("change", this.$onDocumentChange);
302
+ this.renderer.setSession(session);
303
+
304
+ this.$onChangeMode = this.onChangeMode.bind(this);
305
+ session.addEventListener("changeMode", this.$onChangeMode);
306
+
307
+ this.$onTokenizerUpdate = this.onTokenizerUpdate.bind(this);
308
+ session.addEventListener("tokenizerUpdate", this.$onTokenizerUpdate);
309
+
310
+ this.$onChangeTabSize = this.renderer.onChangeTabSize.bind(this.renderer);
311
+ session.addEventListener("changeTabSize", this.$onChangeTabSize);
312
+
313
+ this.$onChangeWrapLimit = this.onChangeWrapLimit.bind(this);
314
+ session.addEventListener("changeWrapLimit", this.$onChangeWrapLimit);
315
+
316
+ this.$onChangeWrapMode = this.onChangeWrapMode.bind(this);
317
+ session.addEventListener("changeWrapMode", this.$onChangeWrapMode);
318
+
319
+ this.$onChangeFold = this.onChangeFold.bind(this);
320
+ session.addEventListener("changeFold", this.$onChangeFold);
321
+
322
+ this.$onChangeFrontMarker = this.onChangeFrontMarker.bind(this);
323
+ this.session.addEventListener("changeFrontMarker", this.$onChangeFrontMarker);
324
+
325
+ this.$onChangeBackMarker = this.onChangeBackMarker.bind(this);
326
+ this.session.addEventListener("changeBackMarker", this.$onChangeBackMarker);
327
+
328
+ this.$onChangeBreakpoint = this.onChangeBreakpoint.bind(this);
329
+ this.session.addEventListener("changeBreakpoint", this.$onChangeBreakpoint);
330
+
331
+ this.$onChangeAnnotation = this.onChangeAnnotation.bind(this);
332
+ this.session.addEventListener("changeAnnotation", this.$onChangeAnnotation);
333
+
334
+ this.$onCursorChange = this.onCursorChange.bind(this);
335
+ this.session.addEventListener("changeOverwrite", this.$onCursorChange);
336
+
337
+ this.$onScrollTopChange = this.onScrollTopChange.bind(this);
338
+ this.session.addEventListener("changeScrollTop", this.$onScrollTopChange);
339
+
340
+ this.$onScrollLeftChange = this.onScrollLeftChange.bind(this);
341
+ this.session.addEventListener("changeScrollLeft", this.$onScrollLeftChange);
342
+
343
+ this.selection = session.getSelection();
344
+ this.selection.addEventListener("changeCursor", this.$onCursorChange);
345
+
346
+ this.$onSelectionChange = this.onSelectionChange.bind(this);
347
+ this.selection.addEventListener("changeSelection", this.$onSelectionChange);
348
+
349
+ this.onChangeMode();
350
+
351
+ this.$blockScrolling += 1;
352
+ this.onCursorChange();
353
+ this.$blockScrolling -= 1;
354
+
355
+ this.onScrollTopChange();
356
+ this.onScrollLeftChange();
357
+ this.onSelectionChange();
358
+ this.onChangeFrontMarker();
359
+ this.onChangeBackMarker();
360
+ this.onChangeBreakpoint();
361
+ this.onChangeAnnotation();
362
+ this.session.getUseWrapMode() && this.renderer.adjustWrapLimit();
363
+ this.renderer.updateFull();
364
+ } else {
365
+ this.selection = null;
366
+ this.renderer.setSession(session);
367
+ }
368
+
369
+ this._signal("changeSession", {
370
+ session: session,
371
+ oldSession: oldSession
372
+ });
373
+
374
+ oldSession && oldSession._signal("changeEditor", {oldEditor: this});
375
+ session && session._signal("changeEditor", {editor: this});
376
+ };
377
+
378
+ /**
379
+ * Returns the current session being used.
380
+ * @returns {EditSession}
381
+ **/
382
+ this.getSession = function() {
383
+ return this.session;
384
+ };
385
+
386
+ /**
387
+ * Sets the current document to `val`.
388
+ * @param {String} val The new value to set for the document
389
+ * @param {Number} cursorPos Where to set the new value. `undefined` or 0 is selectAll, -1 is at the document start, and 1 is at the end
390
+ *
391
+ * @returns {String} The current document value
392
+ * @related Document.setValue
393
+ **/
394
+ this.setValue = function(val, cursorPos) {
395
+ this.session.doc.setValue(val);
396
+
397
+ if (!cursorPos)
398
+ this.selectAll();
399
+ else if (cursorPos == 1)
400
+ this.navigateFileEnd();
401
+ else if (cursorPos == -1)
402
+ this.navigateFileStart();
403
+
404
+ return val;
405
+ };
406
+
407
+ /**
408
+ * Returns the current session's content.
409
+ *
410
+ * @returns {String}
411
+ * @related EditSession.getValue
412
+ **/
413
+ this.getValue = function() {
414
+ return this.session.getValue();
415
+ };
416
+
417
+ /**
418
+ *
419
+ * Returns the currently highlighted selection.
420
+ * @returns {String} The highlighted selection
421
+ **/
422
+ this.getSelection = function() {
423
+ return this.selection;
424
+ };
425
+
426
+ /**
427
+ * {:VirtualRenderer.onResize}
428
+ * @param {Boolean} force If `true`, recomputes the size, even if the height and width haven't changed
429
+ *
430
+ *
431
+ * @related VirtualRenderer.onResize
432
+ **/
433
+ this.resize = function(force) {
434
+ this.renderer.onResize(force);
435
+ };
436
+
437
+ /**
438
+ * {:VirtualRenderer.setTheme}
439
+ * @param {String} theme The path to a theme
440
+ * @param {Function} cb optional callback called when theme is loaded
441
+ **/
442
+ this.setTheme = function(theme, cb) {
443
+ this.renderer.setTheme(theme, cb);
444
+ };
445
+
446
+ /**
447
+ * {:VirtualRenderer.getTheme}
448
+ *
449
+ * @returns {String} The set theme
450
+ * @related VirtualRenderer.getTheme
451
+ **/
452
+ this.getTheme = function() {
453
+ return this.renderer.getTheme();
454
+ };
455
+
456
+ /**
457
+ * {:VirtualRenderer.setStyle}
458
+ * @param {String} style A class name
459
+ *
460
+ *
461
+ * @related VirtualRenderer.setStyle
462
+ **/
463
+ this.setStyle = function(style) {
464
+ this.renderer.setStyle(style);
465
+ };
466
+
467
+ /**
468
+ * {:VirtualRenderer.unsetStyle}
469
+ * @related VirtualRenderer.unsetStyle
470
+ **/
471
+ this.unsetStyle = function(style) {
472
+ this.renderer.unsetStyle(style);
473
+ };
474
+
475
+ /**
476
+ * Gets the current font size of the editor text.
477
+ */
478
+ this.getFontSize = function () {
479
+ return this.getOption("fontSize") ||
480
+ dom.computedStyle(this.container, "fontSize");
481
+ };
482
+
483
+ /**
484
+ * Set a new font size (in pixels) for the editor text.
485
+ * @param {String} size A font size ( _e.g._ "12px")
486
+ *
487
+ *
488
+ **/
489
+ this.setFontSize = function(size) {
490
+ this.setOption("fontSize", size);
491
+ };
492
+
493
+ this.$highlightBrackets = function() {
494
+ if (this.session.$bracketHighlight) {
495
+ this.session.removeMarker(this.session.$bracketHighlight);
496
+ this.session.$bracketHighlight = null;
497
+ }
498
+
499
+ if (this.$highlightPending) {
500
+ return;
501
+ }
502
+
503
+ // perform highlight async to not block the browser during navigation
504
+ var self = this;
505
+ this.$highlightPending = true;
506
+ setTimeout(function() {
507
+ self.$highlightPending = false;
508
+ var session = self.session;
509
+ if (!session || !session.bgTokenizer) return;
510
+ var pos = session.findMatchingBracket(self.getCursorPosition());
511
+ if (pos) {
512
+ var range = new Range(pos.row, pos.column, pos.row, pos.column + 1);
513
+ } else if (session.$mode.getMatching) {
514
+ var range = session.$mode.getMatching(self.session);
515
+ }
516
+ if (range)
517
+ session.$bracketHighlight = session.addMarker(range, "ace_bracket", "text");
518
+ }, 50);
519
+ };
520
+
521
+ // todo: move to mode.getMatching
522
+ this.$highlightTags = function() {
523
+ if (this.$highlightTagPending)
524
+ return;
525
+
526
+ // perform highlight async to not block the browser during navigation
527
+ var self = this;
528
+ this.$highlightTagPending = true;
529
+ setTimeout(function() {
530
+ self.$highlightTagPending = false;
531
+
532
+ var session = self.session;
533
+ if (!session || !session.bgTokenizer) return;
534
+
535
+ var pos = self.getCursorPosition();
536
+ var iterator = new TokenIterator(self.session, pos.row, pos.column);
537
+ var token = iterator.getCurrentToken();
538
+
539
+ if (!token || token.type.indexOf('tag-name') === -1) {
540
+ session.removeMarker(session.$tagHighlight);
541
+ session.$tagHighlight = null;
542
+ return;
543
+ }
544
+
545
+ var tag = token.value;
546
+ var depth = 0;
547
+ var prevToken = iterator.stepBackward();
548
+
549
+ if (prevToken.value == '<'){
550
+ //find closing tag
551
+ do {
552
+ prevToken = token;
553
+ token = iterator.stepForward();
554
+
555
+ if (token && token.value === tag && token.type.indexOf('tag-name') !== -1) {
556
+ if (prevToken.value === '<'){
557
+ depth++;
558
+ } else if (prevToken.value === '</'){
559
+ depth--;
560
+ }
561
+ }
562
+
563
+ } while (token && depth >= 0);
564
+ } else {
565
+ //find opening tag
566
+ do {
567
+ token = prevToken;
568
+ prevToken = iterator.stepBackward();
569
+
570
+ if (token && token.value === tag && token.type.indexOf('tag-name') !== -1) {
571
+ if (prevToken.value === '<') {
572
+ depth++;
573
+ } else if (prevToken.value === '</') {
574
+ depth--;
575
+ }
576
+ }
577
+ } while (prevToken && depth <= 0);
578
+
579
+ //select tag again
580
+ iterator.stepForward();
581
+ }
582
+
583
+ if (!token) {
584
+ session.removeMarker(session.$tagHighlight);
585
+ session.$tagHighlight = null;
586
+ return;
587
+ }
588
+
589
+ var row = iterator.getCurrentTokenRow();
590
+ var column = iterator.getCurrentTokenColumn();
591
+ var range = new Range(row, column, row, column+token.value.length);
592
+
593
+ //remove range if different
594
+ if (session.$tagHighlight && range.compareRange(session.$backMarkers[session.$tagHighlight].range)!==0) {
595
+ session.removeMarker(session.$tagHighlight);
596
+ session.$tagHighlight = null;
597
+ }
598
+
599
+ if (range && !session.$tagHighlight)
600
+ session.$tagHighlight = session.addMarker(range, "ace_bracket", "text");
601
+ }, 50);
602
+ };
603
+
604
+ /**
605
+ *
606
+ * Brings the current `textInput` into focus.
607
+ **/
608
+ this.focus = function() {
609
+ // Safari needs the timeout
610
+ // iOS and Firefox need it called immediately
611
+ // to be on the save side we do both
612
+ var _self = this;
613
+ setTimeout(function() {
614
+ _self.textInput.focus();
615
+ });
616
+ this.textInput.focus();
617
+ };
618
+
619
+ /**
620
+ * Returns `true` if the current `textInput` is in focus.
621
+ * @return {Boolean}
622
+ **/
623
+ this.isFocused = function() {
624
+ return this.textInput.isFocused();
625
+ };
626
+
627
+ /**
628
+ *
629
+ * Blurs the current `textInput`.
630
+ **/
631
+ this.blur = function() {
632
+ this.textInput.blur();
633
+ };
634
+
635
+ /**
636
+ * Emitted once the editor comes into focus.
637
+ * @event focus
638
+ *
639
+ *
640
+ **/
641
+ this.onFocus = function(e) {
642
+ if (this.$isFocused)
643
+ return;
644
+ this.$isFocused = true;
645
+ this.renderer.showCursor();
646
+ this.renderer.visualizeFocus();
647
+ this._emit("focus", e);
648
+ };
649
+
650
+ /**
651
+ * Emitted once the editor has been blurred.
652
+ * @event blur
653
+ *
654
+ *
655
+ **/
656
+ this.onBlur = function(e) {
657
+ if (!this.$isFocused)
658
+ return;
659
+ this.$isFocused = false;
660
+ this.renderer.hideCursor();
661
+ this.renderer.visualizeBlur();
662
+ this._emit("blur", e);
663
+ };
664
+
665
+ this.$cursorChange = function() {
666
+ this.renderer.updateCursor();
667
+ };
668
+
669
+ /**
670
+ * Emitted whenever the document is changed.
671
+ * @event change
672
+ * @param {Object} e Contains a single property, `data`, which has the delta of changes
673
+ *
674
+ *
675
+ *
676
+ **/
677
+ this.onDocumentChange = function(e) {
678
+ var delta = e.data;
679
+ var range = delta.range;
680
+ var lastRow;
681
+
682
+ if (range.start.row == range.end.row && delta.action != "insertLines" && delta.action != "removeLines")
683
+ lastRow = range.end.row;
684
+ else
685
+ lastRow = Infinity;
686
+ this.renderer.updateLines(range.start.row, lastRow, this.session.$useWrapMode);
687
+
688
+ this._signal("change", e);
689
+
690
+ // update cursor because tab characters can influence the cursor position
691
+ this.$cursorChange();
692
+ this.$updateHighlightActiveLine();
693
+ };
694
+
695
+ this.onTokenizerUpdate = function(e) {
696
+ var rows = e.data;
697
+ this.renderer.updateLines(rows.first, rows.last);
698
+ };
699
+
700
+
701
+ this.onScrollTopChange = function() {
702
+ this.renderer.scrollToY(this.session.getScrollTop());
703
+ };
704
+
705
+ this.onScrollLeftChange = function() {
706
+ this.renderer.scrollToX(this.session.getScrollLeft());
707
+ };
708
+
709
+ /**
710
+ * Emitted when the selection changes.
711
+ *
712
+ **/
713
+ this.onCursorChange = function() {
714
+ this.$cursorChange();
715
+
716
+ if (!this.$blockScrolling) {
717
+ this.renderer.scrollCursorIntoView();
718
+ }
719
+
720
+ this.$highlightBrackets();
721
+ this.$highlightTags();
722
+ this.$updateHighlightActiveLine();
723
+ this._signal("changeSelection");
724
+ };
725
+
726
+ this.$updateHighlightActiveLine = function() {
727
+ var session = this.getSession();
728
+
729
+ var highlight;
730
+ if (this.$highlightActiveLine) {
731
+ if ((this.$selectionStyle != "line" || !this.selection.isMultiLine()))
732
+ highlight = this.getCursorPosition();
733
+ if (this.renderer.$maxLines && this.session.getLength() === 1 && !(this.renderer.$minLines > 1))
734
+ highlight = false;
735
+ }
736
+
737
+ if (session.$highlightLineMarker && !highlight) {
738
+ session.removeMarker(session.$highlightLineMarker.id);
739
+ session.$highlightLineMarker = null;
740
+ } else if (!session.$highlightLineMarker && highlight) {
741
+ var range = new Range(highlight.row, highlight.column, highlight.row, Infinity);
742
+ range.id = session.addMarker(range, "ace_active-line", "screenLine");
743
+ session.$highlightLineMarker = range;
744
+ } else if (highlight) {
745
+ session.$highlightLineMarker.start.row = highlight.row;
746
+ session.$highlightLineMarker.end.row = highlight.row;
747
+ session.$highlightLineMarker.start.column = highlight.column;
748
+ session._signal("changeBackMarker");
749
+ }
750
+ };
751
+
752
+ this.onSelectionChange = function(e) {
753
+ var session = this.session;
754
+
755
+ if (session.$selectionMarker) {
756
+ session.removeMarker(session.$selectionMarker);
757
+ }
758
+ session.$selectionMarker = null;
759
+
760
+ if (!this.selection.isEmpty()) {
761
+ var range = this.selection.getRange();
762
+ var style = this.getSelectionStyle();
763
+ session.$selectionMarker = session.addMarker(range, "ace_selection", style);
764
+ } else {
765
+ this.$updateHighlightActiveLine();
766
+ }
767
+
768
+ var re = this.$highlightSelectedWord && this.$getSelectionHighLightRegexp();
769
+ this.session.highlight(re);
770
+
771
+ this._signal("changeSelection");
772
+ };
773
+
774
+ this.$getSelectionHighLightRegexp = function() {
775
+ var session = this.session;
776
+
777
+ var selection = this.getSelectionRange();
778
+ if (selection.isEmpty() || selection.isMultiLine())
779
+ return;
780
+
781
+ var startOuter = selection.start.column - 1;
782
+ var endOuter = selection.end.column + 1;
783
+ var line = session.getLine(selection.start.row);
784
+ var lineCols = line.length;
785
+ var needle = line.substring(Math.max(startOuter, 0),
786
+ Math.min(endOuter, lineCols));
787
+
788
+ // Make sure the outer characters are not part of the word.
789
+ if ((startOuter >= 0 && /^[\w\d]/.test(needle)) ||
790
+ (endOuter <= lineCols && /[\w\d]$/.test(needle)))
791
+ return;
792
+
793
+ needle = line.substring(selection.start.column, selection.end.column);
794
+ if (!/^[\w\d]+$/.test(needle))
795
+ return;
796
+
797
+ var re = this.$search.$assembleRegExp({
798
+ wholeWord: true,
799
+ caseSensitive: true,
800
+ needle: needle
801
+ });
802
+
803
+ return re;
804
+ };
805
+
806
+
807
+ this.onChangeFrontMarker = function() {
808
+ this.renderer.updateFrontMarkers();
809
+ };
810
+
811
+ this.onChangeBackMarker = function() {
812
+ this.renderer.updateBackMarkers();
813
+ };
814
+
815
+
816
+ this.onChangeBreakpoint = function() {
817
+ this.renderer.updateBreakpoints();
818
+ };
819
+
820
+ this.onChangeAnnotation = function() {
821
+ this.renderer.setAnnotations(this.session.getAnnotations());
822
+ };
823
+
824
+
825
+ this.onChangeMode = function(e) {
826
+ this.renderer.updateText();
827
+ this._emit("changeMode", e);
828
+ };
829
+
830
+
831
+ this.onChangeWrapLimit = function() {
832
+ this.renderer.updateFull();
833
+ };
834
+
835
+ this.onChangeWrapMode = function() {
836
+ this.renderer.onResize(true);
837
+ };
838
+
839
+
840
+ this.onChangeFold = function() {
841
+ // Update the active line marker as due to folding changes the current
842
+ // line range on the screen might have changed.
843
+ this.$updateHighlightActiveLine();
844
+ // TODO: This might be too much updating. Okay for now.
845
+ this.renderer.updateFull();
846
+ };
847
+
848
+
849
+ /**
850
+ * Returns the string of text currently highlighted.
851
+ * @returns {String}
852
+ **/
853
+ this.getSelectedText = function() {
854
+ return this.session.getTextRange(this.getSelectionRange());
855
+ };
856
+
857
+ /**
858
+ * Emitted when text is copied.
859
+ * @event copy
860
+ * @param {String} text The copied text
861
+ *
862
+ **/
863
+ /**
864
+ * Returns the string of text currently highlighted.
865
+ * @returns {String}
866
+ * @deprecated Use getSelectedText instead.
867
+ **/
868
+ this.getCopyText = function() {
869
+ var text = this.getSelectedText();
870
+ this._signal("copy", text);
871
+ return text;
872
+ };
873
+
874
+ /**
875
+ * Called whenever a text "copy" happens.
876
+ **/
877
+ this.onCopy = function() {
878
+ this.commands.exec("copy", this);
879
+ };
880
+
881
+ /**
882
+ * Called whenever a text "cut" happens.
883
+ **/
884
+ this.onCut = function() {
885
+ this.commands.exec("cut", this);
886
+ };
887
+
888
+ /**
889
+ * Emitted when text is pasted.
890
+ * @event paste
891
+ * @param {Object} an object which contains one property, `text`, that represents the text to be pasted. Editing this property will alter the text that is pasted.
892
+ *
893
+ *
894
+ **/
895
+ /**
896
+ * Called whenever a text "paste" happens.
897
+ * @param {String} text The pasted text
898
+ *
899
+ *
900
+ **/
901
+ this.onPaste = function(text) {
902
+ // todo this should change when paste becomes a command
903
+ if (this.$readOnly)
904
+ return;
905
+ var e = {text: text};
906
+ this._signal("paste", e);
907
+ this.insert(e.text, true);
908
+ };
909
+
910
+ this.execCommand = function(command, args) {
911
+ return this.commands.exec(command, this, args);
912
+ };
913
+
914
+ /**
915
+ * Inserts `text` into wherever the cursor is pointing.
916
+ * @param {String} text The new text to add
917
+ *
918
+ **/
919
+ this.insert = function(text, pasted) {
920
+ var session = this.session;
921
+ var mode = session.getMode();
922
+ var cursor = this.getCursorPosition();
923
+
924
+ if (this.getBehavioursEnabled() && !pasted) {
925
+ // Get a transform if the current mode wants one.
926
+ var transform = mode.transformAction(session.getState(cursor.row), 'insertion', this, session, text);
927
+ if (transform) {
928
+ if (text !== transform.text) {
929
+ this.session.mergeUndoDeltas = false;
930
+ this.$mergeNextCommand = false;
931
+ }
932
+ text = transform.text;
933
+
934
+ }
935
+ }
936
+
937
+ if (text == "\t")
938
+ text = this.session.getTabString();
939
+
940
+ // remove selected text
941
+ if (!this.selection.isEmpty()) {
942
+ var range = this.getSelectionRange();
943
+ cursor = this.session.remove(range);
944
+ this.clearSelection();
945
+ }
946
+ else if (this.session.getOverwrite()) {
947
+ var range = new Range.fromPoints(cursor, cursor);
948
+ range.end.column += text.length;
949
+ this.session.remove(range);
950
+ }
951
+
952
+ if (text == "\n" || text == "\r\n") {
953
+ var line = session.getLine(cursor.row);
954
+ if (cursor.column > line.search(/\S|$/)) {
955
+ var d = line.substr(cursor.column).search(/\S|$/);
956
+ session.doc.removeInLine(cursor.row, cursor.column, cursor.column + d);
957
+ }
958
+ }
959
+ this.clearSelection();
960
+
961
+ var start = cursor.column;
962
+ var lineState = session.getState(cursor.row);
963
+ var line = session.getLine(cursor.row);
964
+ var shouldOutdent = mode.checkOutdent(lineState, line, text);
965
+ var end = session.insert(cursor, text);
966
+
967
+ if (transform && transform.selection) {
968
+ if (transform.selection.length == 2) { // Transform relative to the current column
969
+ this.selection.setSelectionRange(
970
+ new Range(cursor.row, start + transform.selection[0],
971
+ cursor.row, start + transform.selection[1]));
972
+ } else { // Transform relative to the current row.
973
+ this.selection.setSelectionRange(
974
+ new Range(cursor.row + transform.selection[0],
975
+ transform.selection[1],
976
+ cursor.row + transform.selection[2],
977
+ transform.selection[3]));
978
+ }
979
+ }
980
+
981
+ if (session.getDocument().isNewLine(text)) {
982
+ var lineIndent = mode.getNextLineIndent(lineState, line.slice(0, cursor.column), session.getTabString());
983
+
984
+ session.insert({row: cursor.row+1, column: 0}, lineIndent);
985
+ }
986
+ if (shouldOutdent)
987
+ mode.autoOutdent(lineState, session, cursor.row);
988
+ };
989
+
990
+ this.onTextInput = function(text) {
991
+ this.keyBinding.onTextInput(text);
992
+ };
993
+
994
+ this.onCommandKey = function(e, hashId, keyCode) {
995
+ this.keyBinding.onCommandKey(e, hashId, keyCode);
996
+ };
997
+
998
+ /**
999
+ * Pass in `true` to enable overwrites in your session, or `false` to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of `overwrite` changes, this function also emites the `changeOverwrite` event.
1000
+ * @param {Boolean} overwrite Defines wheter or not to set overwrites
1001
+ *
1002
+ *
1003
+ * @related EditSession.setOverwrite
1004
+ **/
1005
+ this.setOverwrite = function(overwrite) {
1006
+ this.session.setOverwrite(overwrite);
1007
+ };
1008
+
1009
+ /**
1010
+ * Returns `true` if overwrites are enabled; `false` otherwise.
1011
+ * @returns {Boolean}
1012
+ * @related EditSession.getOverwrite
1013
+ **/
1014
+ this.getOverwrite = function() {
1015
+ return this.session.getOverwrite();
1016
+ };
1017
+
1018
+ /**
1019
+ * Sets the value of overwrite to the opposite of whatever it currently is.
1020
+ * @related EditSession.toggleOverwrite
1021
+ **/
1022
+ this.toggleOverwrite = function() {
1023
+ this.session.toggleOverwrite();
1024
+ };
1025
+
1026
+ /**
1027
+ * Sets how fast the mouse scrolling should do.
1028
+ * @param {Number} speed A value indicating the new speed (in milliseconds)
1029
+ **/
1030
+ this.setScrollSpeed = function(speed) {
1031
+ this.setOption("scrollSpeed", speed);
1032
+ };
1033
+
1034
+ /**
1035
+ * Returns the value indicating how fast the mouse scroll speed is (in milliseconds).
1036
+ * @returns {Number}
1037
+ **/
1038
+ this.getScrollSpeed = function() {
1039
+ return this.getOption("scrollSpeed");
1040
+ };
1041
+
1042
+ /**
1043
+ * Sets the delay (in milliseconds) of the mouse drag.
1044
+ * @param {Number} dragDelay A value indicating the new delay
1045
+ **/
1046
+ this.setDragDelay = function(dragDelay) {
1047
+ this.setOption("dragDelay", dragDelay);
1048
+ };
1049
+
1050
+ /**
1051
+ * Returns the current mouse drag delay.
1052
+ * @returns {Number}
1053
+ **/
1054
+ this.getDragDelay = function() {
1055
+ return this.getOption("dragDelay");
1056
+ };
1057
+
1058
+ /**
1059
+ * Emitted when the selection style changes, via [[Editor.setSelectionStyle]].
1060
+ * @event changeSelectionStyle
1061
+ * @param {Object} data Contains one property, `data`, which indicates the new selection style
1062
+ **/
1063
+ /**
1064
+ * Draw selection markers spanning whole line, or only over selected text. Default value is "line"
1065
+ * @param {String} style The new selection style "line"|"text"
1066
+ *
1067
+ **/
1068
+ this.setSelectionStyle = function(val) {
1069
+ this.setOption("selectionStyle", val);
1070
+ };
1071
+
1072
+ /**
1073
+ * Returns the current selection style.
1074
+ * @returns {String}
1075
+ **/
1076
+ this.getSelectionStyle = function() {
1077
+ return this.getOption("selectionStyle");
1078
+ };
1079
+
1080
+ /**
1081
+ * Determines whether or not the current line should be highlighted.
1082
+ * @param {Boolean} shouldHighlight Set to `true` to highlight the current line
1083
+ **/
1084
+ this.setHighlightActiveLine = function(shouldHighlight) {
1085
+ this.setOption("highlightActiveLine", shouldHighlight);
1086
+ };
1087
+ /**
1088
+ * Returns `true` if current lines are always highlighted.
1089
+ * @return {Boolean}
1090
+ **/
1091
+ this.getHighlightActiveLine = function() {
1092
+ return this.getOption("highlightActiveLine");
1093
+ };
1094
+ this.setHighlightGutterLine = function(shouldHighlight) {
1095
+ this.setOption("highlightGutterLine", shouldHighlight);
1096
+ };
1097
+
1098
+ this.getHighlightGutterLine = function() {
1099
+ return this.getOption("highlightGutterLine");
1100
+ };
1101
+
1102
+ /**
1103
+ * Determines if the currently selected word should be highlighted.
1104
+ * @param {Boolean} shouldHighlight Set to `true` to highlight the currently selected word
1105
+ *
1106
+ **/
1107
+ this.setHighlightSelectedWord = function(shouldHighlight) {
1108
+ this.setOption("highlightSelectedWord", shouldHighlight);
1109
+ };
1110
+
1111
+ /**
1112
+ * Returns `true` if currently highlighted words are to be highlighted.
1113
+ * @returns {Boolean}
1114
+ **/
1115
+ this.getHighlightSelectedWord = function() {
1116
+ return this.$highlightSelectedWord;
1117
+ };
1118
+
1119
+ this.setAnimatedScroll = function(shouldAnimate){
1120
+ this.renderer.setAnimatedScroll(shouldAnimate);
1121
+ };
1122
+
1123
+ this.getAnimatedScroll = function(){
1124
+ return this.renderer.getAnimatedScroll();
1125
+ };
1126
+
1127
+ /**
1128
+ * If `showInvisibles` is set to `true`, invisible characters&mdash;like spaces or new lines&mdash;are show in the editor.
1129
+ * @param {Boolean} showInvisibles Specifies whether or not to show invisible characters
1130
+ *
1131
+ **/
1132
+ this.setShowInvisibles = function(showInvisibles) {
1133
+ this.renderer.setShowInvisibles(showInvisibles);
1134
+ };
1135
+
1136
+ /**
1137
+ * Returns `true` if invisible characters are being shown.
1138
+ * @returns {Boolean}
1139
+ **/
1140
+ this.getShowInvisibles = function() {
1141
+ return this.renderer.getShowInvisibles();
1142
+ };
1143
+
1144
+ this.setDisplayIndentGuides = function(display) {
1145
+ this.renderer.setDisplayIndentGuides(display);
1146
+ };
1147
+
1148
+ this.getDisplayIndentGuides = function() {
1149
+ return this.renderer.getDisplayIndentGuides();
1150
+ };
1151
+
1152
+ /**
1153
+ * If `showPrintMargin` is set to `true`, the print margin is shown in the editor.
1154
+ * @param {Boolean} showPrintMargin Specifies whether or not to show the print margin
1155
+ *
1156
+ **/
1157
+ this.setShowPrintMargin = function(showPrintMargin) {
1158
+ this.renderer.setShowPrintMargin(showPrintMargin);
1159
+ };
1160
+
1161
+ /**
1162
+ * Returns `true` if the print margin is being shown.
1163
+ * @returns {Boolean}
1164
+ **/
1165
+ this.getShowPrintMargin = function() {
1166
+ return this.renderer.getShowPrintMargin();
1167
+ };
1168
+
1169
+ /**
1170
+ * Sets the column defining where the print margin should be.
1171
+ * @param {Number} showPrintMargin Specifies the new print margin
1172
+ *
1173
+ **/
1174
+ this.setPrintMarginColumn = function(showPrintMargin) {
1175
+ this.renderer.setPrintMarginColumn(showPrintMargin);
1176
+ };
1177
+
1178
+ /**
1179
+ * Returns the column number of where the print margin is.
1180
+ * @returns {Number}
1181
+ **/
1182
+ this.getPrintMarginColumn = function() {
1183
+ return this.renderer.getPrintMarginColumn();
1184
+ };
1185
+
1186
+ /**
1187
+ * If `readOnly` is true, then the editor is set to read-only mode, and none of the content can change.
1188
+ * @param {Boolean} readOnly Specifies whether the editor can be modified or not
1189
+ *
1190
+ **/
1191
+ this.setReadOnly = function(readOnly) {
1192
+ this.setOption("readOnly", readOnly);
1193
+ };
1194
+
1195
+ /**
1196
+ * Returns `true` if the editor is set to read-only mode.
1197
+ * @returns {Boolean}
1198
+ **/
1199
+ this.getReadOnly = function() {
1200
+ return this.getOption("readOnly");
1201
+ };
1202
+
1203
+ /**
1204
+ * Specifies whether to use behaviors or not. ["Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.]{: #BehaviorsDef}
1205
+ * @param {Boolean} enabled Enables or disables behaviors
1206
+ *
1207
+ **/
1208
+ this.setBehavioursEnabled = function (enabled) {
1209
+ this.setOption("behavioursEnabled", enabled);
1210
+ };
1211
+
1212
+ /**
1213
+ * Returns `true` if the behaviors are currently enabled. {:BehaviorsDef}
1214
+ *
1215
+ * @returns {Boolean}
1216
+ **/
1217
+ this.getBehavioursEnabled = function () {
1218
+ return this.getOption("behavioursEnabled");
1219
+ };
1220
+
1221
+ /**
1222
+ * Specifies whether to use wrapping behaviors or not, i.e. automatically wrapping the selection with characters such as brackets
1223
+ * when such a character is typed in.
1224
+ * @param {Boolean} enabled Enables or disables wrapping behaviors
1225
+ *
1226
+ **/
1227
+ this.setWrapBehavioursEnabled = function (enabled) {
1228
+ this.setOption("wrapBehavioursEnabled", enabled);
1229
+ };
1230
+
1231
+ /**
1232
+ * Returns `true` if the wrapping behaviors are currently enabled.
1233
+ **/
1234
+ this.getWrapBehavioursEnabled = function () {
1235
+ return this.getOption("wrapBehavioursEnabled");
1236
+ };
1237
+
1238
+ /**
1239
+ * Indicates whether the fold widgets should be shown or not.
1240
+ * @param {Boolean} show Specifies whether the fold widgets are shown
1241
+ **/
1242
+ this.setShowFoldWidgets = function(show) {
1243
+ this.setOption("showFoldWidgets", show);
1244
+
1245
+ };
1246
+ /**
1247
+ * Returns `true` if the fold widgets are shown.
1248
+ * @return {Boolean}
1249
+ **/
1250
+ this.getShowFoldWidgets = function() {
1251
+ return this.getOption("showFoldWidgets");
1252
+ };
1253
+
1254
+ this.setFadeFoldWidgets = function(fade) {
1255
+ this.setOption("fadeFoldWidgets", fade);
1256
+ };
1257
+
1258
+ this.getFadeFoldWidgets = function() {
1259
+ return this.getOption("fadeFoldWidgets");
1260
+ };
1261
+
1262
+ /**
1263
+ * Removes words of text from the editor. A "word" is defined as a string of characters bookended by whitespace.
1264
+ * @param {String} dir The direction of the deletion to occur, either "left" or "right"
1265
+ *
1266
+ **/
1267
+ this.remove = function(dir) {
1268
+ if (this.selection.isEmpty()){
1269
+ if (dir == "left")
1270
+ this.selection.selectLeft();
1271
+ else
1272
+ this.selection.selectRight();
1273
+ }
1274
+
1275
+ var range = this.getSelectionRange();
1276
+ if (this.getBehavioursEnabled()) {
1277
+ var session = this.session;
1278
+ var state = session.getState(range.start.row);
1279
+ var new_range = session.getMode().transformAction(state, 'deletion', this, session, range);
1280
+
1281
+ if (range.end.column === 0) {
1282
+ var text = session.getTextRange(range);
1283
+ if (text[text.length - 1] == "\n") {
1284
+ var line = session.getLine(range.end.row);
1285
+ if (/^\s+$/.test(line)) {
1286
+ range.end.column = line.length;
1287
+ }
1288
+ }
1289
+ }
1290
+ if (new_range)
1291
+ range = new_range;
1292
+ }
1293
+
1294
+ this.session.remove(range);
1295
+ this.clearSelection();
1296
+ };
1297
+
1298
+ /**
1299
+ * Removes the word directly to the right of the current selection.
1300
+ **/
1301
+ this.removeWordRight = function() {
1302
+ if (this.selection.isEmpty())
1303
+ this.selection.selectWordRight();
1304
+
1305
+ this.session.remove(this.getSelectionRange());
1306
+ this.clearSelection();
1307
+ };
1308
+
1309
+ /**
1310
+ * Removes the word directly to the left of the current selection.
1311
+ **/
1312
+ this.removeWordLeft = function() {
1313
+ if (this.selection.isEmpty())
1314
+ this.selection.selectWordLeft();
1315
+
1316
+ this.session.remove(this.getSelectionRange());
1317
+ this.clearSelection();
1318
+ };
1319
+
1320
+ /**
1321
+ * Removes all the words to the left of the current selection, until the start of the line.
1322
+ **/
1323
+ this.removeToLineStart = function() {
1324
+ if (this.selection.isEmpty())
1325
+ this.selection.selectLineStart();
1326
+
1327
+ this.session.remove(this.getSelectionRange());
1328
+ this.clearSelection();
1329
+ };
1330
+
1331
+ /**
1332
+ * Removes all the words to the right of the current selection, until the end of the line.
1333
+ **/
1334
+ this.removeToLineEnd = function() {
1335
+ if (this.selection.isEmpty())
1336
+ this.selection.selectLineEnd();
1337
+
1338
+ var range = this.getSelectionRange();
1339
+ if (range.start.column == range.end.column && range.start.row == range.end.row) {
1340
+ range.end.column = 0;
1341
+ range.end.row++;
1342
+ }
1343
+
1344
+ this.session.remove(range);
1345
+ this.clearSelection();
1346
+ };
1347
+
1348
+ /**
1349
+ * Splits the line at the current selection (by inserting an `'\n'`).
1350
+ **/
1351
+ this.splitLine = function() {
1352
+ if (!this.selection.isEmpty()) {
1353
+ this.session.remove(this.getSelectionRange());
1354
+ this.clearSelection();
1355
+ }
1356
+
1357
+ var cursor = this.getCursorPosition();
1358
+ this.insert("\n");
1359
+ this.moveCursorToPosition(cursor);
1360
+ };
1361
+
1362
+ /**
1363
+ * Transposes current line.
1364
+ **/
1365
+ this.transposeLetters = function() {
1366
+ if (!this.selection.isEmpty()) {
1367
+ return;
1368
+ }
1369
+
1370
+ var cursor = this.getCursorPosition();
1371
+ var column = cursor.column;
1372
+ if (column === 0)
1373
+ return;
1374
+
1375
+ var line = this.session.getLine(cursor.row);
1376
+ var swap, range;
1377
+ if (column < line.length) {
1378
+ swap = line.charAt(column) + line.charAt(column-1);
1379
+ range = new Range(cursor.row, column-1, cursor.row, column+1);
1380
+ }
1381
+ else {
1382
+ swap = line.charAt(column-1) + line.charAt(column-2);
1383
+ range = new Range(cursor.row, column-2, cursor.row, column);
1384
+ }
1385
+ this.session.replace(range, swap);
1386
+ };
1387
+
1388
+ /**
1389
+ * Converts the current selection entirely into lowercase.
1390
+ **/
1391
+ this.toLowerCase = function() {
1392
+ var originalRange = this.getSelectionRange();
1393
+ if (this.selection.isEmpty()) {
1394
+ this.selection.selectWord();
1395
+ }
1396
+
1397
+ var range = this.getSelectionRange();
1398
+ var text = this.session.getTextRange(range);
1399
+ this.session.replace(range, text.toLowerCase());
1400
+ this.selection.setSelectionRange(originalRange);
1401
+ };
1402
+
1403
+ /**
1404
+ * Converts the current selection entirely into uppercase.
1405
+ **/
1406
+ this.toUpperCase = function() {
1407
+ var originalRange = this.getSelectionRange();
1408
+ if (this.selection.isEmpty()) {
1409
+ this.selection.selectWord();
1410
+ }
1411
+
1412
+ var range = this.getSelectionRange();
1413
+ var text = this.session.getTextRange(range);
1414
+ this.session.replace(range, text.toUpperCase());
1415
+ this.selection.setSelectionRange(originalRange);
1416
+ };
1417
+
1418
+ /**
1419
+ * Inserts an indentation into the current cursor position or indents the selected lines.
1420
+ *
1421
+ * @related EditSession.indentRows
1422
+ **/
1423
+ this.indent = function() {
1424
+ var session = this.session;
1425
+ var range = this.getSelectionRange();
1426
+
1427
+ if (range.start.row < range.end.row) {
1428
+ var rows = this.$getSelectedRows();
1429
+ session.indentRows(rows.first, rows.last, "\t");
1430
+ return;
1431
+ } else if (range.start.column < range.end.column) {
1432
+ var text = session.getTextRange(range);
1433
+ if (!/^\s+$/.test(text)) {
1434
+ var rows = this.$getSelectedRows();
1435
+ session.indentRows(rows.first, rows.last, "\t");
1436
+ return;
1437
+ }
1438
+ }
1439
+
1440
+ var line = session.getLine(range.start.row);
1441
+ var position = range.start;
1442
+ var size = session.getTabSize();
1443
+ var column = session.documentToScreenColumn(position.row, position.column);
1444
+
1445
+ if (this.session.getUseSoftTabs()) {
1446
+ var count = (size - column % size);
1447
+ var indentString = lang.stringRepeat(" ", count);
1448
+ } else {
1449
+ var count = column % size;
1450
+ while (line[range.start.column] == " " && count) {
1451
+ range.start.column--;
1452
+ count--;
1453
+ }
1454
+ this.selection.setSelectionRange(range);
1455
+ indentString = "\t";
1456
+ }
1457
+ return this.insert(indentString);
1458
+ };
1459
+
1460
+ /**
1461
+ * Indents the current line.
1462
+ * @related EditSession.indentRows
1463
+ **/
1464
+ this.blockIndent = function() {
1465
+ var rows = this.$getSelectedRows();
1466
+ this.session.indentRows(rows.first, rows.last, "\t");
1467
+ };
1468
+
1469
+ /**
1470
+ * Outdents the current line.
1471
+ * @related EditSession.outdentRows
1472
+ **/
1473
+ this.blockOutdent = function() {
1474
+ var selection = this.session.getSelection();
1475
+ this.session.outdentRows(selection.getRange());
1476
+ };
1477
+
1478
+ // TODO: move out of core when we have good mechanism for managing extensions
1479
+ this.sortLines = function() {
1480
+ var rows = this.$getSelectedRows();
1481
+ var session = this.session;
1482
+
1483
+ var lines = [];
1484
+ for (i = rows.first; i <= rows.last; i++)
1485
+ lines.push(session.getLine(i));
1486
+
1487
+ lines.sort(function(a, b) {
1488
+ if (a.toLowerCase() < b.toLowerCase()) return -1;
1489
+ if (a.toLowerCase() > b.toLowerCase()) return 1;
1490
+ return 0;
1491
+ });
1492
+
1493
+ var deleteRange = new Range(0, 0, 0, 0);
1494
+ for (var i = rows.first; i <= rows.last; i++) {
1495
+ var line = session.getLine(i);
1496
+ deleteRange.start.row = i;
1497
+ deleteRange.end.row = i;
1498
+ deleteRange.end.column = line.length;
1499
+ session.replace(deleteRange, lines[i-rows.first]);
1500
+ }
1501
+ };
1502
+
1503
+ /**
1504
+ * Given the currently selected range, this function either comments all the lines, or uncomments all of them.
1505
+ **/
1506
+ this.toggleCommentLines = function() {
1507
+ var state = this.session.getState(this.getCursorPosition().row);
1508
+ var rows = this.$getSelectedRows();
1509
+ this.session.getMode().toggleCommentLines(state, this.session, rows.first, rows.last);
1510
+ };
1511
+
1512
+ this.toggleBlockComment = function() {
1513
+ var cursor = this.getCursorPosition();
1514
+ var state = this.session.getState(cursor.row);
1515
+ var range = this.getSelectionRange();
1516
+ this.session.getMode().toggleBlockComment(state, this.session, range, cursor);
1517
+ };
1518
+
1519
+ /**
1520
+ * Works like [[EditSession.getTokenAt]], except it returns a number.
1521
+ * @returns {Number}
1522
+ **/
1523
+ this.getNumberAt = function(row, column) {
1524
+ var _numberRx = /[\-]?[0-9]+(?:\.[0-9]+)?/g;
1525
+ _numberRx.lastIndex = 0;
1526
+
1527
+ var s = this.session.getLine(row);
1528
+ while (_numberRx.lastIndex < column) {
1529
+ var m = _numberRx.exec(s);
1530
+ if(m.index <= column && m.index+m[0].length >= column){
1531
+ var number = {
1532
+ value: m[0],
1533
+ start: m.index,
1534
+ end: m.index+m[0].length
1535
+ };
1536
+ return number;
1537
+ }
1538
+ }
1539
+ return null;
1540
+ };
1541
+
1542
+ /**
1543
+ * If the character before the cursor is a number, this functions changes its value by `amount`.
1544
+ * @param {Number} amount The value to change the numeral by (can be negative to decrease value)
1545
+ *
1546
+ **/
1547
+ this.modifyNumber = function(amount) {
1548
+ var row = this.selection.getCursor().row;
1549
+ var column = this.selection.getCursor().column;
1550
+
1551
+ // get the char before the cursor
1552
+ var charRange = new Range(row, column-1, row, column);
1553
+
1554
+ var c = this.session.getTextRange(charRange);
1555
+ // if the char is a digit
1556
+ if (!isNaN(parseFloat(c)) && isFinite(c)) {
1557
+ // get the whole number the digit is part of
1558
+ var nr = this.getNumberAt(row, column);
1559
+ // if number found
1560
+ if (nr) {
1561
+ var fp = nr.value.indexOf(".") >= 0 ? nr.start + nr.value.indexOf(".") + 1 : nr.end;
1562
+ var decimals = nr.start + nr.value.length - fp;
1563
+
1564
+ var t = parseFloat(nr.value);
1565
+ t *= Math.pow(10, decimals);
1566
+
1567
+
1568
+ if(fp !== nr.end && column < fp){
1569
+ amount *= Math.pow(10, nr.end - column - 1);
1570
+ } else {
1571
+ amount *= Math.pow(10, nr.end - column);
1572
+ }
1573
+
1574
+ t += amount;
1575
+ t /= Math.pow(10, decimals);
1576
+ var nnr = t.toFixed(decimals);
1577
+
1578
+ //update number
1579
+ var replaceRange = new Range(row, nr.start, row, nr.end);
1580
+ this.session.replace(replaceRange, nnr);
1581
+
1582
+ //reposition the cursor
1583
+ this.moveCursorTo(row, Math.max(nr.start +1, column + nnr.length - nr.value.length));
1584
+
1585
+ }
1586
+ }
1587
+ };
1588
+
1589
+ /**
1590
+ * Removes all the lines in the current selection
1591
+ * @related EditSession.remove
1592
+ **/
1593
+ this.removeLines = function() {
1594
+ var rows = this.$getSelectedRows();
1595
+ var range;
1596
+ if (rows.first === 0 || rows.last+1 < this.session.getLength())
1597
+ range = new Range(rows.first, 0, rows.last+1, 0);
1598
+ else
1599
+ range = new Range(
1600
+ rows.first-1, this.session.getLine(rows.first-1).length,
1601
+ rows.last, this.session.getLine(rows.last).length
1602
+ );
1603
+ this.session.remove(range);
1604
+ this.clearSelection();
1605
+ };
1606
+
1607
+ this.duplicateSelection = function() {
1608
+ var sel = this.selection;
1609
+ var doc = this.session;
1610
+ var range = sel.getRange();
1611
+ var reverse = sel.isBackwards();
1612
+ if (range.isEmpty()) {
1613
+ var row = range.start.row;
1614
+ doc.duplicateLines(row, row);
1615
+ } else {
1616
+ var point = reverse ? range.start : range.end;
1617
+ var endPoint = doc.insert(point, doc.getTextRange(range), false);
1618
+ range.start = point;
1619
+ range.end = endPoint;
1620
+
1621
+ sel.setSelectionRange(range, reverse);
1622
+ }
1623
+ };
1624
+
1625
+ /**
1626
+ * Shifts all the selected lines down one row.
1627
+ *
1628
+ * @returns {Number} On success, it returns -1.
1629
+ * @related EditSession.moveLinesUp
1630
+ **/
1631
+ this.moveLinesDown = function() {
1632
+ this.$moveLines(function(firstRow, lastRow) {
1633
+ return this.session.moveLinesDown(firstRow, lastRow);
1634
+ });
1635
+ };
1636
+
1637
+ /**
1638
+ * Shifts all the selected lines up one row.
1639
+ * @returns {Number} On success, it returns -1.
1640
+ * @related EditSession.moveLinesDown
1641
+ **/
1642
+ this.moveLinesUp = function() {
1643
+ this.$moveLines(function(firstRow, lastRow) {
1644
+ return this.session.moveLinesUp(firstRow, lastRow);
1645
+ });
1646
+ };
1647
+
1648
+ /**
1649
+ * Moves a range of text from the given range to the given position. `toPosition` is an object that looks like this:
1650
+ * ```json
1651
+ * { row: newRowLocation, column: newColumnLocation }
1652
+ * ```
1653
+ * @param {Range} fromRange The range of text you want moved within the document
1654
+ * @param {Object} toPosition The location (row and column) where you want to move the text to
1655
+ *
1656
+ * @returns {Range} The new range where the text was moved to.
1657
+ * @related EditSession.moveText
1658
+ **/
1659
+ this.moveText = function(range, toPosition, copy) {
1660
+ return this.session.moveText(range, toPosition, copy);
1661
+ };
1662
+
1663
+ /**
1664
+ * Copies all the selected lines up one row.
1665
+ * @returns {Number} On success, returns 0.
1666
+ *
1667
+ **/
1668
+ this.copyLinesUp = function() {
1669
+ this.$moveLines(function(firstRow, lastRow) {
1670
+ this.session.duplicateLines(firstRow, lastRow);
1671
+ return 0;
1672
+ });
1673
+ };
1674
+
1675
+ /**
1676
+ * Copies all the selected lines down one row.
1677
+ * @returns {Number} On success, returns the number of new rows added; in other words, `lastRow - firstRow + 1`.
1678
+ * @related EditSession.duplicateLines
1679
+ *
1680
+ **/
1681
+ this.copyLinesDown = function() {
1682
+ this.$moveLines(function(firstRow, lastRow) {
1683
+ return this.session.duplicateLines(firstRow, lastRow);
1684
+ });
1685
+ };
1686
+
1687
+ /**
1688
+ * Executes a specific function, which can be anything that manipulates selected lines, such as copying them, duplicating them, or shifting them.
1689
+ * @param {Function} mover A method to call on each selected row
1690
+ *
1691
+ *
1692
+ **/
1693
+ this.$moveLines = function(mover) {
1694
+ var selection = this.selection;
1695
+ if (!selection.inMultiSelectMode || this.inVirtualSelectionMode) {
1696
+ var range = selection.toOrientedRange();
1697
+ var rows = this.$getSelectedRows(range);
1698
+ var linesMoved = mover.call(this, rows.first, rows.last);
1699
+ range.moveBy(linesMoved, 0);
1700
+ selection.fromOrientedRange(range);
1701
+ } else {
1702
+ var ranges = selection.rangeList.ranges;
1703
+ selection.rangeList.detach(this.session);
1704
+
1705
+ for (var i = ranges.length; i--; ) {
1706
+ var rangeIndex = i;
1707
+ var rows = ranges[i].collapseRows();
1708
+ var last = rows.end.row;
1709
+ var first = rows.start.row;
1710
+ while (i--) {
1711
+ rows = ranges[i].collapseRows();
1712
+ if (first - rows.end.row <= 1)
1713
+ first = rows.end.row;
1714
+ else
1715
+ break;
1716
+ }
1717
+ i++;
1718
+
1719
+ var linesMoved = mover.call(this, first, last);
1720
+ while (rangeIndex >= i) {
1721
+ ranges[rangeIndex].moveBy(linesMoved, 0);
1722
+ rangeIndex--;
1723
+ }
1724
+ }
1725
+ selection.fromOrientedRange(selection.ranges[0]);
1726
+ selection.rangeList.attach(this.session);
1727
+ }
1728
+ };
1729
+
1730
+ /**
1731
+ * Returns an object indicating the currently selected rows. The object looks like this:
1732
+ *
1733
+ * ```json
1734
+ * { first: range.start.row, last: range.end.row }
1735
+ * ```
1736
+ *
1737
+ * @returns {Object}
1738
+ **/
1739
+ this.$getSelectedRows = function() {
1740
+ var range = this.getSelectionRange().collapseRows();
1741
+
1742
+ return {
1743
+ first: this.session.getRowFoldStart(range.start.row),
1744
+ last: this.session.getRowFoldEnd(range.end.row)
1745
+ };
1746
+ };
1747
+
1748
+ this.onCompositionStart = function(text) {
1749
+ this.renderer.showComposition(this.getCursorPosition());
1750
+ };
1751
+
1752
+ this.onCompositionUpdate = function(text) {
1753
+ this.renderer.setCompositionText(text);
1754
+ };
1755
+
1756
+ this.onCompositionEnd = function() {
1757
+ this.renderer.hideComposition();
1758
+ };
1759
+
1760
+ /**
1761
+ * {:VirtualRenderer.getFirstVisibleRow}
1762
+ *
1763
+ * @returns {Number}
1764
+ * @related VirtualRenderer.getFirstVisibleRow
1765
+ **/
1766
+ this.getFirstVisibleRow = function() {
1767
+ return this.renderer.getFirstVisibleRow();
1768
+ };
1769
+
1770
+ /**
1771
+ * {:VirtualRenderer.getLastVisibleRow}
1772
+ *
1773
+ * @returns {Number}
1774
+ * @related VirtualRenderer.getLastVisibleRow
1775
+ **/
1776
+ this.getLastVisibleRow = function() {
1777
+ return this.renderer.getLastVisibleRow();
1778
+ };
1779
+
1780
+ /**
1781
+ * Indicates if the row is currently visible on the screen.
1782
+ * @param {Number} row The row to check
1783
+ *
1784
+ * @returns {Boolean}
1785
+ **/
1786
+ this.isRowVisible = function(row) {
1787
+ return (row >= this.getFirstVisibleRow() && row <= this.getLastVisibleRow());
1788
+ };
1789
+
1790
+ /**
1791
+ * Indicates if the entire row is currently visible on the screen.
1792
+ * @param {Number} row The row to check
1793
+ *
1794
+ *
1795
+ * @returns {Boolean}
1796
+ **/
1797
+ this.isRowFullyVisible = function(row) {
1798
+ return (row >= this.renderer.getFirstFullyVisibleRow() && row <= this.renderer.getLastFullyVisibleRow());
1799
+ };
1800
+
1801
+ /**
1802
+ * Returns the number of currently visibile rows.
1803
+ * @returns {Number}
1804
+ **/
1805
+ this.$getVisibleRowCount = function() {
1806
+ return this.renderer.getScrollBottomRow() - this.renderer.getScrollTopRow() + 1;
1807
+ };
1808
+
1809
+ this.$moveByPage = function(dir, select) {
1810
+ var renderer = this.renderer;
1811
+ var config = this.renderer.layerConfig;
1812
+ var rows = dir * Math.floor(config.height / config.lineHeight);
1813
+
1814
+ this.$blockScrolling++;
1815
+ if (select === true) {
1816
+ this.selection.$moveSelection(function(){
1817
+ this.moveCursorBy(rows, 0);
1818
+ });
1819
+ } else if (select === false) {
1820
+ this.selection.moveCursorBy(rows, 0);
1821
+ this.selection.clearSelection();
1822
+ }
1823
+ this.$blockScrolling--;
1824
+
1825
+ var scrollTop = renderer.scrollTop;
1826
+
1827
+ renderer.scrollBy(0, rows * config.lineHeight);
1828
+ if (select != null)
1829
+ renderer.scrollCursorIntoView(null, 0.5);
1830
+
1831
+ renderer.animateScrolling(scrollTop);
1832
+ };
1833
+
1834
+ /**
1835
+ * Selects the text from the current position of the document until where a "page down" finishes.
1836
+ **/
1837
+ this.selectPageDown = function() {
1838
+ this.$moveByPage(1, true);
1839
+ };
1840
+
1841
+ /**
1842
+ * Selects the text from the current position of the document until where a "page up" finishes.
1843
+ **/
1844
+ this.selectPageUp = function() {
1845
+ this.$moveByPage(-1, true);
1846
+ };
1847
+
1848
+ /**
1849
+ * Shifts the document to wherever "page down" is, as well as moving the cursor position.
1850
+ **/
1851
+ this.gotoPageDown = function() {
1852
+ this.$moveByPage(1, false);
1853
+ };
1854
+
1855
+ /**
1856
+ * Shifts the document to wherever "page up" is, as well as moving the cursor position.
1857
+ **/
1858
+ this.gotoPageUp = function() {
1859
+ this.$moveByPage(-1, false);
1860
+ };
1861
+
1862
+ /**
1863
+ * Scrolls the document to wherever "page down" is, without changing the cursor position.
1864
+ **/
1865
+ this.scrollPageDown = function() {
1866
+ this.$moveByPage(1);
1867
+ };
1868
+
1869
+ /**
1870
+ * Scrolls the document to wherever "page up" is, without changing the cursor position.
1871
+ **/
1872
+ this.scrollPageUp = function() {
1873
+ this.$moveByPage(-1);
1874
+ };
1875
+
1876
+ /**
1877
+ * Moves the editor to the specified row.
1878
+ * @related VirtualRenderer.scrollToRow
1879
+ **/
1880
+ this.scrollToRow = function(row) {
1881
+ this.renderer.scrollToRow(row);
1882
+ };
1883
+
1884
+ /**
1885
+ * Scrolls to a line. If `center` is `true`, it puts the line in middle of screen (or attempts to).
1886
+ * @param {Number} line The line to scroll to
1887
+ * @param {Boolean} center If `true`
1888
+ * @param {Boolean} animate If `true` animates scrolling
1889
+ * @param {Function} callback Function to be called when the animation has finished
1890
+ *
1891
+ *
1892
+ * @related VirtualRenderer.scrollToLine
1893
+ **/
1894
+ this.scrollToLine = function(line, center, animate, callback) {
1895
+ this.renderer.scrollToLine(line, center, animate, callback);
1896
+ };
1897
+
1898
+ /**
1899
+ * Attempts to center the current selection on the screen.
1900
+ **/
1901
+ this.centerSelection = function() {
1902
+ var range = this.getSelectionRange();
1903
+ var pos = {
1904
+ row: Math.floor(range.start.row + (range.end.row - range.start.row) / 2),
1905
+ column: Math.floor(range.start.column + (range.end.column - range.start.column) / 2)
1906
+ };
1907
+ this.renderer.alignCursor(pos, 0.5);
1908
+ };
1909
+
1910
+ /**
1911
+ * Gets the current position of the cursor.
1912
+ * @returns {Object} An object that looks something like this:
1913
+ *
1914
+ * ```json
1915
+ * { row: currRow, column: currCol }
1916
+ * ```
1917
+ *
1918
+ * @related Selection.getCursor
1919
+ **/
1920
+ this.getCursorPosition = function() {
1921
+ return this.selection.getCursor();
1922
+ };
1923
+
1924
+ /**
1925
+ * Returns the screen position of the cursor.
1926
+ * @returns {Number}
1927
+ * @related EditSession.documentToScreenPosition
1928
+ **/
1929
+ this.getCursorPositionScreen = function() {
1930
+ return this.session.documentToScreenPosition(this.getCursorPosition());
1931
+ };
1932
+
1933
+ /**
1934
+ * {:Selection.getRange}
1935
+ * @returns {Range}
1936
+ * @related Selection.getRange
1937
+ **/
1938
+ this.getSelectionRange = function() {
1939
+ return this.selection.getRange();
1940
+ };
1941
+
1942
+
1943
+ /**
1944
+ * Selects all the text in editor.
1945
+ * @related Selection.selectAll
1946
+ **/
1947
+ this.selectAll = function() {
1948
+ this.$blockScrolling += 1;
1949
+ this.selection.selectAll();
1950
+ this.$blockScrolling -= 1;
1951
+ };
1952
+
1953
+ /**
1954
+ * {:Selection.clearSelection}
1955
+ * @related Selection.clearSelection
1956
+ **/
1957
+ this.clearSelection = function() {
1958
+ this.selection.clearSelection();
1959
+ };
1960
+
1961
+ /**
1962
+ * Moves the cursor to the specified row and column. Note that this does not de-select the current selection.
1963
+ * @param {Number} row The new row number
1964
+ * @param {Number} column The new column number
1965
+ *
1966
+ *
1967
+ * @related Selection.moveCursorTo
1968
+ **/
1969
+ this.moveCursorTo = function(row, column) {
1970
+ this.selection.moveCursorTo(row, column);
1971
+ };
1972
+
1973
+ /**
1974
+ * Moves the cursor to the position indicated by `pos.row` and `pos.column`.
1975
+ * @param {Object} pos An object with two properties, row and column
1976
+ *
1977
+ *
1978
+ * @related Selection.moveCursorToPosition
1979
+ **/
1980
+ this.moveCursorToPosition = function(pos) {
1981
+ this.selection.moveCursorToPosition(pos);
1982
+ };
1983
+
1984
+ /**
1985
+ * Moves the cursor's row and column to the next matching bracket or HTML tag.
1986
+ *
1987
+ **/
1988
+ this.jumpToMatching = function(select, expand) {
1989
+ var cursor = this.getCursorPosition();
1990
+ var iterator = new TokenIterator(this.session, cursor.row, cursor.column);
1991
+ var prevToken = iterator.getCurrentToken();
1992
+ var token = prevToken || iterator.stepForward();
1993
+
1994
+ if (!token) return;
1995
+
1996
+ //get next closing tag or bracket
1997
+ var matchType;
1998
+ var found = false;
1999
+ var depth = {};
2000
+ var i = cursor.column - token.start;
2001
+ var bracketType;
2002
+ var brackets = {
2003
+ ")": "(",
2004
+ "(": "(",
2005
+ "]": "[",
2006
+ "[": "[",
2007
+ "{": "{",
2008
+ "}": "{"
2009
+ };
2010
+
2011
+ do {
2012
+ if (token.value.match(/[{}()\[\]]/g)) {
2013
+ for (; i < token.value.length && !found; i++) {
2014
+ if (!brackets[token.value[i]]) {
2015
+ continue;
2016
+ }
2017
+
2018
+ bracketType = brackets[token.value[i]] + '.' + token.type.replace("rparen", "lparen");
2019
+
2020
+ if (isNaN(depth[bracketType])) {
2021
+ depth[bracketType] = 0;
2022
+ }
2023
+
2024
+ switch (token.value[i]) {
2025
+ case '(':
2026
+ case '[':
2027
+ case '{':
2028
+ depth[bracketType]++;
2029
+ break;
2030
+ case ')':
2031
+ case ']':
2032
+ case '}':
2033
+ depth[bracketType]--;
2034
+
2035
+ if (depth[bracketType] === -1) {
2036
+ matchType = 'bracket';
2037
+ found = true;
2038
+ }
2039
+ break;
2040
+ }
2041
+ }
2042
+ }
2043
+ else if (token && token.type.indexOf('tag-name') !== -1) {
2044
+ if (isNaN(depth[token.value])) {
2045
+ depth[token.value] = 0;
2046
+ }
2047
+
2048
+ if (prevToken.value === '<') {
2049
+ depth[token.value]++;
2050
+ }
2051
+ else if (prevToken.value === '</') {
2052
+ depth[token.value]--;
2053
+ }
2054
+
2055
+ if (depth[token.value] === -1) {
2056
+ matchType = 'tag';
2057
+ found = true;
2058
+ }
2059
+ }
2060
+
2061
+ if (!found) {
2062
+ prevToken = token;
2063
+ token = iterator.stepForward();
2064
+ i = 0;
2065
+ }
2066
+ } while (token && !found);
2067
+
2068
+ //no match found
2069
+ if (!matchType)
2070
+ return;
2071
+
2072
+ var range, pos;
2073
+ if (matchType === 'bracket') {
2074
+ range = this.session.getBracketRange(cursor);
2075
+ if (!range) {
2076
+ range = new Range(
2077
+ iterator.getCurrentTokenRow(),
2078
+ iterator.getCurrentTokenColumn() + i - 1,
2079
+ iterator.getCurrentTokenRow(),
2080
+ iterator.getCurrentTokenColumn() + i - 1
2081
+ );
2082
+ pos = range.start;
2083
+ if (expand || pos.row === cursor.row && Math.abs(pos.column - cursor.column) < 2)
2084
+ range = this.session.getBracketRange(pos);
2085
+ }
2086
+ }
2087
+ else if (matchType === 'tag') {
2088
+ if (token && token.type.indexOf('tag-name') !== -1)
2089
+ var tag = token.value;
2090
+ else
2091
+ return;
2092
+
2093
+ range = new Range(
2094
+ iterator.getCurrentTokenRow(),
2095
+ iterator.getCurrentTokenColumn() - 2,
2096
+ iterator.getCurrentTokenRow(),
2097
+ iterator.getCurrentTokenColumn() - 2
2098
+ );
2099
+
2100
+ //find matching tag
2101
+ if (range.compare(cursor.row, cursor.column) === 0) {
2102
+ found = false;
2103
+ do {
2104
+ token = prevToken;
2105
+ prevToken = iterator.stepBackward();
2106
+
2107
+ if (prevToken) {
2108
+ if (prevToken.type.indexOf('tag-close') !== -1) {
2109
+ range.setEnd(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1);
2110
+ }
2111
+
2112
+ if (token.value === tag && token.type.indexOf('tag-name') !== -1) {
2113
+ if (prevToken.value === '<') {
2114
+ depth[tag]++;
2115
+ }
2116
+ else if (prevToken.value === '</') {
2117
+ depth[tag]--;
2118
+ }
2119
+
2120
+ if (depth[tag] === 0)
2121
+ found = true;
2122
+ }
2123
+ }
2124
+ } while (prevToken && !found);
2125
+ }
2126
+
2127
+ //we found it
2128
+ if (token && token.type.indexOf('tag-name')) {
2129
+ pos = range.start;
2130
+ if (pos.row == cursor.row && Math.abs(pos.column - cursor.column) < 2)
2131
+ pos = range.end;
2132
+ }
2133
+ }
2134
+
2135
+ pos = range && range.cursor || pos;
2136
+ if (pos) {
2137
+ if (select) {
2138
+ if (range && expand) {
2139
+ this.selection.setRange(range);
2140
+ } else if (range && range.isEqual(this.getSelectionRange())) {
2141
+ this.clearSelection();
2142
+ } else {
2143
+ this.selection.selectTo(pos.row, pos.column);
2144
+ }
2145
+ } else {
2146
+ this.selection.moveTo(pos.row, pos.column);
2147
+ }
2148
+ }
2149
+ };
2150
+
2151
+ /**
2152
+ * Moves the cursor to the specified line number, and also into the indiciated column.
2153
+ * @param {Number} lineNumber The line number to go to
2154
+ * @param {Number} column A column number to go to
2155
+ * @param {Boolean} animate If `true` animates scolling
2156
+ *
2157
+ **/
2158
+ this.gotoLine = function(lineNumber, column, animate) {
2159
+ this.selection.clearSelection();
2160
+ this.session.unfold({row: lineNumber - 1, column: column || 0});
2161
+
2162
+ this.$blockScrolling += 1;
2163
+ // todo: find a way to automatically exit multiselect mode
2164
+ this.exitMultiSelectMode && this.exitMultiSelectMode();
2165
+ this.moveCursorTo(lineNumber - 1, column || 0);
2166
+ this.$blockScrolling -= 1;
2167
+
2168
+ if (!this.isRowFullyVisible(lineNumber - 1))
2169
+ this.scrollToLine(lineNumber - 1, true, animate);
2170
+ };
2171
+
2172
+ /**
2173
+ * Moves the cursor to the specified row and column. Note that this does de-select the current selection.
2174
+ * @param {Number} row The new row number
2175
+ * @param {Number} column The new column number
2176
+ *
2177
+ *
2178
+ * @related Editor.moveCursorTo
2179
+ **/
2180
+ this.navigateTo = function(row, column) {
2181
+ this.selection.moveTo(row, column);
2182
+ };
2183
+
2184
+ /**
2185
+ * Moves the cursor up in the document the specified number of times. Note that this does de-select the current selection.
2186
+ * @param {Number} times The number of times to change navigation
2187
+ *
2188
+ *
2189
+ **/
2190
+ this.navigateUp = function(times) {
2191
+ if (this.selection.isMultiLine() && !this.selection.isBackwards()) {
2192
+ var selectionStart = this.selection.anchor.getPosition();
2193
+ return this.moveCursorToPosition(selectionStart);
2194
+ }
2195
+ this.selection.clearSelection();
2196
+ this.selection.moveCursorBy(-times || -1, 0);
2197
+ };
2198
+
2199
+ /**
2200
+ * Moves the cursor down in the document the specified number of times. Note that this does de-select the current selection.
2201
+ * @param {Number} times The number of times to change navigation
2202
+ *
2203
+ *
2204
+ **/
2205
+ this.navigateDown = function(times) {
2206
+ if (this.selection.isMultiLine() && this.selection.isBackwards()) {
2207
+ var selectionEnd = this.selection.anchor.getPosition();
2208
+ return this.moveCursorToPosition(selectionEnd);
2209
+ }
2210
+ this.selection.clearSelection();
2211
+ this.selection.moveCursorBy(times || 1, 0);
2212
+ };
2213
+
2214
+ /**
2215
+ * Moves the cursor left in the document the specified number of times. Note that this does de-select the current selection.
2216
+ * @param {Number} times The number of times to change navigation
2217
+ *
2218
+ *
2219
+ **/
2220
+ this.navigateLeft = function(times) {
2221
+ if (!this.selection.isEmpty()) {
2222
+ var selectionStart = this.getSelectionRange().start;
2223
+ this.moveCursorToPosition(selectionStart);
2224
+ }
2225
+ else {
2226
+ times = times || 1;
2227
+ while (times--) {
2228
+ this.selection.moveCursorLeft();
2229
+ }
2230
+ }
2231
+ this.clearSelection();
2232
+ };
2233
+
2234
+ /**
2235
+ * Moves the cursor right in the document the specified number of times. Note that this does de-select the current selection.
2236
+ * @param {Number} times The number of times to change navigation
2237
+ *
2238
+ *
2239
+ **/
2240
+ this.navigateRight = function(times) {
2241
+ if (!this.selection.isEmpty()) {
2242
+ var selectionEnd = this.getSelectionRange().end;
2243
+ this.moveCursorToPosition(selectionEnd);
2244
+ }
2245
+ else {
2246
+ times = times || 1;
2247
+ while (times--) {
2248
+ this.selection.moveCursorRight();
2249
+ }
2250
+ }
2251
+ this.clearSelection();
2252
+ };
2253
+
2254
+ /**
2255
+ *
2256
+ * Moves the cursor to the start of the current line. Note that this does de-select the current selection.
2257
+ **/
2258
+ this.navigateLineStart = function() {
2259
+ this.selection.moveCursorLineStart();
2260
+ this.clearSelection();
2261
+ };
2262
+
2263
+ /**
2264
+ *
2265
+ * Moves the cursor to the end of the current line. Note that this does de-select the current selection.
2266
+ **/
2267
+ this.navigateLineEnd = function() {
2268
+ this.selection.moveCursorLineEnd();
2269
+ this.clearSelection();
2270
+ };
2271
+
2272
+ /**
2273
+ *
2274
+ * Moves the cursor to the end of the current file. Note that this does de-select the current selection.
2275
+ **/
2276
+ this.navigateFileEnd = function() {
2277
+ this.selection.moveCursorFileEnd();
2278
+ this.clearSelection();
2279
+ };
2280
+
2281
+ /**
2282
+ *
2283
+ * Moves the cursor to the start of the current file. Note that this does de-select the current selection.
2284
+ **/
2285
+ this.navigateFileStart = function() {
2286
+ this.selection.moveCursorFileStart();
2287
+ this.clearSelection();
2288
+ };
2289
+
2290
+ /**
2291
+ *
2292
+ * Moves the cursor to the word immediately to the right of the current position. Note that this does de-select the current selection.
2293
+ **/
2294
+ this.navigateWordRight = function() {
2295
+ this.selection.moveCursorWordRight();
2296
+ this.clearSelection();
2297
+ };
2298
+
2299
+ /**
2300
+ *
2301
+ * Moves the cursor to the word immediately to the left of the current position. Note that this does de-select the current selection.
2302
+ **/
2303
+ this.navigateWordLeft = function() {
2304
+ this.selection.moveCursorWordLeft();
2305
+ this.clearSelection();
2306
+ };
2307
+
2308
+ /**
2309
+ * Replaces the first occurance of `options.needle` with the value in `replacement`.
2310
+ * @param {String} replacement The text to replace with
2311
+ * @param {Object} options The [[Search `Search`]] options to use
2312
+ *
2313
+ *
2314
+ **/
2315
+ this.replace = function(replacement, options) {
2316
+ if (options)
2317
+ this.$search.set(options);
2318
+
2319
+ var range = this.$search.find(this.session);
2320
+ var replaced = 0;
2321
+ if (!range)
2322
+ return replaced;
2323
+
2324
+ if (this.$tryReplace(range, replacement)) {
2325
+ replaced = 1;
2326
+ }
2327
+ if (range !== null) {
2328
+ this.selection.setSelectionRange(range);
2329
+ this.renderer.scrollSelectionIntoView(range.start, range.end);
2330
+ }
2331
+
2332
+ return replaced;
2333
+ };
2334
+
2335
+ /**
2336
+ * Replaces all occurances of `options.needle` with the value in `replacement`.
2337
+ * @param {String} replacement The text to replace with
2338
+ * @param {Object} options The [[Search `Search`]] options to use
2339
+ *
2340
+ *
2341
+ **/
2342
+ this.replaceAll = function(replacement, options) {
2343
+ if (options) {
2344
+ this.$search.set(options);
2345
+ }
2346
+
2347
+ var ranges = this.$search.findAll(this.session);
2348
+ var replaced = 0;
2349
+ if (!ranges.length)
2350
+ return replaced;
2351
+
2352
+ this.$blockScrolling += 1;
2353
+
2354
+ var selection = this.getSelectionRange();
2355
+ this.selection.moveTo(0, 0);
2356
+
2357
+ for (var i = ranges.length - 1; i >= 0; --i) {
2358
+ if(this.$tryReplace(ranges[i], replacement)) {
2359
+ replaced++;
2360
+ }
2361
+ }
2362
+
2363
+ this.selection.setSelectionRange(selection);
2364
+ this.$blockScrolling -= 1;
2365
+
2366
+ return replaced;
2367
+ };
2368
+
2369
+ this.$tryReplace = function(range, replacement) {
2370
+ var input = this.session.getTextRange(range);
2371
+ replacement = this.$search.replace(input, replacement);
2372
+ if (replacement !== null) {
2373
+ range.end = this.session.replace(range, replacement);
2374
+ return range;
2375
+ } else {
2376
+ return null;
2377
+ }
2378
+ };
2379
+
2380
+ /**
2381
+ * {:Search.getOptions} For more information on `options`, see [[Search `Search`]].
2382
+ * @related Search.getOptions
2383
+ * @returns {Object}
2384
+ **/
2385
+ this.getLastSearchOptions = function() {
2386
+ return this.$search.getOptions();
2387
+ };
2388
+
2389
+ /**
2390
+ * Attempts to find `needle` within the document. For more information on `options`, see [[Search `Search`]].
2391
+ * @param {String} needle The text to search for (optional)
2392
+ * @param {Object} options An object defining various search properties
2393
+ * @param {Boolean} animate If `true` animate scrolling
2394
+ *
2395
+ *
2396
+ * @related Search.find
2397
+ **/
2398
+ this.find = function(needle, options, animate) {
2399
+ if (!options)
2400
+ options = {};
2401
+
2402
+ if (typeof needle == "string" || needle instanceof RegExp)
2403
+ options.needle = needle;
2404
+ else if (typeof needle == "object")
2405
+ oop.mixin(options, needle);
2406
+
2407
+ var range = this.selection.getRange();
2408
+ if (options.needle == null) {
2409
+ needle = this.session.getTextRange(range)
2410
+ || this.$search.$options.needle;
2411
+ if (!needle) {
2412
+ range = this.session.getWordRange(range.start.row, range.start.column);
2413
+ needle = this.session.getTextRange(range);
2414
+ }
2415
+ this.$search.set({needle: needle});
2416
+ }
2417
+
2418
+ this.$search.set(options);
2419
+ if (!options.start)
2420
+ this.$search.set({start: range});
2421
+
2422
+ var newRange = this.$search.find(this.session);
2423
+ if (options.preventScroll)
2424
+ return newRange;
2425
+ if (newRange) {
2426
+ this.revealRange(newRange, animate);
2427
+ return newRange;
2428
+ }
2429
+ // clear selection if nothing is found
2430
+ if (options.backwards)
2431
+ range.start = range.end;
2432
+ else
2433
+ range.end = range.start;
2434
+ this.selection.setRange(range);
2435
+ };
2436
+
2437
+ /**
2438
+ * Performs another search for `needle` in the document. For more information on `options`, see [[Search `Search`]].
2439
+ * @param {Object} options search options
2440
+ * @param {Boolean} animate If `true` animate scrolling
2441
+ *
2442
+ *
2443
+ * @related Editor.find
2444
+ **/
2445
+ this.findNext = function(options, animate) {
2446
+ this.find({skipCurrent: true, backwards: false}, options, animate);
2447
+ };
2448
+
2449
+ /**
2450
+ * Performs a search for `needle` backwards. For more information on `options`, see [[Search `Search`]].
2451
+ * @param {Object} options search options
2452
+ * @param {Boolean} animate If `true` animate scrolling
2453
+ *
2454
+ *
2455
+ * @related Editor.find
2456
+ **/
2457
+ this.findPrevious = function(options, animate) {
2458
+ this.find(options, {skipCurrent: true, backwards: true}, animate);
2459
+ };
2460
+
2461
+ this.revealRange = function(range, animate) {
2462
+ this.$blockScrolling += 1;
2463
+ this.session.unfold(range);
2464
+ this.selection.setSelectionRange(range);
2465
+ this.$blockScrolling -= 1;
2466
+
2467
+ var scrollTop = this.renderer.scrollTop;
2468
+ this.renderer.scrollSelectionIntoView(range.start, range.end, 0.5);
2469
+ if (animate !== false)
2470
+ this.renderer.animateScrolling(scrollTop);
2471
+ };
2472
+
2473
+ /**
2474
+ * {:UndoManager.undo}
2475
+ * @related UndoManager.undo
2476
+ **/
2477
+ this.undo = function() {
2478
+ this.$blockScrolling++;
2479
+ this.session.getUndoManager().undo();
2480
+ this.$blockScrolling--;
2481
+ this.renderer.scrollCursorIntoView(null, 0.5);
2482
+ };
2483
+
2484
+ /**
2485
+ * {:UndoManager.redo}
2486
+ * @related UndoManager.redo
2487
+ **/
2488
+ this.redo = function() {
2489
+ this.$blockScrolling++;
2490
+ this.session.getUndoManager().redo();
2491
+ this.$blockScrolling--;
2492
+ this.renderer.scrollCursorIntoView(null, 0.5);
2493
+ };
2494
+
2495
+ /**
2496
+ *
2497
+ * Cleans up the entire editor.
2498
+ **/
2499
+ this.destroy = function() {
2500
+ this.renderer.destroy();
2501
+ this._signal("destroy", this);
2502
+ if (this.session) {
2503
+ this.session.destroy();
2504
+ }
2505
+ };
2506
+
2507
+ /**
2508
+ * Enables automatic scrolling of the cursor into view when editor itself is inside scrollable element
2509
+ * @param {Boolean} enable default true
2510
+ **/
2511
+ this.setAutoScrollEditorIntoView = function(enable) {
2512
+ if (!enable)
2513
+ return;
2514
+ var rect;
2515
+ var self = this;
2516
+ var shouldScroll = false;
2517
+ if (!this.$scrollAnchor)
2518
+ this.$scrollAnchor = document.createElement("div");
2519
+ var scrollAnchor = this.$scrollAnchor;
2520
+ scrollAnchor.style.cssText = "position:absolute";
2521
+ this.container.insertBefore(scrollAnchor, this.container.firstChild);
2522
+ var onChangeSelection = this.on("changeSelection", function() {
2523
+ shouldScroll = true;
2524
+ });
2525
+ // needed to not trigger sync reflow
2526
+ var onBeforeRender = this.renderer.on("beforeRender", function() {
2527
+ if (shouldScroll)
2528
+ rect = self.renderer.container.getBoundingClientRect();
2529
+ });
2530
+ var onAfterRender = this.renderer.on("afterRender", function() {
2531
+ if (shouldScroll && rect && (self.isFocused()
2532
+ || self.searchBox && self.searchBox.isFocused())
2533
+ ) {
2534
+ var renderer = self.renderer;
2535
+ var pos = renderer.$cursorLayer.$pixelPos;
2536
+ var config = renderer.layerConfig;
2537
+ var top = pos.top - config.offset;
2538
+ if (pos.top >= 0 && top + rect.top < 0) {
2539
+ shouldScroll = true;
2540
+ } else if (pos.top < config.height &&
2541
+ pos.top + rect.top + config.lineHeight > window.innerHeight) {
2542
+ shouldScroll = false;
2543
+ } else {
2544
+ shouldScroll = null;
2545
+ }
2546
+ if (shouldScroll != null) {
2547
+ scrollAnchor.style.top = top + "px";
2548
+ scrollAnchor.style.left = pos.left + "px";
2549
+ scrollAnchor.style.height = config.lineHeight + "px";
2550
+ scrollAnchor.scrollIntoView(shouldScroll);
2551
+ }
2552
+ shouldScroll = rect = null;
2553
+ }
2554
+ });
2555
+ this.setAutoScrollEditorIntoView = function(enable) {
2556
+ if (enable)
2557
+ return;
2558
+ delete this.setAutoScrollEditorIntoView;
2559
+ this.removeEventListener("changeSelection", onChangeSelection);
2560
+ this.renderer.removeEventListener("afterRender", onAfterRender);
2561
+ this.renderer.removeEventListener("beforeRender", onBeforeRender);
2562
+ };
2563
+ };
2564
+
2565
+
2566
+ this.$resetCursorStyle = function() {
2567
+ var style = this.$cursorStyle || "ace";
2568
+ var cursorLayer = this.renderer.$cursorLayer;
2569
+ if (!cursorLayer)
2570
+ return;
2571
+ cursorLayer.setSmoothBlinking(/smooth/.test(style));
2572
+ cursorLayer.isBlinking = !this.$readOnly && style != "wide";
2573
+ dom.setCssClass(cursorLayer.element, "ace_slim-cursors", /slim/.test(style));
2574
+ };
2575
+
2576
+ }).call(Editor.prototype);
2577
+
2578
+
2579
+
2580
+ config.defineOptions(Editor.prototype, "editor", {
2581
+ selectionStyle: {
2582
+ set: function(style) {
2583
+ this.onSelectionChange();
2584
+ this._signal("changeSelectionStyle", {data: style});
2585
+ },
2586
+ initialValue: "line"
2587
+ },
2588
+ highlightActiveLine: {
2589
+ set: function() {this.$updateHighlightActiveLine();},
2590
+ initialValue: true
2591
+ },
2592
+ highlightSelectedWord: {
2593
+ set: function(shouldHighlight) {this.$onSelectionChange();},
2594
+ initialValue: true
2595
+ },
2596
+ readOnly: {
2597
+ set: function(readOnly) {
2598
+ // disabled to not break vim mode!
2599
+ // this.textInput.setReadOnly(readOnly);
2600
+ this.$resetCursorStyle();
2601
+ },
2602
+ initialValue: false
2603
+ },
2604
+ cursorStyle: {
2605
+ set: function(val) { this.$resetCursorStyle(); },
2606
+ values: ["ace", "slim", "smooth", "wide"],
2607
+ initialValue: "ace"
2608
+ },
2609
+ mergeUndoDeltas: {
2610
+ values: [false, true, "always"],
2611
+ initialValue: true
2612
+ },
2613
+ behavioursEnabled: {initialValue: true},
2614
+ wrapBehavioursEnabled: {initialValue: true},
2615
+ autoScrollEditorIntoView: {
2616
+ set: function(val) {this.setAutoScrollEditorIntoView(val)}
2617
+ },
2618
+
2619
+ hScrollBarAlwaysVisible: "renderer",
2620
+ vScrollBarAlwaysVisible: "renderer",
2621
+ highlightGutterLine: "renderer",
2622
+ animatedScroll: "renderer",
2623
+ showInvisibles: "renderer",
2624
+ showPrintMargin: "renderer",
2625
+ printMarginColumn: "renderer",
2626
+ printMargin: "renderer",
2627
+ fadeFoldWidgets: "renderer",
2628
+ showFoldWidgets: "renderer",
2629
+ showLineNumbers: "renderer",
2630
+ showGutter: "renderer",
2631
+ displayIndentGuides: "renderer",
2632
+ fontSize: "renderer",
2633
+ fontFamily: "renderer",
2634
+ maxLines: "renderer",
2635
+ minLines: "renderer",
2636
+ scrollPastEnd: "renderer",
2637
+ fixedWidthGutter: "renderer",
2638
+ theme: "renderer",
2639
+
2640
+ scrollSpeed: "$mouseHandler",
2641
+ dragDelay: "$mouseHandler",
2642
+ dragEnabled: "$mouseHandler",
2643
+ focusTimout: "$mouseHandler",
2644
+ tooltipFollowsMouse: "$mouseHandler",
2645
+
2646
+ firstLineNumber: "session",
2647
+ overwrite: "session",
2648
+ newLineMode: "session",
2649
+ useWorker: "session",
2650
+ useSoftTabs: "session",
2651
+ tabSize: "session",
2652
+ wrap: "session",
2653
+ foldStyle: "session",
2654
+ mode: "session"
2655
+ });
2656
+
2657
+ exports.Editor = Editor;
2658
+ });