jquery-ace-rails 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +36 -0
- data/lib/jquery-ace-rails.rb +5 -0
- data/lib/jquery-ace-rails/engine.rb +4 -0
- data/lib/jquery-ace-rails/version.rb +3 -0
- data/vendor/assets/javascripts/jquery-ace/jquery-ace.coffee +126 -0
- data/vendor/assets/javascripts/jquery-ace/jquery-ace.js +195 -0
- data/vendor/assets/javascripts/jquery-ace/jquery-ace.min.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/ace.js +11 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/ext-static_highlight.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/ext-textarea.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/keybinding-emacs.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/keybinding-vim.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-abap.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-asciidoc.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-c9search.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-c_cpp.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-clojure.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-coffee.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-coldfusion.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-csharp.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-css.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-dart.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-diff.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-dot.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-glsl.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-golang.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-groovy.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-haml.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-haxe.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-html.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-jade.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-java.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-javascript.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-json.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-jsp.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-jsx.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-latex.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-less.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-liquid.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-lisp.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-lua.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-luapage.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-lucene.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-makefile.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-markdown.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-objectivec.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-ocaml.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-perl.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-pgsql.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-php.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-powershell.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-python.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-r.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-rdoc.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-rhtml.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-ruby.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-scad.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-scala.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-scss.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-sh.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-sql.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-stylus.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-svg.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-tcl.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-tex.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-text.js +0 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-textile.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-typescript.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-xml.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-xquery.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/mode-yaml.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-ambiance.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-chaos.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-chrome.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-clouds.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-clouds_midnight.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-cobalt.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-crimson_editor.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-dawn.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-dreamweaver.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-eclipse.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-github.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-idle_fingers.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-kr.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-merbivore.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-merbivore_soft.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-mono_industrial.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-monokai.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-pastel_on_dark.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-solarized_dark.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-solarized_light.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-textmate.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-tomorrow.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-tomorrow_night.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-tomorrow_night_blue.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-tomorrow_night_bright.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-tomorrow_night_eighties.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-twilight.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-vibrant_ink.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/theme-xcode.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/worker-coffee.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/worker-css.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/worker-javascript.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/worker-json.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src-min-noconflict/worker-xquery.js +1 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/ace.js +14262 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/ext-static_highlight.js +96 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/ext-textarea.js +591 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/keybinding-emacs.js +364 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/keybinding-vim.js +1646 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-abap.js +259 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-asciidoc.js +372 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-c9search.js +187 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-c_cpp.js +765 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-clojure.js +325 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-coffee.js +520 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-coldfusion.js +1725 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-csharp.js +605 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-css.js +680 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-dart.js +279 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-diff.js +163 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-dot.js +348 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-glsl.js +838 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-golang.js +660 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-groovy.js +1082 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-haml.js +440 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-haxe.js +610 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-html.js +1850 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-jade.js +2035 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-java.js +1041 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-javascript.js +921 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-json.js +574 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-jsp.js +1371 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-jsx.js +635 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-latex.js +217 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-less.js +394 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-liquid.js +921 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-lisp.js +142 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-lua.js +609 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-luapage.js +2463 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-lucene.js +64 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-makefile.js +314 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-markdown.js +2228 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-objectivec.js +655 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-ocaml.js +448 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-perl.js +319 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-pgsql.js +928 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-php.js +2299 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-powershell.js +611 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-python.js +290 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-r.js +410 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-rdoc.js +189 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-rhtml.js +2138 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-ruby.js +410 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-scad.js +698 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-scala.js +1070 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-scss.js +416 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-sh.js +232 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-sql.js +145 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-stylus.js +474 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-svg.js +1490 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-tcl.js +342 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-tex.js +171 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-text.js +0 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-textile.js +175 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-typescript.js +1011 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-xml.js +792 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-xquery.js +676 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/mode-yaml.js +298 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-ambiance.js +202 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-chaos.js +167 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-chrome.js +161 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-clouds.js +135 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-clouds_midnight.js +136 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-cobalt.js +150 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-crimson_editor.js +154 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-dawn.js +146 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-dreamweaver.js +173 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-eclipse.js +122 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-github.js +136 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-idle_fingers.js +136 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-kr.js +143 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-merbivore.js +135 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-merbivore_soft.js +136 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-mono_industrial.js +148 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-monokai.js +140 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-pastel_on_dark.js +148 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-solarized_dark.js +128 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-solarized_light.js +131 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-textmate.js +163 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-tomorrow.js +147 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-tomorrow_night.js +147 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-tomorrow_night_blue.js +145 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-tomorrow_night_bright.js +147 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-tomorrow_night_eighties.js +144 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-twilight.js +147 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-vibrant_ink.js +131 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/theme-xcode.js +125 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/worker-coffee.js +6985 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/worker-css.js +7741 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/worker-javascript.js +6387 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/worker-json.js +2228 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/ace-build/src/worker-xquery.js +21719 -0
- data/vendor/assets/javascripts/jquery-ace/vendor/jquery-1.8.3.min.js +2 -0
- metadata +249 -0
@@ -0,0 +1,410 @@
|
|
1
|
+
/* ***** BEGIN LICENSE BLOCK *****
|
2
|
+
* Distributed under the BSD license:
|
3
|
+
*
|
4
|
+
* Copyright (c) 2010, Ajax.org B.V.
|
5
|
+
* All rights reserved.
|
6
|
+
*
|
7
|
+
* Redistribution and use in source and binary forms, with or without
|
8
|
+
* modification, are permitted provided that the following conditions are met:
|
9
|
+
* * Redistributions of source code must retain the above copyright
|
10
|
+
* notice, this list of conditions and the following disclaimer.
|
11
|
+
* * Redistributions in binary form must reproduce the above copyright
|
12
|
+
* notice, this list of conditions and the following disclaimer in the
|
13
|
+
* documentation and/or other materials provided with the distribution.
|
14
|
+
* * Neither the name of Ajax.org B.V. nor the
|
15
|
+
* names of its contributors may be used to endorse or promote products
|
16
|
+
* derived from this software without specific prior written permission.
|
17
|
+
*
|
18
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
19
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
21
|
+
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
22
|
+
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
23
|
+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
24
|
+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
25
|
+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
26
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
27
|
+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
28
|
+
*
|
29
|
+
* ***** END LICENSE BLOCK ***** */
|
30
|
+
|
31
|
+
define('ace/mode/ruby', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/ruby_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/mode/folding/coffee'], function(require, exports, module) {
|
32
|
+
|
33
|
+
|
34
|
+
var oop = require("../lib/oop");
|
35
|
+
var TextMode = require("./text").Mode;
|
36
|
+
var Tokenizer = require("../tokenizer").Tokenizer;
|
37
|
+
var RubyHighlightRules = require("./ruby_highlight_rules").RubyHighlightRules;
|
38
|
+
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
39
|
+
var Range = require("../range").Range;
|
40
|
+
var FoldMode = require("./folding/coffee").FoldMode;
|
41
|
+
|
42
|
+
var Mode = function() {
|
43
|
+
this.$tokenizer = new Tokenizer(new RubyHighlightRules().getRules());
|
44
|
+
this.$outdent = new MatchingBraceOutdent();
|
45
|
+
this.foldingRules = new FoldMode();
|
46
|
+
};
|
47
|
+
oop.inherits(Mode, TextMode);
|
48
|
+
|
49
|
+
(function() {
|
50
|
+
|
51
|
+
this.toggleCommentLines = function(state, doc, startRow, endRow) {
|
52
|
+
var outdent = true;
|
53
|
+
var re = /^(\s*)#/;
|
54
|
+
|
55
|
+
for (var i=startRow; i<= endRow; i++) {
|
56
|
+
if (!re.test(doc.getLine(i))) {
|
57
|
+
outdent = false;
|
58
|
+
break;
|
59
|
+
}
|
60
|
+
}
|
61
|
+
|
62
|
+
if (outdent) {
|
63
|
+
var deleteRange = new Range(0, 0, 0, 0);
|
64
|
+
for (var i=startRow; i<= endRow; i++)
|
65
|
+
{
|
66
|
+
var line = doc.getLine(i);
|
67
|
+
var m = line.match(re);
|
68
|
+
deleteRange.start.row = i;
|
69
|
+
deleteRange.end.row = i;
|
70
|
+
deleteRange.end.column = m[0].length;
|
71
|
+
doc.replace(deleteRange, m[1]);
|
72
|
+
}
|
73
|
+
}
|
74
|
+
else {
|
75
|
+
doc.indentRows(startRow, endRow, "#");
|
76
|
+
}
|
77
|
+
};
|
78
|
+
|
79
|
+
this.getNextLineIndent = function(state, line, tab) {
|
80
|
+
var indent = this.$getIndent(line);
|
81
|
+
|
82
|
+
var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
|
83
|
+
var tokens = tokenizedLine.tokens;
|
84
|
+
|
85
|
+
if (tokens.length && tokens[tokens.length-1].type == "comment") {
|
86
|
+
return indent;
|
87
|
+
}
|
88
|
+
|
89
|
+
if (state == "start") {
|
90
|
+
var match = line.match(/^.*[\{\(\[]\s*$/);
|
91
|
+
if (match) {
|
92
|
+
indent += tab;
|
93
|
+
}
|
94
|
+
}
|
95
|
+
|
96
|
+
return indent;
|
97
|
+
};
|
98
|
+
|
99
|
+
this.checkOutdent = function(state, line, input) {
|
100
|
+
return this.$outdent.checkOutdent(line, input);
|
101
|
+
};
|
102
|
+
|
103
|
+
this.autoOutdent = function(state, doc, row) {
|
104
|
+
this.$outdent.autoOutdent(doc, row);
|
105
|
+
};
|
106
|
+
|
107
|
+
}).call(Mode.prototype);
|
108
|
+
|
109
|
+
exports.Mode = Mode;
|
110
|
+
});
|
111
|
+
|
112
|
+
define('ace/mode/ruby_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
|
113
|
+
|
114
|
+
|
115
|
+
var oop = require("../lib/oop");
|
116
|
+
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
117
|
+
var constantOtherSymbol = exports.constantOtherSymbol = {
|
118
|
+
token : "constant.other.symbol.ruby", // symbol
|
119
|
+
regex : "[:](?:[A-Za-z_]|[@$](?=[a-zA-Z0-9_]))[a-zA-Z0-9_]*[!=?]?"
|
120
|
+
};
|
121
|
+
|
122
|
+
var qString = exports.qString = {
|
123
|
+
token : "string", // single line
|
124
|
+
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
|
125
|
+
};
|
126
|
+
|
127
|
+
var qqString = exports.qqString = {
|
128
|
+
token : "string", // single line
|
129
|
+
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
|
130
|
+
};
|
131
|
+
|
132
|
+
var tString = exports.tString = {
|
133
|
+
token : "string", // backtick string
|
134
|
+
regex : "[`](?:(?:\\\\.)|(?:[^'\\\\]))*?[`]"
|
135
|
+
};
|
136
|
+
|
137
|
+
var constantNumericHex = exports.constantNumericHex = {
|
138
|
+
token : "constant.numeric", // hex
|
139
|
+
regex : "0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_(?=[0-9a-fA-F]))*\\b"
|
140
|
+
};
|
141
|
+
|
142
|
+
var constantNumericFloat = exports.constantNumericFloat = {
|
143
|
+
token : "constant.numeric", // float
|
144
|
+
regex : "[+-]?\\d(?:\\d|_(?=\\d))*(?:(?:\\.\\d(?:\\d|_(?=\\d))*)?(?:[eE][+-]?\\d+)?)?\\b"
|
145
|
+
};
|
146
|
+
|
147
|
+
var RubyHighlightRules = function() {
|
148
|
+
|
149
|
+
var builtinFunctions = (
|
150
|
+
"abort|Array|assert|assert_equal|assert_not_equal|assert_same|assert_not_same|" +
|
151
|
+
"assert_nil|assert_not_nil|assert_match|assert_no_match|assert_in_delta|assert_throws|" +
|
152
|
+
"assert_raise|assert_nothing_raised|assert_instance_of|assert_kind_of|assert_respond_to|" +
|
153
|
+
"assert_operator|assert_send|assert_difference|assert_no_difference|assert_recognizes|" +
|
154
|
+
"assert_generates|assert_response|assert_redirected_to|assert_template|assert_select|" +
|
155
|
+
"assert_select_email|assert_select_rjs|assert_select_encoded|css_select|at_exit|" +
|
156
|
+
"attr|attr_writer|attr_reader|attr_accessor|attr_accessible|autoload|binding|block_given?|callcc|" +
|
157
|
+
"caller|catch|chomp|chomp!|chop|chop!|defined?|delete_via_redirect|eval|exec|exit|" +
|
158
|
+
"exit!|fail|Float|flunk|follow_redirect!|fork|form_for|form_tag|format|gets|global_variables|gsub|" +
|
159
|
+
"gsub!|get_via_redirect|h|host!|https?|https!|include|Integer|lambda|link_to|" +
|
160
|
+
"link_to_unless_current|link_to_function|link_to_remote|load|local_variables|loop|open|open_session|" +
|
161
|
+
"p|print|printf|proc|putc|puts|post_via_redirect|put_via_redirect|raise|rand|" +
|
162
|
+
"raw|readline|readlines|redirect?|request_via_redirect|require|scan|select|" +
|
163
|
+
"set_trace_func|sleep|split|sprintf|srand|String|stylesheet_link_tag|syscall|system|sub|sub!|test|" +
|
164
|
+
"throw|trace_var|trap|untrace_var|atan2|cos|exp|frexp|ldexp|log|log10|sin|sqrt|tan|" +
|
165
|
+
"render|javascript_include_tag|csrf_meta_tag|label_tag|text_field_tag|submit_tag|check_box_tag|" +
|
166
|
+
"content_tag|radio_button_tag|text_area_tag|password_field_tag|hidden_field_tag|" +
|
167
|
+
"fields_for|select_tag|options_for_select|options_from_collection_for_select|collection_select|" +
|
168
|
+
"time_zone_select|select_date|select_time|select_datetime|date_select|time_select|datetime_select|" +
|
169
|
+
"select_year|select_month|select_day|select_hour|select_minute|select_second|file_field_tag|" +
|
170
|
+
"file_field|respond_to|skip_before_filter|around_filter|after_filter|verify|" +
|
171
|
+
"protect_from_forgery|rescue_from|helper_method|redirect_to|before_filter|" +
|
172
|
+
"send_data|send_file|validates_presence_of|validates_uniqueness_of|validates_length_of|" +
|
173
|
+
"validates_format_of|validates_acceptance_of|validates_associated|validates_exclusion_of|" +
|
174
|
+
"validates_inclusion_of|validates_numericality_of|validates_with|validates_each|" +
|
175
|
+
"authenticate_or_request_with_http_basic|authenticate_or_request_with_http_digest|" +
|
176
|
+
"filter_parameter_logging|match|get|post|resources|redirect|scope|assert_routing|" +
|
177
|
+
"translate|localize|extract_locale_from_tld|t|l|caches_page|expire_page|caches_action|expire_action|" +
|
178
|
+
"cache|expire_fragment|expire_cache_for|observe|cache_sweeper|" +
|
179
|
+
"has_many|has_one|belongs_to|has_and_belongs_to_many"
|
180
|
+
);
|
181
|
+
|
182
|
+
var keywords = (
|
183
|
+
"alias|and|BEGIN|begin|break|case|class|def|defined|do|else|elsif|END|end|ensure|" +
|
184
|
+
"__FILE__|finally|for|gem|if|in|__LINE__|module|next|not|or|private|protected|public|" +
|
185
|
+
"redo|rescue|retry|return|super|then|undef|unless|until|when|while|yield"
|
186
|
+
);
|
187
|
+
|
188
|
+
var buildinConstants = (
|
189
|
+
"true|TRUE|false|FALSE|nil|NIL|ARGF|ARGV|DATA|ENV|RUBY_PLATFORM|RUBY_RELEASE_DATE|" +
|
190
|
+
"RUBY_VERSION|STDERR|STDIN|STDOUT|TOPLEVEL_BINDING"
|
191
|
+
);
|
192
|
+
|
193
|
+
var builtinVariables = (
|
194
|
+
"\$DEBUG|\$defout|\$FILENAME|\$LOAD_PATH|\$SAFE|\$stdin|\$stdout|\$stderr|\$VERBOSE|" +
|
195
|
+
"$!|root_url|flash|session|cookies|params|request|response|logger|self"
|
196
|
+
);
|
197
|
+
|
198
|
+
var keywordMapper = this.$keywords = this.createKeywordMapper({
|
199
|
+
"keyword": keywords,
|
200
|
+
"constant.language": buildinConstants,
|
201
|
+
"variable.language": builtinVariables,
|
202
|
+
"support.function": builtinFunctions,
|
203
|
+
"invalid.deprecated": "debugger" // TODO is this a remnant from js mode?
|
204
|
+
}, "identifier");
|
205
|
+
|
206
|
+
this.$rules = {
|
207
|
+
"start" : [
|
208
|
+
{
|
209
|
+
token : "comment",
|
210
|
+
regex : "#.*$"
|
211
|
+
}, {
|
212
|
+
token : "comment", // multi line comment
|
213
|
+
regex : "^=begin\\s",
|
214
|
+
next : "comment"
|
215
|
+
}, {
|
216
|
+
token : "string.regexp",
|
217
|
+
regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
|
218
|
+
},
|
219
|
+
|
220
|
+
qString,
|
221
|
+
qqString,
|
222
|
+
tString,
|
223
|
+
|
224
|
+
{
|
225
|
+
token : "text", // namespaces aren't symbols
|
226
|
+
regex : "::"
|
227
|
+
}, {
|
228
|
+
token : "variable.instance", // instance variable
|
229
|
+
regex : "@{1,2}[a-zA-Z_\\d]+"
|
230
|
+
}, {
|
231
|
+
token : "support.class", // class name
|
232
|
+
regex : "[A-Z][a-zA-Z_\\d]+"
|
233
|
+
},
|
234
|
+
|
235
|
+
constantOtherSymbol,
|
236
|
+
constantNumericHex,
|
237
|
+
constantNumericFloat,
|
238
|
+
|
239
|
+
{
|
240
|
+
token : "constant.language.boolean",
|
241
|
+
regex : "(?:true|false)\\b"
|
242
|
+
}, {
|
243
|
+
token : keywordMapper,
|
244
|
+
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
|
245
|
+
}, {
|
246
|
+
token : "punctuation.separator.key-value",
|
247
|
+
regex : "=>"
|
248
|
+
}, {
|
249
|
+
token : "keyword.operator",
|
250
|
+
regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
|
251
|
+
}, {
|
252
|
+
token : "paren.lparen",
|
253
|
+
regex : "[[({]"
|
254
|
+
}, {
|
255
|
+
token : "paren.rparen",
|
256
|
+
regex : "[\\])}]"
|
257
|
+
}, {
|
258
|
+
token : "text",
|
259
|
+
regex : "\\s+"
|
260
|
+
}
|
261
|
+
],
|
262
|
+
"comment" : [
|
263
|
+
{
|
264
|
+
token : "comment", // closing comment
|
265
|
+
regex : "^=end\\s.*$",
|
266
|
+
next : "start"
|
267
|
+
}, {
|
268
|
+
token : "comment", // comment spanning whole line
|
269
|
+
regex : ".+"
|
270
|
+
}
|
271
|
+
]
|
272
|
+
};
|
273
|
+
};
|
274
|
+
|
275
|
+
oop.inherits(RubyHighlightRules, TextHighlightRules);
|
276
|
+
|
277
|
+
exports.RubyHighlightRules = RubyHighlightRules;
|
278
|
+
});
|
279
|
+
|
280
|
+
define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
|
281
|
+
|
282
|
+
|
283
|
+
var Range = require("../range").Range;
|
284
|
+
|
285
|
+
var MatchingBraceOutdent = function() {};
|
286
|
+
|
287
|
+
(function() {
|
288
|
+
|
289
|
+
this.checkOutdent = function(line, input) {
|
290
|
+
if (! /^\s+$/.test(line))
|
291
|
+
return false;
|
292
|
+
|
293
|
+
return /^\s*\}/.test(input);
|
294
|
+
};
|
295
|
+
|
296
|
+
this.autoOutdent = function(doc, row) {
|
297
|
+
var line = doc.getLine(row);
|
298
|
+
var match = line.match(/^(\s*\})/);
|
299
|
+
|
300
|
+
if (!match) return 0;
|
301
|
+
|
302
|
+
var column = match[1].length;
|
303
|
+
var openBracePos = doc.findMatchingBracket({row: row, column: column});
|
304
|
+
|
305
|
+
if (!openBracePos || openBracePos.row == row) return 0;
|
306
|
+
|
307
|
+
var indent = this.$getIndent(doc.getLine(openBracePos.row));
|
308
|
+
doc.replace(new Range(row, 0, row, column-1), indent);
|
309
|
+
};
|
310
|
+
|
311
|
+
this.$getIndent = function(line) {
|
312
|
+
var match = line.match(/^(\s+)/);
|
313
|
+
if (match) {
|
314
|
+
return match[1];
|
315
|
+
}
|
316
|
+
|
317
|
+
return "";
|
318
|
+
};
|
319
|
+
|
320
|
+
}).call(MatchingBraceOutdent.prototype);
|
321
|
+
|
322
|
+
exports.MatchingBraceOutdent = MatchingBraceOutdent;
|
323
|
+
});
|
324
|
+
|
325
|
+
define('ace/mode/folding/coffee', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) {
|
326
|
+
|
327
|
+
|
328
|
+
var oop = require("../../lib/oop");
|
329
|
+
var BaseFoldMode = require("./fold_mode").FoldMode;
|
330
|
+
var Range = require("../../range").Range;
|
331
|
+
|
332
|
+
var FoldMode = exports.FoldMode = function() {};
|
333
|
+
oop.inherits(FoldMode, BaseFoldMode);
|
334
|
+
|
335
|
+
(function() {
|
336
|
+
|
337
|
+
this.getFoldWidgetRange = function(session, foldStyle, row) {
|
338
|
+
var range = this.indentationBlock(session, row);
|
339
|
+
if (range)
|
340
|
+
return range;
|
341
|
+
|
342
|
+
var re = /\S/;
|
343
|
+
var line = session.getLine(row);
|
344
|
+
var startLevel = line.search(re);
|
345
|
+
if (startLevel == -1 || line[startLevel] != "#")
|
346
|
+
return;
|
347
|
+
|
348
|
+
var startColumn = line.length;
|
349
|
+
var maxRow = session.getLength();
|
350
|
+
var startRow = row;
|
351
|
+
var endRow = row;
|
352
|
+
|
353
|
+
while (++row < maxRow) {
|
354
|
+
line = session.getLine(row);
|
355
|
+
var level = line.search(re);
|
356
|
+
|
357
|
+
if (level == -1)
|
358
|
+
continue;
|
359
|
+
|
360
|
+
if (line[level] != "#")
|
361
|
+
break;
|
362
|
+
|
363
|
+
endRow = row;
|
364
|
+
}
|
365
|
+
|
366
|
+
if (endRow > startRow) {
|
367
|
+
var endColumn = session.getLine(endRow).length;
|
368
|
+
return new Range(startRow, startColumn, endRow, endColumn);
|
369
|
+
}
|
370
|
+
};
|
371
|
+
this.getFoldWidget = function(session, foldStyle, row) {
|
372
|
+
var line = session.getLine(row);
|
373
|
+
var indent = line.search(/\S/);
|
374
|
+
var next = session.getLine(row + 1);
|
375
|
+
var prev = session.getLine(row - 1);
|
376
|
+
var prevIndent = prev.search(/\S/);
|
377
|
+
var nextIndent = next.search(/\S/);
|
378
|
+
|
379
|
+
if (indent == -1) {
|
380
|
+
session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : "";
|
381
|
+
return "";
|
382
|
+
}
|
383
|
+
if (prevIndent == -1) {
|
384
|
+
if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") {
|
385
|
+
session.foldWidgets[row - 1] = "";
|
386
|
+
session.foldWidgets[row + 1] = "";
|
387
|
+
return "start";
|
388
|
+
}
|
389
|
+
} else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
|
390
|
+
if (session.getLine(row - 2).search(/\S/) == -1) {
|
391
|
+
session.foldWidgets[row - 1] = "start";
|
392
|
+
session.foldWidgets[row + 1] = "";
|
393
|
+
return "";
|
394
|
+
}
|
395
|
+
}
|
396
|
+
|
397
|
+
if (prevIndent!= -1 && prevIndent < indent)
|
398
|
+
session.foldWidgets[row - 1] = "start";
|
399
|
+
else
|
400
|
+
session.foldWidgets[row - 1] = "";
|
401
|
+
|
402
|
+
if (indent < nextIndent)
|
403
|
+
return "start";
|
404
|
+
else
|
405
|
+
return "";
|
406
|
+
};
|
407
|
+
|
408
|
+
}).call(FoldMode.prototype);
|
409
|
+
|
410
|
+
});
|
@@ -0,0 +1,698 @@
|
|
1
|
+
/* ***** BEGIN LICENSE BLOCK *****
|
2
|
+
* Distributed under the BSD license:
|
3
|
+
*
|
4
|
+
* Copyright (c) 2010, Ajax.org B.V.
|
5
|
+
* All rights reserved.
|
6
|
+
*
|
7
|
+
* Redistribution and use in source and binary forms, with or without
|
8
|
+
* modification, are permitted provided that the following conditions are met:
|
9
|
+
* * Redistributions of source code must retain the above copyright
|
10
|
+
* notice, this list of conditions and the following disclaimer.
|
11
|
+
* * Redistributions in binary form must reproduce the above copyright
|
12
|
+
* notice, this list of conditions and the following disclaimer in the
|
13
|
+
* documentation and/or other materials provided with the distribution.
|
14
|
+
* * Neither the name of Ajax.org B.V. nor the
|
15
|
+
* names of its contributors may be used to endorse or promote products
|
16
|
+
* derived from this software without specific prior written permission.
|
17
|
+
*
|
18
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
19
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
21
|
+
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
22
|
+
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
23
|
+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
24
|
+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
25
|
+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
26
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
27
|
+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
28
|
+
*
|
29
|
+
* ***** END LICENSE BLOCK ***** */
|
30
|
+
|
31
|
+
define('ace/mode/scad', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/scad_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) {
|
32
|
+
|
33
|
+
|
34
|
+
var oop = require("../lib/oop");
|
35
|
+
var TextMode = require("./text").Mode;
|
36
|
+
var Tokenizer = require("../tokenizer").Tokenizer;
|
37
|
+
var scadHighlightRules = require("./scad_highlight_rules").scadHighlightRules;
|
38
|
+
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
39
|
+
var Range = require("../range").Range;
|
40
|
+
var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
|
41
|
+
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
42
|
+
|
43
|
+
var Mode = function() {
|
44
|
+
this.$tokenizer = new Tokenizer(new scadHighlightRules().getRules());
|
45
|
+
this.$outdent = new MatchingBraceOutdent();
|
46
|
+
this.$behaviour = new CstyleBehaviour();
|
47
|
+
this.foldingRules = new CStyleFoldMode();
|
48
|
+
};
|
49
|
+
oop.inherits(Mode, TextMode);
|
50
|
+
|
51
|
+
(function() {
|
52
|
+
|
53
|
+
this.toggleCommentLines = function(state, doc, startRow, endRow) {
|
54
|
+
var outdent = true;
|
55
|
+
var re = /^(\s*)\/\//;
|
56
|
+
|
57
|
+
for (var i=startRow; i<= endRow; i++) {
|
58
|
+
if (!re.test(doc.getLine(i))) {
|
59
|
+
outdent = false;
|
60
|
+
break;
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
if (outdent) {
|
65
|
+
var deleteRange = new Range(0, 0, 0, 0);
|
66
|
+
for (var i=startRow; i<= endRow; i++)
|
67
|
+
{
|
68
|
+
var line = doc.getLine(i);
|
69
|
+
var m = line.match(re);
|
70
|
+
deleteRange.start.row = i;
|
71
|
+
deleteRange.end.row = i;
|
72
|
+
deleteRange.end.column = m[0].length;
|
73
|
+
doc.replace(deleteRange, m[1]);
|
74
|
+
}
|
75
|
+
}
|
76
|
+
else {
|
77
|
+
doc.indentRows(startRow, endRow, "//");
|
78
|
+
}
|
79
|
+
};
|
80
|
+
|
81
|
+
this.getNextLineIndent = function(state, line, tab) {
|
82
|
+
var indent = this.$getIndent(line);
|
83
|
+
|
84
|
+
var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
|
85
|
+
var tokens = tokenizedLine.tokens;
|
86
|
+
var endState = tokenizedLine.state;
|
87
|
+
|
88
|
+
if (tokens.length && tokens[tokens.length-1].type == "comment") {
|
89
|
+
return indent;
|
90
|
+
}
|
91
|
+
|
92
|
+
if (state == "start") {
|
93
|
+
var match = line.match(/^.*[\{\(\[]\s*$/);
|
94
|
+
if (match) {
|
95
|
+
indent += tab;
|
96
|
+
}
|
97
|
+
} else if (state == "doc-start") {
|
98
|
+
if (endState == "start") {
|
99
|
+
return "";
|
100
|
+
}
|
101
|
+
var match = line.match(/^\s*(\/?)\*/);
|
102
|
+
if (match) {
|
103
|
+
if (match[1]) {
|
104
|
+
indent += " ";
|
105
|
+
}
|
106
|
+
indent += "* ";
|
107
|
+
}
|
108
|
+
}
|
109
|
+
|
110
|
+
return indent;
|
111
|
+
};
|
112
|
+
|
113
|
+
this.checkOutdent = function(state, line, input) {
|
114
|
+
return this.$outdent.checkOutdent(line, input);
|
115
|
+
};
|
116
|
+
|
117
|
+
this.autoOutdent = function(state, doc, row) {
|
118
|
+
this.$outdent.autoOutdent(doc, row);
|
119
|
+
};
|
120
|
+
|
121
|
+
}).call(Mode.prototype);
|
122
|
+
|
123
|
+
exports.Mode = Mode;
|
124
|
+
});
|
125
|
+
|
126
|
+
define('ace/mode/scad_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
|
127
|
+
|
128
|
+
|
129
|
+
var oop = require("../lib/oop");
|
130
|
+
var lang = require("../lib/lang");
|
131
|
+
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
|
132
|
+
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
133
|
+
|
134
|
+
var scadHighlightRules = function() {
|
135
|
+
var keywordMapper = this.createKeywordMapper({
|
136
|
+
"variable.language": "this",
|
137
|
+
"keyword": "module|if|else|for",
|
138
|
+
"constant.language": "NULL"
|
139
|
+
}, "identifier");
|
140
|
+
|
141
|
+
this.$rules = {
|
142
|
+
"start" : [
|
143
|
+
{
|
144
|
+
token : "comment",
|
145
|
+
regex : "\\/\\/.*$"
|
146
|
+
},
|
147
|
+
DocCommentHighlightRules.getStartRule("start"),
|
148
|
+
{
|
149
|
+
token : "comment", // multi line comment
|
150
|
+
regex : "\\/\\*",
|
151
|
+
next : "comment"
|
152
|
+
}, {
|
153
|
+
token : "string", // single line
|
154
|
+
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
|
155
|
+
}, {
|
156
|
+
token : "string", // multi line string start
|
157
|
+
regex : '["].*\\\\$',
|
158
|
+
next : "qqstring"
|
159
|
+
}, {
|
160
|
+
token : "string", // single line
|
161
|
+
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
|
162
|
+
}, {
|
163
|
+
token : "string", // multi line string start
|
164
|
+
regex : "['].*\\\\$",
|
165
|
+
next : "qstring"
|
166
|
+
}, {
|
167
|
+
token : "constant.numeric", // hex
|
168
|
+
regex : "0[xX][0-9a-fA-F]+\\b"
|
169
|
+
}, {
|
170
|
+
token : "constant.numeric", // float
|
171
|
+
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
|
172
|
+
}, {
|
173
|
+
token : "constant", // <CONSTANT>
|
174
|
+
regex : "<[a-zA-Z0-9.]+>"
|
175
|
+
}, {
|
176
|
+
token : "keyword", // pre-compiler directivs
|
177
|
+
regex : "(?:use|include)"
|
178
|
+
}, {
|
179
|
+
token : keywordMapper,
|
180
|
+
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
|
181
|
+
}, {
|
182
|
+
token : "keyword.operator",
|
183
|
+
regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|new|delete|typeof|void)"
|
184
|
+
}, {
|
185
|
+
token : "paren.lparen",
|
186
|
+
regex : "[[({]"
|
187
|
+
}, {
|
188
|
+
token : "paren.rparen",
|
189
|
+
regex : "[\\])}]"
|
190
|
+
}, {
|
191
|
+
token : "text",
|
192
|
+
regex : "\\s+"
|
193
|
+
}
|
194
|
+
],
|
195
|
+
"comment" : [
|
196
|
+
{
|
197
|
+
token : "comment", // closing comment
|
198
|
+
regex : ".*?\\*\\/",
|
199
|
+
next : "start"
|
200
|
+
}, {
|
201
|
+
token : "comment", // comment spanning whole line
|
202
|
+
regex : ".+"
|
203
|
+
}
|
204
|
+
],
|
205
|
+
"qqstring" : [
|
206
|
+
{
|
207
|
+
token : "string",
|
208
|
+
regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
|
209
|
+
next : "start"
|
210
|
+
}, {
|
211
|
+
token : "string",
|
212
|
+
regex : '.+'
|
213
|
+
}
|
214
|
+
],
|
215
|
+
"qstring" : [
|
216
|
+
{
|
217
|
+
token : "string",
|
218
|
+
regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
|
219
|
+
next : "start"
|
220
|
+
}, {
|
221
|
+
token : "string",
|
222
|
+
regex : '.+'
|
223
|
+
}
|
224
|
+
]
|
225
|
+
};
|
226
|
+
|
227
|
+
this.embedRules(DocCommentHighlightRules, "doc-",
|
228
|
+
[ DocCommentHighlightRules.getEndRule("start") ]);
|
229
|
+
};
|
230
|
+
|
231
|
+
oop.inherits(scadHighlightRules, TextHighlightRules);
|
232
|
+
|
233
|
+
exports.scadHighlightRules = scadHighlightRules;
|
234
|
+
});
|
235
|
+
|
236
|
+
define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
|
237
|
+
|
238
|
+
|
239
|
+
var oop = require("../lib/oop");
|
240
|
+
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
241
|
+
|
242
|
+
var DocCommentHighlightRules = function() {
|
243
|
+
|
244
|
+
this.$rules = {
|
245
|
+
"start" : [ {
|
246
|
+
token : "comment.doc.tag",
|
247
|
+
regex : "@[\\w\\d_]+" // TODO: fix email addresses
|
248
|
+
}, {
|
249
|
+
token : "comment.doc",
|
250
|
+
regex : "\\s+"
|
251
|
+
}, {
|
252
|
+
token : "comment.doc",
|
253
|
+
regex : "TODO"
|
254
|
+
}, {
|
255
|
+
token : "comment.doc",
|
256
|
+
regex : "[^@\\*]+"
|
257
|
+
}, {
|
258
|
+
token : "comment.doc",
|
259
|
+
regex : "."
|
260
|
+
}]
|
261
|
+
};
|
262
|
+
};
|
263
|
+
|
264
|
+
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
|
265
|
+
|
266
|
+
DocCommentHighlightRules.getStartRule = function(start) {
|
267
|
+
return {
|
268
|
+
token : "comment.doc", // doc comment
|
269
|
+
regex : "\\/\\*(?=\\*)",
|
270
|
+
next : start
|
271
|
+
};
|
272
|
+
};
|
273
|
+
|
274
|
+
DocCommentHighlightRules.getEndRule = function (start) {
|
275
|
+
return {
|
276
|
+
token : "comment.doc", // closing comment
|
277
|
+
regex : "\\*\\/",
|
278
|
+
next : start
|
279
|
+
};
|
280
|
+
};
|
281
|
+
|
282
|
+
|
283
|
+
exports.DocCommentHighlightRules = DocCommentHighlightRules;
|
284
|
+
|
285
|
+
});
|
286
|
+
|
287
|
+
define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
|
288
|
+
|
289
|
+
|
290
|
+
var Range = require("../range").Range;
|
291
|
+
|
292
|
+
var MatchingBraceOutdent = function() {};
|
293
|
+
|
294
|
+
(function() {
|
295
|
+
|
296
|
+
this.checkOutdent = function(line, input) {
|
297
|
+
if (! /^\s+$/.test(line))
|
298
|
+
return false;
|
299
|
+
|
300
|
+
return /^\s*\}/.test(input);
|
301
|
+
};
|
302
|
+
|
303
|
+
this.autoOutdent = function(doc, row) {
|
304
|
+
var line = doc.getLine(row);
|
305
|
+
var match = line.match(/^(\s*\})/);
|
306
|
+
|
307
|
+
if (!match) return 0;
|
308
|
+
|
309
|
+
var column = match[1].length;
|
310
|
+
var openBracePos = doc.findMatchingBracket({row: row, column: column});
|
311
|
+
|
312
|
+
if (!openBracePos || openBracePos.row == row) return 0;
|
313
|
+
|
314
|
+
var indent = this.$getIndent(doc.getLine(openBracePos.row));
|
315
|
+
doc.replace(new Range(row, 0, row, column-1), indent);
|
316
|
+
};
|
317
|
+
|
318
|
+
this.$getIndent = function(line) {
|
319
|
+
var match = line.match(/^(\s+)/);
|
320
|
+
if (match) {
|
321
|
+
return match[1];
|
322
|
+
}
|
323
|
+
|
324
|
+
return "";
|
325
|
+
};
|
326
|
+
|
327
|
+
}).call(MatchingBraceOutdent.prototype);
|
328
|
+
|
329
|
+
exports.MatchingBraceOutdent = MatchingBraceOutdent;
|
330
|
+
});
|
331
|
+
|
332
|
+
define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) {
|
333
|
+
|
334
|
+
|
335
|
+
var oop = require("../../lib/oop");
|
336
|
+
var Behaviour = require("../behaviour").Behaviour;
|
337
|
+
var TokenIterator = require("../../token_iterator").TokenIterator;
|
338
|
+
var lang = require("../../lib/lang");
|
339
|
+
|
340
|
+
var SAFE_INSERT_IN_TOKENS =
|
341
|
+
["text", "paren.rparen", "punctuation.operator"];
|
342
|
+
var SAFE_INSERT_BEFORE_TOKENS =
|
343
|
+
["text", "paren.rparen", "punctuation.operator", "comment"];
|
344
|
+
|
345
|
+
|
346
|
+
var autoInsertedBrackets = 0;
|
347
|
+
var autoInsertedRow = -1;
|
348
|
+
var autoInsertedLineEnd = "";
|
349
|
+
var maybeInsertedBrackets = 0;
|
350
|
+
var maybeInsertedRow = -1;
|
351
|
+
var maybeInsertedLineStart = "";
|
352
|
+
var maybeInsertedLineEnd = "";
|
353
|
+
|
354
|
+
var CstyleBehaviour = function () {
|
355
|
+
|
356
|
+
CstyleBehaviour.isSaneInsertion = function(editor, session) {
|
357
|
+
var cursor = editor.getCursorPosition();
|
358
|
+
var iterator = new TokenIterator(session, cursor.row, cursor.column);
|
359
|
+
if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
|
360
|
+
var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
|
361
|
+
if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
|
362
|
+
return false;
|
363
|
+
}
|
364
|
+
iterator.stepForward();
|
365
|
+
return iterator.getCurrentTokenRow() !== cursor.row ||
|
366
|
+
this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
|
367
|
+
};
|
368
|
+
|
369
|
+
CstyleBehaviour.$matchTokenType = function(token, types) {
|
370
|
+
return types.indexOf(token.type || token) > -1;
|
371
|
+
};
|
372
|
+
|
373
|
+
CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
|
374
|
+
var cursor = editor.getCursorPosition();
|
375
|
+
var line = session.doc.getLine(cursor.row);
|
376
|
+
if (!this.isAutoInsertedClosing(cursor, line, autoInsertedLineEnd[0]))
|
377
|
+
autoInsertedBrackets = 0;
|
378
|
+
autoInsertedRow = cursor.row;
|
379
|
+
autoInsertedLineEnd = bracket + line.substr(cursor.column);
|
380
|
+
autoInsertedBrackets++;
|
381
|
+
};
|
382
|
+
|
383
|
+
CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
|
384
|
+
var cursor = editor.getCursorPosition();
|
385
|
+
var line = session.doc.getLine(cursor.row);
|
386
|
+
if (!this.isMaybeInsertedClosing(cursor, line))
|
387
|
+
maybeInsertedBrackets = 0;
|
388
|
+
maybeInsertedRow = cursor.row;
|
389
|
+
maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
|
390
|
+
maybeInsertedLineEnd = line.substr(cursor.column);
|
391
|
+
maybeInsertedBrackets++;
|
392
|
+
};
|
393
|
+
|
394
|
+
CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
|
395
|
+
return autoInsertedBrackets > 0 &&
|
396
|
+
cursor.row === autoInsertedRow &&
|
397
|
+
bracket === autoInsertedLineEnd[0] &&
|
398
|
+
line.substr(cursor.column) === autoInsertedLineEnd;
|
399
|
+
};
|
400
|
+
|
401
|
+
CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
|
402
|
+
return maybeInsertedBrackets > 0 &&
|
403
|
+
cursor.row === maybeInsertedRow &&
|
404
|
+
line.substr(cursor.column) === maybeInsertedLineEnd &&
|
405
|
+
line.substr(0, cursor.column) == maybeInsertedLineStart;
|
406
|
+
};
|
407
|
+
|
408
|
+
CstyleBehaviour.popAutoInsertedClosing = function() {
|
409
|
+
autoInsertedLineEnd = autoInsertedLineEnd.substr(1);
|
410
|
+
autoInsertedBrackets--;
|
411
|
+
};
|
412
|
+
|
413
|
+
CstyleBehaviour.clearMaybeInsertedClosing = function() {
|
414
|
+
maybeInsertedBrackets = 0;
|
415
|
+
maybeInsertedRow = -1;
|
416
|
+
};
|
417
|
+
|
418
|
+
this.add("braces", "insertion", function (state, action, editor, session, text) {
|
419
|
+
var cursor = editor.getCursorPosition();
|
420
|
+
var line = session.doc.getLine(cursor.row);
|
421
|
+
if (text == '{') {
|
422
|
+
var selection = editor.getSelectionRange();
|
423
|
+
var selected = session.doc.getTextRange(selection);
|
424
|
+
if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
|
425
|
+
return {
|
426
|
+
text: '{' + selected + '}',
|
427
|
+
selection: false
|
428
|
+
};
|
429
|
+
} else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
|
430
|
+
if (/[\]\}\)]/.test(line[cursor.column])) {
|
431
|
+
CstyleBehaviour.recordAutoInsert(editor, session, "}");
|
432
|
+
return {
|
433
|
+
text: '{}',
|
434
|
+
selection: [1, 1]
|
435
|
+
};
|
436
|
+
} else {
|
437
|
+
CstyleBehaviour.recordMaybeInsert(editor, session, "{");
|
438
|
+
return {
|
439
|
+
text: '{',
|
440
|
+
selection: [1, 1]
|
441
|
+
};
|
442
|
+
}
|
443
|
+
}
|
444
|
+
} else if (text == '}') {
|
445
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
446
|
+
if (rightChar == '}') {
|
447
|
+
var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
|
448
|
+
if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
|
449
|
+
CstyleBehaviour.popAutoInsertedClosing();
|
450
|
+
return {
|
451
|
+
text: '',
|
452
|
+
selection: [1, 1]
|
453
|
+
};
|
454
|
+
}
|
455
|
+
}
|
456
|
+
} else if (text == "\n" || text == "\r\n") {
|
457
|
+
var closing = "";
|
458
|
+
if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {
|
459
|
+
closing = lang.stringRepeat("}", maybeInsertedBrackets);
|
460
|
+
CstyleBehaviour.clearMaybeInsertedClosing();
|
461
|
+
}
|
462
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
463
|
+
if (rightChar == '}' || closing !== "") {
|
464
|
+
var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column}, '}');
|
465
|
+
if (!openBracePos)
|
466
|
+
return null;
|
467
|
+
|
468
|
+
var indent = this.getNextLineIndent(state, line.substring(0, cursor.column), session.getTabString());
|
469
|
+
var next_indent = this.$getIndent(line);
|
470
|
+
|
471
|
+
return {
|
472
|
+
text: '\n' + indent + '\n' + next_indent + closing,
|
473
|
+
selection: [1, indent.length, 1, indent.length]
|
474
|
+
};
|
475
|
+
}
|
476
|
+
}
|
477
|
+
});
|
478
|
+
|
479
|
+
this.add("braces", "deletion", function (state, action, editor, session, range) {
|
480
|
+
var selected = session.doc.getTextRange(range);
|
481
|
+
if (!range.isMultiLine() && selected == '{') {
|
482
|
+
var line = session.doc.getLine(range.start.row);
|
483
|
+
var rightChar = line.substring(range.end.column, range.end.column + 1);
|
484
|
+
if (rightChar == '}') {
|
485
|
+
range.end.column++;
|
486
|
+
return range;
|
487
|
+
} else {
|
488
|
+
maybeInsertedBrackets--;
|
489
|
+
}
|
490
|
+
}
|
491
|
+
});
|
492
|
+
|
493
|
+
this.add("parens", "insertion", function (state, action, editor, session, text) {
|
494
|
+
if (text == '(') {
|
495
|
+
var selection = editor.getSelectionRange();
|
496
|
+
var selected = session.doc.getTextRange(selection);
|
497
|
+
if (selected !== "" && editor.getWrapBehavioursEnabled()) {
|
498
|
+
return {
|
499
|
+
text: '(' + selected + ')',
|
500
|
+
selection: false
|
501
|
+
};
|
502
|
+
} else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
|
503
|
+
CstyleBehaviour.recordAutoInsert(editor, session, ")");
|
504
|
+
return {
|
505
|
+
text: '()',
|
506
|
+
selection: [1, 1]
|
507
|
+
};
|
508
|
+
}
|
509
|
+
} else if (text == ')') {
|
510
|
+
var cursor = editor.getCursorPosition();
|
511
|
+
var line = session.doc.getLine(cursor.row);
|
512
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
513
|
+
if (rightChar == ')') {
|
514
|
+
var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
|
515
|
+
if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
|
516
|
+
CstyleBehaviour.popAutoInsertedClosing();
|
517
|
+
return {
|
518
|
+
text: '',
|
519
|
+
selection: [1, 1]
|
520
|
+
};
|
521
|
+
}
|
522
|
+
}
|
523
|
+
}
|
524
|
+
});
|
525
|
+
|
526
|
+
this.add("parens", "deletion", function (state, action, editor, session, range) {
|
527
|
+
var selected = session.doc.getTextRange(range);
|
528
|
+
if (!range.isMultiLine() && selected == '(') {
|
529
|
+
var line = session.doc.getLine(range.start.row);
|
530
|
+
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
|
531
|
+
if (rightChar == ')') {
|
532
|
+
range.end.column++;
|
533
|
+
return range;
|
534
|
+
}
|
535
|
+
}
|
536
|
+
});
|
537
|
+
|
538
|
+
this.add("brackets", "insertion", function (state, action, editor, session, text) {
|
539
|
+
if (text == '[') {
|
540
|
+
var selection = editor.getSelectionRange();
|
541
|
+
var selected = session.doc.getTextRange(selection);
|
542
|
+
if (selected !== "" && editor.getWrapBehavioursEnabled()) {
|
543
|
+
return {
|
544
|
+
text: '[' + selected + ']',
|
545
|
+
selection: false
|
546
|
+
};
|
547
|
+
} else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
|
548
|
+
CstyleBehaviour.recordAutoInsert(editor, session, "]");
|
549
|
+
return {
|
550
|
+
text: '[]',
|
551
|
+
selection: [1, 1]
|
552
|
+
};
|
553
|
+
}
|
554
|
+
} else if (text == ']') {
|
555
|
+
var cursor = editor.getCursorPosition();
|
556
|
+
var line = session.doc.getLine(cursor.row);
|
557
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
558
|
+
if (rightChar == ']') {
|
559
|
+
var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row});
|
560
|
+
if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
|
561
|
+
CstyleBehaviour.popAutoInsertedClosing();
|
562
|
+
return {
|
563
|
+
text: '',
|
564
|
+
selection: [1, 1]
|
565
|
+
};
|
566
|
+
}
|
567
|
+
}
|
568
|
+
}
|
569
|
+
});
|
570
|
+
|
571
|
+
this.add("brackets", "deletion", function (state, action, editor, session, range) {
|
572
|
+
var selected = session.doc.getTextRange(range);
|
573
|
+
if (!range.isMultiLine() && selected == '[') {
|
574
|
+
var line = session.doc.getLine(range.start.row);
|
575
|
+
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
|
576
|
+
if (rightChar == ']') {
|
577
|
+
range.end.column++;
|
578
|
+
return range;
|
579
|
+
}
|
580
|
+
}
|
581
|
+
});
|
582
|
+
|
583
|
+
this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
|
584
|
+
if (text == '"' || text == "'") {
|
585
|
+
var quote = text;
|
586
|
+
var selection = editor.getSelectionRange();
|
587
|
+
var selected = session.doc.getTextRange(selection);
|
588
|
+
if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
|
589
|
+
return {
|
590
|
+
text: quote + selected + quote,
|
591
|
+
selection: false
|
592
|
+
};
|
593
|
+
} else {
|
594
|
+
var cursor = editor.getCursorPosition();
|
595
|
+
var line = session.doc.getLine(cursor.row);
|
596
|
+
var leftChar = line.substring(cursor.column-1, cursor.column);
|
597
|
+
if (leftChar == '\\') {
|
598
|
+
return null;
|
599
|
+
}
|
600
|
+
var tokens = session.getTokens(selection.start.row);
|
601
|
+
var col = 0, token;
|
602
|
+
var quotepos = -1; // Track whether we're inside an open quote.
|
603
|
+
|
604
|
+
for (var x = 0; x < tokens.length; x++) {
|
605
|
+
token = tokens[x];
|
606
|
+
if (token.type == "string") {
|
607
|
+
quotepos = -1;
|
608
|
+
} else if (quotepos < 0) {
|
609
|
+
quotepos = token.value.indexOf(quote);
|
610
|
+
}
|
611
|
+
if ((token.value.length + col) > selection.start.column) {
|
612
|
+
break;
|
613
|
+
}
|
614
|
+
col += tokens[x].value.length;
|
615
|
+
}
|
616
|
+
if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) {
|
617
|
+
if (!CstyleBehaviour.isSaneInsertion(editor, session))
|
618
|
+
return;
|
619
|
+
return {
|
620
|
+
text: quote + quote,
|
621
|
+
selection: [1,1]
|
622
|
+
};
|
623
|
+
} else if (token && token.type === "string") {
|
624
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
625
|
+
if (rightChar == quote) {
|
626
|
+
return {
|
627
|
+
text: '',
|
628
|
+
selection: [1, 1]
|
629
|
+
};
|
630
|
+
}
|
631
|
+
}
|
632
|
+
}
|
633
|
+
}
|
634
|
+
});
|
635
|
+
|
636
|
+
this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
|
637
|
+
var selected = session.doc.getTextRange(range);
|
638
|
+
if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
|
639
|
+
var line = session.doc.getLine(range.start.row);
|
640
|
+
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
|
641
|
+
if (rightChar == '"') {
|
642
|
+
range.end.column++;
|
643
|
+
return range;
|
644
|
+
}
|
645
|
+
}
|
646
|
+
});
|
647
|
+
|
648
|
+
};
|
649
|
+
|
650
|
+
oop.inherits(CstyleBehaviour, Behaviour);
|
651
|
+
|
652
|
+
exports.CstyleBehaviour = CstyleBehaviour;
|
653
|
+
});
|
654
|
+
|
655
|
+
define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
|
656
|
+
|
657
|
+
|
658
|
+
var oop = require("../../lib/oop");
|
659
|
+
var Range = require("../../range").Range;
|
660
|
+
var BaseFoldMode = require("./fold_mode").FoldMode;
|
661
|
+
|
662
|
+
var FoldMode = exports.FoldMode = function() {};
|
663
|
+
oop.inherits(FoldMode, BaseFoldMode);
|
664
|
+
|
665
|
+
(function() {
|
666
|
+
|
667
|
+
this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
|
668
|
+
this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
|
669
|
+
|
670
|
+
this.getFoldWidgetRange = function(session, foldStyle, row) {
|
671
|
+
var line = session.getLine(row);
|
672
|
+
var match = line.match(this.foldingStartMarker);
|
673
|
+
if (match) {
|
674
|
+
var i = match.index;
|
675
|
+
|
676
|
+
if (match[1])
|
677
|
+
return this.openingBracketBlock(session, match[1], row, i);
|
678
|
+
|
679
|
+
return session.getCommentFoldRange(row, i + match[0].length, 1);
|
680
|
+
}
|
681
|
+
|
682
|
+
if (foldStyle !== "markbeginend")
|
683
|
+
return;
|
684
|
+
|
685
|
+
var match = line.match(this.foldingStopMarker);
|
686
|
+
if (match) {
|
687
|
+
var i = match.index + match[0].length;
|
688
|
+
|
689
|
+
if (match[1])
|
690
|
+
return this.closingBracketBlock(session, match[1], row, i);
|
691
|
+
|
692
|
+
return session.getCommentFoldRange(row, i, -1);
|
693
|
+
}
|
694
|
+
};
|
695
|
+
|
696
|
+
}).call(FoldMode.prototype);
|
697
|
+
|
698
|
+
});
|