ace-rails-ap 0.0.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ace/rails/version.rb +1 -1
- data/vendor/assets/javascripts/ace.js +15680 -1
- data/vendor/assets/javascripts/keybinding-emacs.js +367 -1
- data/vendor/assets/javascripts/keybinding-vim.js +1635 -1
- data/vendor/assets/javascripts/mode-c9search.js +275 -0
- data/vendor/assets/javascripts/mode-c_cpp.js +744 -1
- data/vendor/assets/javascripts/mode-clojure.js +364 -1
- data/vendor/assets/javascripts/mode-coffee.js +527 -1
- data/vendor/assets/javascripts/mode-coldfusion.js +1966 -1
- data/vendor/assets/javascripts/mode-csharp.js +633 -1
- data/vendor/assets/javascripts/mode-css.js +499 -1
- data/vendor/assets/javascripts/mode-diff.js +250 -0
- data/vendor/assets/javascripts/{mode-c_cpp-uncompressed.js → mode-glsl.js} +147 -244
- data/vendor/assets/javascripts/mode-golang.js +681 -1
- data/vendor/assets/javascripts/mode-groovy.js +1240 -1
- data/vendor/assets/javascripts/mode-haxe.js +633 -1
- data/vendor/assets/javascripts/mode-html.js +2064 -1
- data/vendor/assets/javascripts/mode-java.js +1202 -1
- data/vendor/assets/javascripts/mode-javascript.js +1069 -1
- data/vendor/assets/javascripts/mode-json.js +588 -1
- data/vendor/assets/javascripts/{mode-haxe-uncompressed.js → mode-jsx.js} +189 -312
- data/vendor/assets/javascripts/mode-latex.js +95 -1
- data/vendor/assets/javascripts/mode-less.js +512 -1
- data/vendor/assets/javascripts/mode-liquid.js +1125 -1
- data/vendor/assets/javascripts/mode-lua.js +551 -1
- data/vendor/assets/javascripts/{mode-html-uncompressed.js → mode-luahtml.js} +544 -604
- data/vendor/assets/javascripts/{mode-coldfusion-uncompressed.js → mode-luapage.js} +2326 -2180
- data/vendor/assets/javascripts/mode-markdown.js +2369 -1
- data/vendor/assets/javascripts/mode-ocaml.js +464 -1
- data/vendor/assets/javascripts/mode-perl.js +432 -1
- data/vendor/assets/javascripts/mode-pgsql.js +970 -1
- data/vendor/assets/javascripts/mode-php.js +1718 -1
- data/vendor/assets/javascripts/mode-powershell.js +610 -1
- data/vendor/assets/javascripts/mode-python.js +397 -1
- data/vendor/assets/javascripts/mode-ruby.js +318 -1
- data/vendor/assets/javascripts/mode-scad.js +732 -1
- data/vendor/assets/javascripts/mode-scala.js +1237 -1
- data/vendor/assets/javascripts/mode-scss.js +537 -1
- data/vendor/assets/javascripts/mode-sh.js +250 -1
- data/vendor/assets/javascripts/mode-sql.js +140 -1
- data/vendor/assets/javascripts/mode-svg.js +1681 -1
- data/vendor/assets/javascripts/mode-tcl.js +320 -0
- data/vendor/assets/javascripts/mode-textile.js +182 -1
- data/vendor/assets/javascripts/mode-xml.js +829 -1
- data/vendor/assets/javascripts/mode-xquery.js +605 -1
- data/vendor/assets/javascripts/mode-yaml.js +189 -0
- data/vendor/assets/javascripts/theme-chrome.js +213 -1
- data/vendor/assets/javascripts/theme-clouds.js +167 -1
- data/vendor/assets/javascripts/theme-clouds_midnight.js +168 -1
- data/vendor/assets/javascripts/theme-cobalt.js +194 -1
- data/vendor/assets/javascripts/theme-crimson_editor.js +200 -1
- data/vendor/assets/javascripts/theme-dawn.js +198 -1
- data/vendor/assets/javascripts/theme-dreamweaver.js +230 -1
- data/vendor/assets/javascripts/theme-eclipse.js +157 -1
- data/vendor/assets/javascripts/theme-github.js +182 -0
- data/vendor/assets/javascripts/theme-idle_fingers.js +186 -1
- data/vendor/assets/javascripts/theme-kr_theme.js +189 -1
- data/vendor/assets/javascripts/theme-merbivore.js +189 -1
- data/vendor/assets/javascripts/theme-merbivore_soft.js +195 -1
- data/vendor/assets/javascripts/theme-mono_industrial.js +197 -1
- data/vendor/assets/javascripts/theme-monokai.js +194 -1
- data/vendor/assets/javascripts/theme-pastel_on_dark.js +199 -1
- data/vendor/assets/javascripts/theme-solarized_dark.js +180 -1
- data/vendor/assets/javascripts/theme-solarized_light.js +179 -1
- data/vendor/assets/javascripts/theme-textmate.js +216 -0
- data/vendor/assets/javascripts/theme-tomorrow.js +213 -1
- data/vendor/assets/javascripts/theme-tomorrow_night.js +213 -1
- data/vendor/assets/javascripts/theme-tomorrow_night_blue.js +213 -1
- data/vendor/assets/javascripts/theme-tomorrow_night_bright.js +213 -1
- data/vendor/assets/javascripts/theme-tomorrow_night_eighties.js +209 -1
- data/vendor/assets/javascripts/theme-twilight.js +211 -1
- data/vendor/assets/javascripts/theme-vibrant_ink.js +190 -1
- data/vendor/assets/javascripts/worker-coffee.js +83 -893
- data/vendor/assets/javascripts/worker-css.js +88 -1402
- data/vendor/assets/javascripts/worker-javascript.js +97 -812
- data/vendor/assets/javascripts/worker-json.js +84 -761
- data/vendor/assets/javascripts/worker-xquery.js +66464 -0
- metadata +12 -195
- data/vendor/assets/javascripts/ace-compat-noconflict.js +0 -1
- data/vendor/assets/javascripts/ace-compat-uncompressed-noconflict.js +0 -480
- data/vendor/assets/javascripts/ace-compat-uncompressed.js +0 -480
- data/vendor/assets/javascripts/ace-compat.js +0 -1
- data/vendor/assets/javascripts/ace-noconflict.js +0 -10
- data/vendor/assets/javascripts/ace-uncompressed-noconflict.js +0 -19976
- data/vendor/assets/javascripts/ace-uncompressed.js +0 -19976
- data/vendor/assets/javascripts/keybinding-emacs-noconflict.js +0 -1
- data/vendor/assets/javascripts/keybinding-emacs-uncompressed-noconflict.js +0 -150
- data/vendor/assets/javascripts/keybinding-emacs-uncompressed.js +0 -150
- data/vendor/assets/javascripts/keybinding-vim-noconflict.js +0 -1
- data/vendor/assets/javascripts/keybinding-vim-uncompressed-noconflict.js +0 -138
- data/vendor/assets/javascripts/keybinding-vim-uncompressed.js +0 -138
- data/vendor/assets/javascripts/mode-c_cpp-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-c_cpp-uncompressed-noconflict.js +0 -919
- data/vendor/assets/javascripts/mode-clojure-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-clojure-uncompressed-noconflict.js +0 -422
- data/vendor/assets/javascripts/mode-clojure-uncompressed.js +0 -422
- data/vendor/assets/javascripts/mode-coffee-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-coffee-uncompressed-noconflict.js +0 -607
- data/vendor/assets/javascripts/mode-coffee-uncompressed.js +0 -607
- data/vendor/assets/javascripts/mode-coldfusion-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-coldfusion-uncompressed-noconflict.js +0 -2458
- data/vendor/assets/javascripts/mode-csharp-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-csharp-uncompressed-noconflict.js +0 -769
- data/vendor/assets/javascripts/mode-csharp-uncompressed.js +0 -769
- data/vendor/assets/javascripts/mode-css-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-css-uncompressed-noconflict.js +0 -641
- data/vendor/assets/javascripts/mode-css-uncompressed.js +0 -641
- data/vendor/assets/javascripts/mode-golang-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-golang-uncompressed-noconflict.js +0 -378
- data/vendor/assets/javascripts/mode-golang-uncompressed.js +0 -378
- data/vendor/assets/javascripts/mode-groovy-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-groovy-uncompressed-noconflict.js +0 -1393
- data/vendor/assets/javascripts/mode-groovy-uncompressed.js +0 -1393
- data/vendor/assets/javascripts/mode-haxe-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-haxe-uncompressed-noconflict.js +0 -769
- data/vendor/assets/javascripts/mode-html-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-html-uncompressed-noconflict.js +0 -2475
- data/vendor/assets/javascripts/mode-java-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-java-uncompressed-noconflict.js +0 -1395
- data/vendor/assets/javascripts/mode-java-uncompressed.js +0 -1395
- data/vendor/assets/javascripts/mode-javascript-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-javascript-uncompressed-noconflict.js +0 -1226
- data/vendor/assets/javascripts/mode-javascript-uncompressed.js +0 -1226
- data/vendor/assets/javascripts/mode-json-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-json-uncompressed-noconflict.js +0 -701
- data/vendor/assets/javascripts/mode-json-uncompressed.js +0 -701
- data/vendor/assets/javascripts/mode-latex-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-latex-uncompressed-noconflict.js +0 -95
- data/vendor/assets/javascripts/mode-latex-uncompressed.js +0 -95
- data/vendor/assets/javascripts/mode-less-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-less-uncompressed-noconflict.js +0 -655
- data/vendor/assets/javascripts/mode-less-uncompressed.js +0 -655
- data/vendor/assets/javascripts/mode-liquid-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-liquid-uncompressed-noconflict.js +0 -1353
- data/vendor/assets/javascripts/mode-liquid-uncompressed.js +0 -1353
- data/vendor/assets/javascripts/mode-lua-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-lua-uncompressed-noconflict.js +0 -523
- data/vendor/assets/javascripts/mode-lua-uncompressed.js +0 -523
- data/vendor/assets/javascripts/mode-markdown-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-markdown-uncompressed-noconflict.js +0 -2925
- data/vendor/assets/javascripts/mode-markdown-uncompressed.js +0 -2925
- data/vendor/assets/javascripts/mode-ocaml-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-ocaml-uncompressed-noconflict.js +0 -539
- data/vendor/assets/javascripts/mode-ocaml-uncompressed.js +0 -539
- data/vendor/assets/javascripts/mode-perl-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-perl-uncompressed-noconflict.js +0 -574
- data/vendor/assets/javascripts/mode-perl-uncompressed.js +0 -574
- data/vendor/assets/javascripts/mode-pgsql-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-pgsql-uncompressed-noconflict.js +0 -1104
- data/vendor/assets/javascripts/mode-pgsql-uncompressed.js +0 -1104
- data/vendor/assets/javascripts/mode-php-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-php-uncompressed-noconflict.js +0 -1885
- data/vendor/assets/javascripts/mode-php-uncompressed.js +0 -1885
- data/vendor/assets/javascripts/mode-powershell-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-powershell-uncompressed-noconflict.js +0 -710
- data/vendor/assets/javascripts/mode-powershell-uncompressed.js +0 -710
- data/vendor/assets/javascripts/mode-python-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-python-uncompressed-noconflict.js +0 -507
- data/vendor/assets/javascripts/mode-python-uncompressed.js +0 -507
- data/vendor/assets/javascripts/mode-ruby-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-ruby-uncompressed-noconflict.js +0 -391
- data/vendor/assets/javascripts/mode-ruby-uncompressed.js +0 -391
- data/vendor/assets/javascripts/mode-scad-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-scad-uncompressed-noconflict.js +0 -907
- data/vendor/assets/javascripts/mode-scad-uncompressed.js +0 -907
- data/vendor/assets/javascripts/mode-scala-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-scala-uncompressed-noconflict.js +0 -1395
- data/vendor/assets/javascripts/mode-scala-uncompressed.js +0 -1395
- data/vendor/assets/javascripts/mode-scss-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-scss-uncompressed-noconflict.js +0 -679
- data/vendor/assets/javascripts/mode-scss-uncompressed.js +0 -679
- data/vendor/assets/javascripts/mode-sh-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-sh-uncompressed-noconflict.js +0 -289
- data/vendor/assets/javascripts/mode-sh-uncompressed.js +0 -289
- data/vendor/assets/javascripts/mode-sql-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-sql-uncompressed-noconflict.js +0 -159
- data/vendor/assets/javascripts/mode-sql-uncompressed.js +0 -159
- data/vendor/assets/javascripts/mode-svg-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-svg-uncompressed-noconflict.js +0 -2137
- data/vendor/assets/javascripts/mode-svg-uncompressed.js +0 -2137
- data/vendor/assets/javascripts/mode-text-noconflict.js +0 -0
- data/vendor/assets/javascripts/mode-text-uncompressed-noconflict.js +0 -0
- data/vendor/assets/javascripts/mode-text-uncompressed.js +0 -0
- data/vendor/assets/javascripts/mode-textile-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-textile-uncompressed-noconflict.js +0 -254
- data/vendor/assets/javascripts/mode-textile-uncompressed.js +0 -254
- data/vendor/assets/javascripts/mode-xml-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-xml-uncompressed-noconflict.js +0 -1012
- data/vendor/assets/javascripts/mode-xml-uncompressed.js +0 -1012
- data/vendor/assets/javascripts/mode-xquery-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-xquery-uncompressed-noconflict.js +0 -540
- data/vendor/assets/javascripts/mode-xquery-uncompressed.js +0 -540
- data/vendor/assets/javascripts/theme-chrome-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-chrome-uncompressed-noconflict.js +0 -207
- data/vendor/assets/javascripts/theme-chrome-uncompressed.js +0 -207
- data/vendor/assets/javascripts/theme-clouds-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-clouds-uncompressed-noconflict.js +0 -160
- data/vendor/assets/javascripts/theme-clouds-uncompressed.js +0 -160
- data/vendor/assets/javascripts/theme-clouds_midnight-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-clouds_midnight-uncompressed-noconflict.js +0 -161
- data/vendor/assets/javascripts/theme-clouds_midnight-uncompressed.js +0 -161
- data/vendor/assets/javascripts/theme-cobalt-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-cobalt-uncompressed-noconflict.js +0 -187
- data/vendor/assets/javascripts/theme-cobalt-uncompressed.js +0 -187
- data/vendor/assets/javascripts/theme-crimson_editor-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-crimson_editor-uncompressed-noconflict.js +0 -198
- data/vendor/assets/javascripts/theme-crimson_editor-uncompressed.js +0 -198
- data/vendor/assets/javascripts/theme-dawn-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-dawn-uncompressed-noconflict.js +0 -191
- data/vendor/assets/javascripts/theme-dawn-uncompressed.js +0 -191
- data/vendor/assets/javascripts/theme-dreamweaver-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-dreamweaver-uncompressed-noconflict.js +0 -227
- data/vendor/assets/javascripts/theme-dreamweaver-uncompressed.js +0 -227
- data/vendor/assets/javascripts/theme-eclipse-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-eclipse-uncompressed-noconflict.js +0 -147
- data/vendor/assets/javascripts/theme-eclipse-uncompressed.js +0 -147
- data/vendor/assets/javascripts/theme-idle_fingers-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-idle_fingers-uncompressed-noconflict.js +0 -179
- data/vendor/assets/javascripts/theme-idle_fingers-uncompressed.js +0 -179
- data/vendor/assets/javascripts/theme-kr_theme-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-kr_theme-uncompressed-noconflict.js +0 -182
- data/vendor/assets/javascripts/theme-kr_theme-uncompressed.js +0 -182
- data/vendor/assets/javascripts/theme-merbivore-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-merbivore-uncompressed-noconflict.js +0 -182
- data/vendor/assets/javascripts/theme-merbivore-uncompressed.js +0 -182
- data/vendor/assets/javascripts/theme-merbivore_soft-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-merbivore_soft-uncompressed-noconflict.js +0 -188
- data/vendor/assets/javascripts/theme-merbivore_soft-uncompressed.js +0 -188
- data/vendor/assets/javascripts/theme-mono_industrial-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-mono_industrial-uncompressed-noconflict.js +0 -190
- data/vendor/assets/javascripts/theme-mono_industrial-uncompressed.js +0 -190
- data/vendor/assets/javascripts/theme-monokai-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-monokai-uncompressed-noconflict.js +0 -191
- data/vendor/assets/javascripts/theme-monokai-uncompressed.js +0 -191
- data/vendor/assets/javascripts/theme-pastel_on_dark-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-pastel_on_dark-uncompressed-noconflict.js +0 -192
- data/vendor/assets/javascripts/theme-pastel_on_dark-uncompressed.js +0 -192
- data/vendor/assets/javascripts/theme-solarized_dark-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-solarized_dark-uncompressed-noconflict.js +0 -176
- data/vendor/assets/javascripts/theme-solarized_dark-uncompressed.js +0 -176
- data/vendor/assets/javascripts/theme-solarized_light-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-solarized_light-uncompressed-noconflict.js +0 -172
- data/vendor/assets/javascripts/theme-solarized_light-uncompressed.js +0 -172
- data/vendor/assets/javascripts/theme-textmate-noconflict.js +0 -0
- data/vendor/assets/javascripts/theme-textmate-uncompressed-noconflict.js +0 -0
- data/vendor/assets/javascripts/theme-textmate-uncompressed.js +0 -0
- data/vendor/assets/javascripts/theme-tomorrow-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-tomorrow-uncompressed-noconflict.js +0 -206
- data/vendor/assets/javascripts/theme-tomorrow-uncompressed.js +0 -206
- data/vendor/assets/javascripts/theme-tomorrow_night-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-tomorrow_night-uncompressed-noconflict.js +0 -206
- data/vendor/assets/javascripts/theme-tomorrow_night-uncompressed.js +0 -206
- data/vendor/assets/javascripts/theme-tomorrow_night_blue-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-tomorrow_night_blue-uncompressed-noconflict.js +0 -209
- data/vendor/assets/javascripts/theme-tomorrow_night_blue-uncompressed.js +0 -209
- data/vendor/assets/javascripts/theme-tomorrow_night_bright-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-tomorrow_night_bright-uncompressed-noconflict.js +0 -206
- data/vendor/assets/javascripts/theme-tomorrow_night_bright-uncompressed.js +0 -206
- data/vendor/assets/javascripts/theme-tomorrow_night_eighties-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-tomorrow_night_eighties-uncompressed-noconflict.js +0 -202
- data/vendor/assets/javascripts/theme-tomorrow_night_eighties-uncompressed.js +0 -202
- data/vendor/assets/javascripts/theme-twilight-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-twilight-uncompressed-noconflict.js +0 -204
- data/vendor/assets/javascripts/theme-twilight-uncompressed.js +0 -204
- data/vendor/assets/javascripts/theme-vibrant_ink-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-vibrant_ink-uncompressed-noconflict.js +0 -183
- data/vendor/assets/javascripts/theme-vibrant_ink-uncompressed.js +0 -183
@@ -1,2137 +0,0 @@
|
|
1
|
-
/* ***** BEGIN LICENSE BLOCK *****
|
2
|
-
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
3
|
-
*
|
4
|
-
* The contents of this file are subject to the Mozilla Public License Version
|
5
|
-
* 1.1 (the "License"); you may not use this file except in compliance with
|
6
|
-
* the License. You may obtain a copy of the License at
|
7
|
-
* http://www.mozilla.org/MPL/
|
8
|
-
*
|
9
|
-
* Software distributed under the License is distributed on an "AS IS" basis,
|
10
|
-
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
11
|
-
* for the specific language governing rights and limitations under the
|
12
|
-
* License.
|
13
|
-
*
|
14
|
-
* The Original Code is Ajax.org Code Editor (ACE).
|
15
|
-
*
|
16
|
-
* The Initial Developer of the Original Code is
|
17
|
-
* Ajax.org B.V.
|
18
|
-
* Portions created by the Initial Developer are Copyright (C) 2010
|
19
|
-
* the Initial Developer. All Rights Reserved.
|
20
|
-
*
|
21
|
-
* Contributor(s):
|
22
|
-
* Fabian Jakobs <fabian AT ajax DOT org>
|
23
|
-
*
|
24
|
-
* Alternatively, the contents of this file may be used under the terms of
|
25
|
-
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
26
|
-
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
27
|
-
* in which case the provisions of the GPL or the LGPL are applicable instead
|
28
|
-
* of those above. If you wish to allow use of your version of this file only
|
29
|
-
* under the terms of either the GPL or the LGPL, and not to allow others to
|
30
|
-
* use your version of this file under the terms of the MPL, indicate your
|
31
|
-
* decision by deleting the provisions above and replace them with the notice
|
32
|
-
* and other provisions required by the GPL or the LGPL. If you do not delete
|
33
|
-
* the provisions above, a recipient may use your version of this file under
|
34
|
-
* the terms of any one of the MPL, the GPL or the LGPL.
|
35
|
-
*
|
36
|
-
* ***** END LICENSE BLOCK ***** */
|
37
|
-
|
38
|
-
define('ace/mode/svg', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml', 'ace/mode/javascript', 'ace/tokenizer', 'ace/mode/svg_highlight_rules', 'ace/mode/folding/mixed', 'ace/mode/folding/xml', 'ace/mode/folding/cstyle'], function(require, exports, module) {
|
39
|
-
"use strict";
|
40
|
-
|
41
|
-
var oop = require("../lib/oop");
|
42
|
-
var XmlMode = require("./xml").Mode;
|
43
|
-
var JavaScriptMode = require("./javascript").Mode;
|
44
|
-
var Tokenizer = require("../tokenizer").Tokenizer;
|
45
|
-
var SvgHighlightRules = require("./svg_highlight_rules").SvgHighlightRules;
|
46
|
-
var MixedFoldMode = require("./folding/mixed").FoldMode;
|
47
|
-
var XmlFoldMode = require("./folding/xml").FoldMode;
|
48
|
-
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
49
|
-
|
50
|
-
var Mode = function() {
|
51
|
-
XmlMode.call(this);
|
52
|
-
|
53
|
-
this.highlighter = new SvgHighlightRules();
|
54
|
-
this.$tokenizer = new Tokenizer(this.highlighter.getRules());
|
55
|
-
|
56
|
-
this.$embeds = this.highlighter.getEmbeds();
|
57
|
-
this.createModeDelegates({
|
58
|
-
"js-": JavaScriptMode
|
59
|
-
});
|
60
|
-
|
61
|
-
this.foldingRules = new MixedFoldMode(new XmlFoldMode({}), {
|
62
|
-
"js-": new CStyleFoldMode()
|
63
|
-
});
|
64
|
-
};
|
65
|
-
|
66
|
-
oop.inherits(Mode, XmlMode);
|
67
|
-
|
68
|
-
(function() {
|
69
|
-
|
70
|
-
this.getNextLineIndent = function(state, line, tab) {
|
71
|
-
return this.$getIndent(line);
|
72
|
-
};
|
73
|
-
|
74
|
-
|
75
|
-
}).call(Mode.prototype);
|
76
|
-
|
77
|
-
exports.Mode = Mode;
|
78
|
-
});
|
79
|
-
/* ***** BEGIN LICENSE BLOCK *****
|
80
|
-
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
81
|
-
*
|
82
|
-
* The contents of this file are subject to the Mozilla Public License Version
|
83
|
-
* 1.1 (the "License"); you may not use this file except in compliance with
|
84
|
-
* the License. You may obtain a copy of the License at
|
85
|
-
* http://www.mozilla.org/MPL/
|
86
|
-
*
|
87
|
-
* Software distributed under the License is distributed on an "AS IS" basis,
|
88
|
-
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
89
|
-
* for the specific language governing rights and limitations under the
|
90
|
-
* License.
|
91
|
-
*
|
92
|
-
* The Original Code is Ajax.org Code Editor (ACE).
|
93
|
-
*
|
94
|
-
* The Initial Developer of the Original Code is
|
95
|
-
* Ajax.org B.V.
|
96
|
-
* Portions created by the Initial Developer are Copyright (C) 2010
|
97
|
-
* the Initial Developer. All Rights Reserved.
|
98
|
-
*
|
99
|
-
* Contributor(s):
|
100
|
-
* Fabian Jakobs <fabian AT ajax DOT org>
|
101
|
-
*
|
102
|
-
* Alternatively, the contents of this file may be used under the terms of
|
103
|
-
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
104
|
-
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
105
|
-
* in which case the provisions of the GPL or the LGPL are applicable instead
|
106
|
-
* of those above. If you wish to allow use of your version of this file only
|
107
|
-
* under the terms of either the GPL or the LGPL, and not to allow others to
|
108
|
-
* use your version of this file under the terms of the MPL, indicate your
|
109
|
-
* decision by deleting the provisions above and replace them with the notice
|
110
|
-
* and other provisions required by the GPL or the LGPL. If you do not delete
|
111
|
-
* the provisions above, a recipient may use your version of this file under
|
112
|
-
* the terms of any one of the MPL, the GPL or the LGPL.
|
113
|
-
*
|
114
|
-
* ***** END LICENSE BLOCK ***** */
|
115
|
-
|
116
|
-
define('ace/mode/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/xml_highlight_rules', 'ace/mode/behaviour/xml', 'ace/mode/folding/xml'], function(require, exports, module) {
|
117
|
-
"use strict";
|
118
|
-
|
119
|
-
var oop = require("../lib/oop");
|
120
|
-
var TextMode = require("./text").Mode;
|
121
|
-
var Tokenizer = require("../tokenizer").Tokenizer;
|
122
|
-
var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
|
123
|
-
var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
|
124
|
-
var XmlFoldMode = require("./folding/xml").FoldMode;
|
125
|
-
|
126
|
-
var Mode = function() {
|
127
|
-
this.$tokenizer = new Tokenizer(new XmlHighlightRules().getRules());
|
128
|
-
this.$behaviour = new XmlBehaviour();
|
129
|
-
this.foldingRules = new XmlFoldMode();
|
130
|
-
};
|
131
|
-
|
132
|
-
oop.inherits(Mode, TextMode);
|
133
|
-
|
134
|
-
(function() {
|
135
|
-
|
136
|
-
this.getNextLineIndent = function(state, line, tab) {
|
137
|
-
return this.$getIndent(line);
|
138
|
-
};
|
139
|
-
|
140
|
-
}).call(Mode.prototype);
|
141
|
-
|
142
|
-
exports.Mode = Mode;
|
143
|
-
});
|
144
|
-
/* ***** BEGIN LICENSE BLOCK *****
|
145
|
-
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
146
|
-
*
|
147
|
-
* The contents of this file are subject to the Mozilla Public License Version
|
148
|
-
* 1.1 (the "License"); you may not use this file except in compliance with
|
149
|
-
* the License. You may obtain a copy of the License at
|
150
|
-
* http://www.mozilla.org/MPL/
|
151
|
-
*
|
152
|
-
* Software distributed under the License is distributed on an "AS IS" basis,
|
153
|
-
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
154
|
-
* for the specific language governing rights and limitations under the
|
155
|
-
* License.
|
156
|
-
*
|
157
|
-
* The Original Code is Ajax.org Code Editor (ACE).
|
158
|
-
*
|
159
|
-
* The Initial Developer of the Original Code is
|
160
|
-
* Ajax.org B.V.
|
161
|
-
* Portions created by the Initial Developer are Copyright (C) 2010
|
162
|
-
* the Initial Developer. All Rights Reserved.
|
163
|
-
*
|
164
|
-
* Contributor(s):
|
165
|
-
* Fabian Jakobs <fabian AT ajax DOT org>
|
166
|
-
*
|
167
|
-
* Alternatively, the contents of this file may be used under the terms of
|
168
|
-
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
169
|
-
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
170
|
-
* in which case the provisions of the GPL or the LGPL are applicable instead
|
171
|
-
* of those above. If you wish to allow use of your version of this file only
|
172
|
-
* under the terms of either the GPL or the LGPL, and not to allow others to
|
173
|
-
* use your version of this file under the terms of the MPL, indicate your
|
174
|
-
* decision by deleting the provisions above and replace them with the notice
|
175
|
-
* and other provisions required by the GPL or the LGPL. If you do not delete
|
176
|
-
* the provisions above, a recipient may use your version of this file under
|
177
|
-
* the terms of any one of the MPL, the GPL or the LGPL.
|
178
|
-
*
|
179
|
-
* ***** END LICENSE BLOCK ***** */
|
180
|
-
|
181
|
-
define('ace/mode/xml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
|
182
|
-
"use strict";
|
183
|
-
|
184
|
-
var oop = require("../lib/oop");
|
185
|
-
var xmlUtil = require("./xml_util");
|
186
|
-
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
187
|
-
|
188
|
-
var XmlHighlightRules = function() {
|
189
|
-
|
190
|
-
// regexp must not have capturing parentheses
|
191
|
-
// regexps are ordered -> the first match is used
|
192
|
-
this.$rules = {
|
193
|
-
start : [{
|
194
|
-
token : "text",
|
195
|
-
regex : "<\\!\\[CDATA\\[",
|
196
|
-
next : "cdata"
|
197
|
-
}, {
|
198
|
-
token : "xml_pe",
|
199
|
-
regex : "<\\?.*?\\?>"
|
200
|
-
}, {
|
201
|
-
token : "comment",
|
202
|
-
merge : true,
|
203
|
-
regex : "<\\!--",
|
204
|
-
next : "comment"
|
205
|
-
}, {
|
206
|
-
token : "xml_pe",
|
207
|
-
regex : "<\\!.*?>"
|
208
|
-
}, {
|
209
|
-
token : "meta.tag", // opening tag
|
210
|
-
regex : "<\\/?",
|
211
|
-
next : "tag"
|
212
|
-
}, {
|
213
|
-
token : "text",
|
214
|
-
regex : "\\s+"
|
215
|
-
}, {
|
216
|
-
token : "constant.character.entity",
|
217
|
-
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
|
218
|
-
}, {
|
219
|
-
token : "text",
|
220
|
-
regex : "[^<]+"
|
221
|
-
}],
|
222
|
-
|
223
|
-
cdata : [{
|
224
|
-
token : "text",
|
225
|
-
regex : "\\]\\]>",
|
226
|
-
next : "start"
|
227
|
-
}, {
|
228
|
-
token : "text",
|
229
|
-
regex : "\\s+"
|
230
|
-
}, {
|
231
|
-
token : "text",
|
232
|
-
regex : "(?:[^\\]]|\\](?!\\]>))+"
|
233
|
-
}],
|
234
|
-
|
235
|
-
comment : [{
|
236
|
-
token : "comment",
|
237
|
-
regex : ".*?-->",
|
238
|
-
next : "start"
|
239
|
-
}, {
|
240
|
-
token : "comment",
|
241
|
-
merge : true,
|
242
|
-
regex : ".+"
|
243
|
-
}]
|
244
|
-
};
|
245
|
-
|
246
|
-
xmlUtil.tag(this.$rules, "tag", "start");
|
247
|
-
};
|
248
|
-
|
249
|
-
oop.inherits(XmlHighlightRules, TextHighlightRules);
|
250
|
-
|
251
|
-
exports.XmlHighlightRules = XmlHighlightRules;
|
252
|
-
});
|
253
|
-
/* ***** BEGIN LICENSE BLOCK *****
|
254
|
-
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
255
|
-
*
|
256
|
-
* The contents of this file are subject to the Mozilla Public License Version
|
257
|
-
* 1.1 (the "License"); you may not use this file except in compliance with
|
258
|
-
* the License. You may obtain a copy of the License at
|
259
|
-
* http://www.mozilla.org/MPL/
|
260
|
-
*
|
261
|
-
* Software distributed under the License is distributed on an "AS IS" basis,
|
262
|
-
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
263
|
-
* for the specific language governing rights and limitations under the
|
264
|
-
* License.
|
265
|
-
*
|
266
|
-
* The Original Code is Ajax.org Code Editor (ACE).
|
267
|
-
*
|
268
|
-
* The Initial Developer of the Original Code is
|
269
|
-
* Ajax.org B.V.
|
270
|
-
* Portions created by the Initial Developer are Copyright (C) 2010
|
271
|
-
* the Initial Developer. All Rights Reserved.
|
272
|
-
*
|
273
|
-
* Contributor(s):
|
274
|
-
* Fabian Jakobs <fabian AT ajax DOT org>
|
275
|
-
*
|
276
|
-
* Alternatively, the contents of this file may be used under the terms of
|
277
|
-
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
278
|
-
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
279
|
-
* in which case the provisions of the GPL or the LGPL are applicable instead
|
280
|
-
* of those above. If you wish to allow use of your version of this file only
|
281
|
-
* under the terms of either the GPL or the LGPL, and not to allow others to
|
282
|
-
* use your version of this file under the terms of the MPL, indicate your
|
283
|
-
* decision by deleting the provisions above and replace them with the notice
|
284
|
-
* and other provisions required by the GPL or the LGPL. If you do not delete
|
285
|
-
* the provisions above, a recipient may use your version of this file under
|
286
|
-
* the terms of any one of the MPL, the GPL or the LGPL.
|
287
|
-
*
|
288
|
-
* ***** END LICENSE BLOCK ***** */
|
289
|
-
|
290
|
-
define('ace/mode/xml_util', ['require', 'exports', 'module' , 'ace/lib/lang'], function(require, exports, module) {
|
291
|
-
"use strict";
|
292
|
-
|
293
|
-
var lang = require("../lib/lang");
|
294
|
-
|
295
|
-
var formTags = lang.arrayToMap(
|
296
|
-
("button|form|input|label|select|textarea").split("|")
|
297
|
-
);
|
298
|
-
|
299
|
-
var tableTags = lang.arrayToMap(
|
300
|
-
("table|tbody|td|tfoot|th|tr").split("|")
|
301
|
-
);
|
302
|
-
|
303
|
-
function string(state) {
|
304
|
-
return [{
|
305
|
-
token : "string",
|
306
|
-
regex : '".*?"'
|
307
|
-
}, {
|
308
|
-
token : "string", // multi line string start
|
309
|
-
merge : true,
|
310
|
-
regex : '["].*',
|
311
|
-
next : state + "_qqstring"
|
312
|
-
}, {
|
313
|
-
token : "string",
|
314
|
-
regex : "'.*?'"
|
315
|
-
}, {
|
316
|
-
token : "string", // multi line string start
|
317
|
-
merge : true,
|
318
|
-
regex : "['].*",
|
319
|
-
next : state + "_qstring"
|
320
|
-
}];
|
321
|
-
}
|
322
|
-
|
323
|
-
function multiLineString(quote, state) {
|
324
|
-
return [{
|
325
|
-
token : "string",
|
326
|
-
merge : true,
|
327
|
-
regex : ".*?" + quote,
|
328
|
-
next : state
|
329
|
-
}, {
|
330
|
-
token : "string",
|
331
|
-
merge : true,
|
332
|
-
regex : '.+'
|
333
|
-
}];
|
334
|
-
}
|
335
|
-
|
336
|
-
exports.tag = function(states, name, nextState) {
|
337
|
-
states[name] = [{
|
338
|
-
token : "text",
|
339
|
-
regex : "\\s+"
|
340
|
-
}, {
|
341
|
-
//token : "meta.tag",
|
342
|
-
|
343
|
-
token : function(value) {
|
344
|
-
if ( value==='a' ) {
|
345
|
-
return "meta.tag.anchor";
|
346
|
-
}
|
347
|
-
else if ( value==='img' ) {
|
348
|
-
return "meta.tag.image";
|
349
|
-
}
|
350
|
-
else if ( value==='script' ) {
|
351
|
-
return "meta.tag.script";
|
352
|
-
}
|
353
|
-
else if ( value==='style' ) {
|
354
|
-
return "meta.tag.style";
|
355
|
-
}
|
356
|
-
else if (formTags.hasOwnProperty(value.toLowerCase())) {
|
357
|
-
return "meta.tag.form";
|
358
|
-
}
|
359
|
-
else if (tableTags.hasOwnProperty(value.toLowerCase())) {
|
360
|
-
return "meta.tag.table";
|
361
|
-
}
|
362
|
-
else {
|
363
|
-
return "meta.tag";
|
364
|
-
}
|
365
|
-
},
|
366
|
-
merge : true,
|
367
|
-
regex : "[-_a-zA-Z0-9:]+",
|
368
|
-
next : name + "_embed_attribute_list"
|
369
|
-
}, {
|
370
|
-
token: "empty",
|
371
|
-
regex: "",
|
372
|
-
next : name + "_embed_attribute_list"
|
373
|
-
}];
|
374
|
-
|
375
|
-
states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list");
|
376
|
-
states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list");
|
377
|
-
|
378
|
-
states[name + "_embed_attribute_list"] = [{
|
379
|
-
token : "meta.tag",
|
380
|
-
merge : true,
|
381
|
-
regex : "\/?>",
|
382
|
-
next : nextState
|
383
|
-
}, {
|
384
|
-
token : "keyword.operator",
|
385
|
-
regex : "="
|
386
|
-
}, {
|
387
|
-
token : "entity.other.attribute-name",
|
388
|
-
regex : "[-_a-zA-Z0-9:]+"
|
389
|
-
}, {
|
390
|
-
token : "constant.numeric", // float
|
391
|
-
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
|
392
|
-
}, {
|
393
|
-
token : "text",
|
394
|
-
regex : "\\s+"
|
395
|
-
}].concat(string(name));
|
396
|
-
};
|
397
|
-
|
398
|
-
});
|
399
|
-
/* vim:ts=4:sts=4:sw=4:
|
400
|
-
* ***** BEGIN LICENSE BLOCK *****
|
401
|
-
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
402
|
-
*
|
403
|
-
* The contents of this file are subject to the Mozilla Public License Version
|
404
|
-
* 1.1 (the "License"); you may not use this file except in compliance with
|
405
|
-
* the License. You may obtain a copy of the License at
|
406
|
-
* http://www.mozilla.org/MPL/
|
407
|
-
*
|
408
|
-
* Software distributed under the License is distributed on an "AS IS" basis,
|
409
|
-
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
410
|
-
* for the specific language governing rights and limitations under the
|
411
|
-
* License.
|
412
|
-
*
|
413
|
-
* The Original Code is Ajax.org Code Editor (ACE).
|
414
|
-
*
|
415
|
-
* The Initial Developer of the Original Code is
|
416
|
-
* Ajax.org B.V.
|
417
|
-
* Portions created by the Initial Developer are Copyright (C) 2010
|
418
|
-
* the Initial Developer. All Rights Reserved.
|
419
|
-
*
|
420
|
-
* Contributor(s):
|
421
|
-
* Chris Spencer <chris.ag.spencer AT googlemail DOT com>
|
422
|
-
*
|
423
|
-
* Alternatively, the contents of this file may be used under the terms of
|
424
|
-
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
425
|
-
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
426
|
-
* in which case the provisions of the GPL or the LGPL are applicable instead
|
427
|
-
* of those above. If you wish to allow use of your version of this file only
|
428
|
-
* under the terms of either the GPL or the LGPL, and not to allow others to
|
429
|
-
* use your version of this file under the terms of the MPL, indicate your
|
430
|
-
* decision by deleting the provisions above and replace them with the notice
|
431
|
-
* and other provisions required by the GPL or the LGPL. If you do not delete
|
432
|
-
* the provisions above, a recipient may use your version of this file under
|
433
|
-
* the terms of any one of the MPL, the GPL or the LGPL.
|
434
|
-
*
|
435
|
-
* ***** END LICENSE BLOCK ***** */
|
436
|
-
|
437
|
-
define('ace/mode/behaviour/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle'], function(require, exports, module) {
|
438
|
-
"use strict";
|
439
|
-
|
440
|
-
var oop = require("../../lib/oop");
|
441
|
-
var Behaviour = require("../behaviour").Behaviour;
|
442
|
-
var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
|
443
|
-
|
444
|
-
var XmlBehaviour = function () {
|
445
|
-
|
446
|
-
this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour
|
447
|
-
|
448
|
-
this.add("brackets", "insertion", function (state, action, editor, session, text) {
|
449
|
-
if (text == '<') {
|
450
|
-
var selection = editor.getSelectionRange();
|
451
|
-
var selected = session.doc.getTextRange(selection);
|
452
|
-
if (selected !== "") {
|
453
|
-
return false;
|
454
|
-
} else {
|
455
|
-
return {
|
456
|
-
text: '<>',
|
457
|
-
selection: [1, 1]
|
458
|
-
}
|
459
|
-
}
|
460
|
-
} else if (text == '>') {
|
461
|
-
var cursor = editor.getCursorPosition();
|
462
|
-
var line = session.doc.getLine(cursor.row);
|
463
|
-
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
464
|
-
if (rightChar == '>') { // need some kind of matching check here
|
465
|
-
return {
|
466
|
-
text: '',
|
467
|
-
selection: [1, 1]
|
468
|
-
}
|
469
|
-
}
|
470
|
-
} else if (text == "\n") {
|
471
|
-
var cursor = editor.getCursorPosition();
|
472
|
-
var line = session.doc.getLine(cursor.row);
|
473
|
-
var rightChars = line.substring(cursor.column, cursor.column + 2);
|
474
|
-
if (rightChars == '</') {
|
475
|
-
var indent = this.$getIndent(session.doc.getLine(cursor.row)) + session.getTabString();
|
476
|
-
var next_indent = this.$getIndent(session.doc.getLine(cursor.row));
|
477
|
-
|
478
|
-
return {
|
479
|
-
text: '\n' + indent + '\n' + next_indent,
|
480
|
-
selection: [1, indent.length, 1, indent.length]
|
481
|
-
}
|
482
|
-
}
|
483
|
-
}
|
484
|
-
});
|
485
|
-
|
486
|
-
}
|
487
|
-
oop.inherits(XmlBehaviour, Behaviour);
|
488
|
-
|
489
|
-
exports.XmlBehaviour = XmlBehaviour;
|
490
|
-
});
|
491
|
-
/* vim:ts=4:sts=4:sw=4:
|
492
|
-
* ***** BEGIN LICENSE BLOCK *****
|
493
|
-
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
494
|
-
*
|
495
|
-
* The contents of this file are subject to the Mozilla Public License Version
|
496
|
-
* 1.1 (the "License"); you may not use this file except in compliance with
|
497
|
-
* the License. You may obtain a copy of the License at
|
498
|
-
* http://www.mozilla.org/MPL/
|
499
|
-
*
|
500
|
-
* Software distributed under the License is distributed on an "AS IS" basis,
|
501
|
-
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
502
|
-
* for the specific language governing rights and limitations under the
|
503
|
-
* License.
|
504
|
-
*
|
505
|
-
* The Original Code is Ajax.org Code Editor (ACE).
|
506
|
-
*
|
507
|
-
* The Initial Developer of the Original Code is
|
508
|
-
* Ajax.org B.V.
|
509
|
-
* Portions created by the Initial Developer are Copyright (C) 2010
|
510
|
-
* the Initial Developer. All Rights Reserved.
|
511
|
-
*
|
512
|
-
* Contributor(s):
|
513
|
-
* Chris Spencer <chris.ag.spencer AT googlemail DOT com>
|
514
|
-
*
|
515
|
-
* Alternatively, the contents of this file may be used under the terms of
|
516
|
-
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
517
|
-
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
518
|
-
* in which case the provisions of the GPL or the LGPL are applicable instead
|
519
|
-
* of those above. If you wish to allow use of your version of this file only
|
520
|
-
* under the terms of either the GPL or the LGPL, and not to allow others to
|
521
|
-
* use your version of this file under the terms of the MPL, indicate your
|
522
|
-
* decision by deleting the provisions above and replace them with the notice
|
523
|
-
* and other provisions required by the GPL or the LGPL. If you do not delete
|
524
|
-
* the provisions above, a recipient may use your version of this file under
|
525
|
-
* the terms of any one of the MPL, the GPL or the LGPL.
|
526
|
-
*
|
527
|
-
* ***** END LICENSE BLOCK ***** */
|
528
|
-
|
529
|
-
define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
|
530
|
-
"use strict";
|
531
|
-
|
532
|
-
var oop = require("../../lib/oop");
|
533
|
-
var Behaviour = require('../behaviour').Behaviour;
|
534
|
-
|
535
|
-
var CstyleBehaviour = function () {
|
536
|
-
|
537
|
-
this.add("braces", "insertion", function (state, action, editor, session, text) {
|
538
|
-
if (text == '{') {
|
539
|
-
var selection = editor.getSelectionRange();
|
540
|
-
var selected = session.doc.getTextRange(selection);
|
541
|
-
if (selected !== "") {
|
542
|
-
return {
|
543
|
-
text: '{' + selected + '}',
|
544
|
-
selection: false
|
545
|
-
};
|
546
|
-
} else {
|
547
|
-
return {
|
548
|
-
text: '{}',
|
549
|
-
selection: [1, 1]
|
550
|
-
};
|
551
|
-
}
|
552
|
-
} else if (text == '}') {
|
553
|
-
var cursor = editor.getCursorPosition();
|
554
|
-
var line = session.doc.getLine(cursor.row);
|
555
|
-
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
556
|
-
if (rightChar == '}') {
|
557
|
-
var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
|
558
|
-
if (matching !== null) {
|
559
|
-
return {
|
560
|
-
text: '',
|
561
|
-
selection: [1, 1]
|
562
|
-
};
|
563
|
-
}
|
564
|
-
}
|
565
|
-
} else if (text == "\n") {
|
566
|
-
var cursor = editor.getCursorPosition();
|
567
|
-
var line = session.doc.getLine(cursor.row);
|
568
|
-
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
569
|
-
if (rightChar == '}') {
|
570
|
-
var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
|
571
|
-
if (!openBracePos)
|
572
|
-
return null;
|
573
|
-
|
574
|
-
var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
|
575
|
-
var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
|
576
|
-
|
577
|
-
return {
|
578
|
-
text: '\n' + indent + '\n' + next_indent,
|
579
|
-
selection: [1, indent.length, 1, indent.length]
|
580
|
-
};
|
581
|
-
}
|
582
|
-
}
|
583
|
-
});
|
584
|
-
|
585
|
-
this.add("braces", "deletion", function (state, action, editor, session, range) {
|
586
|
-
var selected = session.doc.getTextRange(range);
|
587
|
-
if (!range.isMultiLine() && selected == '{') {
|
588
|
-
var line = session.doc.getLine(range.start.row);
|
589
|
-
var rightChar = line.substring(range.end.column, range.end.column + 1);
|
590
|
-
if (rightChar == '}') {
|
591
|
-
range.end.column++;
|
592
|
-
return range;
|
593
|
-
}
|
594
|
-
}
|
595
|
-
});
|
596
|
-
|
597
|
-
this.add("parens", "insertion", function (state, action, editor, session, text) {
|
598
|
-
if (text == '(') {
|
599
|
-
var selection = editor.getSelectionRange();
|
600
|
-
var selected = session.doc.getTextRange(selection);
|
601
|
-
if (selected !== "") {
|
602
|
-
return {
|
603
|
-
text: '(' + selected + ')',
|
604
|
-
selection: false
|
605
|
-
};
|
606
|
-
} else {
|
607
|
-
return {
|
608
|
-
text: '()',
|
609
|
-
selection: [1, 1]
|
610
|
-
};
|
611
|
-
}
|
612
|
-
} else if (text == ')') {
|
613
|
-
var cursor = editor.getCursorPosition();
|
614
|
-
var line = session.doc.getLine(cursor.row);
|
615
|
-
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
616
|
-
if (rightChar == ')') {
|
617
|
-
var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
|
618
|
-
if (matching !== null) {
|
619
|
-
return {
|
620
|
-
text: '',
|
621
|
-
selection: [1, 1]
|
622
|
-
};
|
623
|
-
}
|
624
|
-
}
|
625
|
-
}
|
626
|
-
});
|
627
|
-
|
628
|
-
this.add("parens", "deletion", function (state, action, editor, session, range) {
|
629
|
-
var selected = session.doc.getTextRange(range);
|
630
|
-
if (!range.isMultiLine() && selected == '(') {
|
631
|
-
var line = session.doc.getLine(range.start.row);
|
632
|
-
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
|
633
|
-
if (rightChar == ')') {
|
634
|
-
range.end.column++;
|
635
|
-
return range;
|
636
|
-
}
|
637
|
-
}
|
638
|
-
});
|
639
|
-
|
640
|
-
this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
|
641
|
-
if (text == '"' || text == "'") {
|
642
|
-
var quote = text;
|
643
|
-
var selection = editor.getSelectionRange();
|
644
|
-
var selected = session.doc.getTextRange(selection);
|
645
|
-
if (selected !== "") {
|
646
|
-
return {
|
647
|
-
text: quote + selected + quote,
|
648
|
-
selection: false
|
649
|
-
};
|
650
|
-
} else {
|
651
|
-
var cursor = editor.getCursorPosition();
|
652
|
-
var line = session.doc.getLine(cursor.row);
|
653
|
-
var leftChar = line.substring(cursor.column-1, cursor.column);
|
654
|
-
|
655
|
-
// We're escaped.
|
656
|
-
if (leftChar == '\\') {
|
657
|
-
return null;
|
658
|
-
}
|
659
|
-
|
660
|
-
// Find what token we're inside.
|
661
|
-
var tokens = session.getTokens(selection.start.row, selection.start.row)[0].tokens;
|
662
|
-
var col = 0, token;
|
663
|
-
var quotepos = -1; // Track whether we're inside an open quote.
|
664
|
-
|
665
|
-
for (var x = 0; x < tokens.length; x++) {
|
666
|
-
token = tokens[x];
|
667
|
-
if (token.type == "string") {
|
668
|
-
quotepos = -1;
|
669
|
-
} else if (quotepos < 0) {
|
670
|
-
quotepos = token.value.indexOf(quote);
|
671
|
-
}
|
672
|
-
if ((token.value.length + col) > selection.start.column) {
|
673
|
-
break;
|
674
|
-
}
|
675
|
-
col += tokens[x].value.length;
|
676
|
-
}
|
677
|
-
|
678
|
-
// Try and be smart about when we auto insert.
|
679
|
-
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)))) {
|
680
|
-
return {
|
681
|
-
text: quote + quote,
|
682
|
-
selection: [1,1]
|
683
|
-
};
|
684
|
-
} else if (token && token.type === "string") {
|
685
|
-
// Ignore input and move right one if we're typing over the closing quote.
|
686
|
-
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
687
|
-
if (rightChar == quote) {
|
688
|
-
return {
|
689
|
-
text: '',
|
690
|
-
selection: [1, 1]
|
691
|
-
};
|
692
|
-
}
|
693
|
-
}
|
694
|
-
}
|
695
|
-
}
|
696
|
-
});
|
697
|
-
|
698
|
-
this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
|
699
|
-
var selected = session.doc.getTextRange(range);
|
700
|
-
if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
|
701
|
-
var line = session.doc.getLine(range.start.row);
|
702
|
-
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
|
703
|
-
if (rightChar == '"') {
|
704
|
-
range.end.column++;
|
705
|
-
return range;
|
706
|
-
}
|
707
|
-
}
|
708
|
-
});
|
709
|
-
|
710
|
-
};
|
711
|
-
|
712
|
-
oop.inherits(CstyleBehaviour, Behaviour);
|
713
|
-
|
714
|
-
exports.CstyleBehaviour = CstyleBehaviour;
|
715
|
-
});
|
716
|
-
/* ***** BEGIN LICENSE BLOCK *****
|
717
|
-
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
718
|
-
*
|
719
|
-
* The contents of this file are subject to the Mozilla Public License Version
|
720
|
-
* 1.1 (the "License"); you may not use this file except in compliance with
|
721
|
-
* the License. You may obtain a copy of the License at
|
722
|
-
* http://www.mozilla.org/MPL/
|
723
|
-
*
|
724
|
-
* Software distributed under the License is distributed on an "AS IS" basis,
|
725
|
-
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
726
|
-
* for the specific language governing rights and limitations under the
|
727
|
-
* License.
|
728
|
-
*
|
729
|
-
* The Original Code is Ajax.org Code Editor (ACE).
|
730
|
-
*
|
731
|
-
* The Initial Developer of the Original Code is
|
732
|
-
* Ajax.org B.V.
|
733
|
-
* Portions created by the Initial Developer are Copyright (C) 2010
|
734
|
-
* the Initial Developer. All Rights Reserved.
|
735
|
-
*
|
736
|
-
* Contributor(s):
|
737
|
-
* Fabian Jakobs <fabian AT ajax DOT org>
|
738
|
-
*
|
739
|
-
* Alternatively, the contents of this file may be used under the terms of
|
740
|
-
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
741
|
-
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
742
|
-
* in which case the provisions of the GPL or the LGPL are applicable instead
|
743
|
-
* of those above. If you wish to allow use of your version of this file only
|
744
|
-
* under the terms of either the GPL or the LGPL, and not to allow others to
|
745
|
-
* use your version of this file under the terms of the MPL, indicate your
|
746
|
-
* decision by deleting the provisions above and replace them with the notice
|
747
|
-
* and other provisions required by the GPL or the LGPL. If you do not delete
|
748
|
-
* the provisions above, a recipient may use your version of this file under
|
749
|
-
* the terms of any one of the MPL, the GPL or the LGPL.
|
750
|
-
*
|
751
|
-
* ***** END LICENSE BLOCK ***** */
|
752
|
-
|
753
|
-
define('ace/mode/folding/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/range', 'ace/mode/folding/fold_mode', 'ace/token_iterator'], function(require, exports, module) {
|
754
|
-
"use strict";
|
755
|
-
|
756
|
-
var oop = require("../../lib/oop");
|
757
|
-
var lang = require("../../lib/lang");
|
758
|
-
var Range = require("../../range").Range;
|
759
|
-
var BaseFoldMode = require("./fold_mode").FoldMode;
|
760
|
-
var TokenIterator = require("../../token_iterator").TokenIterator;
|
761
|
-
|
762
|
-
var FoldMode = exports.FoldMode = function(voidElements) {
|
763
|
-
BaseFoldMode.call(this);
|
764
|
-
this.voidElements = voidElements || {};
|
765
|
-
};
|
766
|
-
oop.inherits(FoldMode, BaseFoldMode);
|
767
|
-
|
768
|
-
(function() {
|
769
|
-
|
770
|
-
this.getFoldWidget = function(session, foldStyle, row) {
|
771
|
-
var tag = this._getFirstTagInLine(session, row);
|
772
|
-
|
773
|
-
if (tag.closing)
|
774
|
-
return foldStyle == "markbeginend" ? "end" : "";
|
775
|
-
|
776
|
-
if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()])
|
777
|
-
return "";
|
778
|
-
|
779
|
-
if (tag.selfClosing)
|
780
|
-
return "";
|
781
|
-
|
782
|
-
if (tag.value.indexOf("/" + tag.tagName) !== -1)
|
783
|
-
return "";
|
784
|
-
|
785
|
-
return "start";
|
786
|
-
};
|
787
|
-
|
788
|
-
this._getFirstTagInLine = function(session, row) {
|
789
|
-
var tokens = session.getTokens(row, row)[0].tokens;
|
790
|
-
var value = "";
|
791
|
-
for (var i = 0; i < tokens.length; i++) {
|
792
|
-
var token = tokens[i];
|
793
|
-
if (token.type.indexOf("meta.tag") === 0)
|
794
|
-
value += token.value;
|
795
|
-
else
|
796
|
-
value += lang.stringRepeat(" ", token.value.length);
|
797
|
-
}
|
798
|
-
|
799
|
-
return this._parseTag(value);
|
800
|
-
};
|
801
|
-
|
802
|
-
this.tagRe = /^(\s*)(<?(\/?)([-_a-zA-Z0-9:!]*)\s*(\/?)>?)/;
|
803
|
-
this._parseTag = function(tag) {
|
804
|
-
|
805
|
-
var match = this.tagRe.exec(tag);
|
806
|
-
var column = this.tagRe.lastIndex || 0;
|
807
|
-
this.tagRe.lastIndex = 0;
|
808
|
-
|
809
|
-
return {
|
810
|
-
value: tag,
|
811
|
-
match: match ? match[2] : "",
|
812
|
-
closing: match ? !!match[3] : false,
|
813
|
-
selfClosing: match ? !!match[5] || match[2] == "/>" : false,
|
814
|
-
tagName: match ? match[4] : "",
|
815
|
-
column: match[1] ? column + match[1].length : column
|
816
|
-
};
|
817
|
-
};
|
818
|
-
|
819
|
-
/*
|
820
|
-
* reads a full tag and places the iterator after the tag
|
821
|
-
*/
|
822
|
-
this._readTagForward = function(iterator) {
|
823
|
-
var token = iterator.getCurrentToken();
|
824
|
-
if (!token)
|
825
|
-
return null;
|
826
|
-
|
827
|
-
var value = "";
|
828
|
-
var start;
|
829
|
-
|
830
|
-
do {
|
831
|
-
if (token.type.indexOf("meta.tag") === 0) {
|
832
|
-
if (!start) {
|
833
|
-
var start = {
|
834
|
-
row: iterator.getCurrentTokenRow(),
|
835
|
-
column: iterator.getCurrentTokenColumn()
|
836
|
-
};
|
837
|
-
}
|
838
|
-
value += token.value;
|
839
|
-
if (value.indexOf(">") !== -1) {
|
840
|
-
var tag = this._parseTag(value);
|
841
|
-
tag.start = start;
|
842
|
-
tag.end = {
|
843
|
-
row: iterator.getCurrentTokenRow(),
|
844
|
-
column: iterator.getCurrentTokenColumn() + token.value.length
|
845
|
-
};
|
846
|
-
iterator.stepForward();
|
847
|
-
return tag;
|
848
|
-
}
|
849
|
-
}
|
850
|
-
} while(token = iterator.stepForward());
|
851
|
-
|
852
|
-
return null;
|
853
|
-
};
|
854
|
-
|
855
|
-
this._readTagBackward = function(iterator) {
|
856
|
-
var token = iterator.getCurrentToken();
|
857
|
-
if (!token)
|
858
|
-
return null;
|
859
|
-
|
860
|
-
var value = "";
|
861
|
-
var end;
|
862
|
-
|
863
|
-
do {
|
864
|
-
if (token.type.indexOf("meta.tag") === 0) {
|
865
|
-
if (!end) {
|
866
|
-
end = {
|
867
|
-
row: iterator.getCurrentTokenRow(),
|
868
|
-
column: iterator.getCurrentTokenColumn() + token.value.length
|
869
|
-
};
|
870
|
-
}
|
871
|
-
value = token.value + value;
|
872
|
-
if (value.indexOf("<") !== -1) {
|
873
|
-
var tag = this._parseTag(value);
|
874
|
-
tag.end = end;
|
875
|
-
tag.start = {
|
876
|
-
row: iterator.getCurrentTokenRow(),
|
877
|
-
column: iterator.getCurrentTokenColumn()
|
878
|
-
};
|
879
|
-
iterator.stepBackward();
|
880
|
-
return tag;
|
881
|
-
}
|
882
|
-
}
|
883
|
-
} while(token = iterator.stepBackward());
|
884
|
-
|
885
|
-
return null;
|
886
|
-
};
|
887
|
-
|
888
|
-
this._pop = function(stack, tag) {
|
889
|
-
while (stack.length) {
|
890
|
-
|
891
|
-
var top = stack[stack.length-1];
|
892
|
-
if (!tag || top.tagName == tag.tagName) {
|
893
|
-
return stack.pop();
|
894
|
-
}
|
895
|
-
else if (this.voidElements[tag.tagName]) {
|
896
|
-
return;
|
897
|
-
}
|
898
|
-
else if (this.voidElements[top.tagName]) {
|
899
|
-
stack.pop();
|
900
|
-
continue;
|
901
|
-
} else {
|
902
|
-
return null;
|
903
|
-
}
|
904
|
-
}
|
905
|
-
};
|
906
|
-
|
907
|
-
this.getFoldWidgetRange = function(session, foldStyle, row) {
|
908
|
-
var firstTag = this._getFirstTagInLine(session, row);
|
909
|
-
|
910
|
-
if (!firstTag.match)
|
911
|
-
return null;
|
912
|
-
|
913
|
-
var isBackward = firstTag.closing || firstTag.selfClosing;
|
914
|
-
var stack = [];
|
915
|
-
var tag;
|
916
|
-
|
917
|
-
if (!isBackward) {
|
918
|
-
var iterator = new TokenIterator(session, row, firstTag.column);
|
919
|
-
var start = {
|
920
|
-
row: row,
|
921
|
-
column: firstTag.column + firstTag.tagName.length + 2
|
922
|
-
};
|
923
|
-
while (tag = this._readTagForward(iterator)) {
|
924
|
-
if (tag.selfClosing) {
|
925
|
-
if (!stack.length) {
|
926
|
-
tag.start.column += tag.tagName.length + 2;
|
927
|
-
tag.end.column -= 2;
|
928
|
-
return Range.fromPoints(tag.start, tag.end);
|
929
|
-
} else
|
930
|
-
continue;
|
931
|
-
}
|
932
|
-
|
933
|
-
if (tag.closing) {
|
934
|
-
this._pop(stack, tag);
|
935
|
-
if (stack.length == 0)
|
936
|
-
return Range.fromPoints(start, tag.start);
|
937
|
-
}
|
938
|
-
else {
|
939
|
-
stack.push(tag)
|
940
|
-
}
|
941
|
-
}
|
942
|
-
}
|
943
|
-
else {
|
944
|
-
var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length);
|
945
|
-
var end = {
|
946
|
-
row: row,
|
947
|
-
column: firstTag.column
|
948
|
-
};
|
949
|
-
|
950
|
-
while (tag = this._readTagBackward(iterator)) {
|
951
|
-
if (tag.selfClosing) {
|
952
|
-
if (!stack.length) {
|
953
|
-
tag.start.column += tag.tagName.length + 2;
|
954
|
-
tag.end.column -= 2;
|
955
|
-
return Range.fromPoints(tag.start, tag.end);
|
956
|
-
} else
|
957
|
-
continue;
|
958
|
-
}
|
959
|
-
|
960
|
-
if (!tag.closing) {
|
961
|
-
this._pop(stack, tag);
|
962
|
-
if (stack.length == 0) {
|
963
|
-
tag.start.column += tag.tagName.length + 2;
|
964
|
-
return Range.fromPoints(tag.start, end);
|
965
|
-
}
|
966
|
-
}
|
967
|
-
else {
|
968
|
-
stack.push(tag)
|
969
|
-
}
|
970
|
-
}
|
971
|
-
}
|
972
|
-
|
973
|
-
};
|
974
|
-
|
975
|
-
}).call(FoldMode.prototype);
|
976
|
-
|
977
|
-
});
|
978
|
-
/* ***** BEGIN LICENSE BLOCK *****
|
979
|
-
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
980
|
-
*
|
981
|
-
* The contents of this file are subject to the Mozilla Public License Version
|
982
|
-
* 1.1 (the "License"); you may not use this file except in compliance with
|
983
|
-
* the License. You may obtain a copy of the License at
|
984
|
-
* http://www.mozilla.org/MPL/
|
985
|
-
*
|
986
|
-
* Software distributed under the License is distributed on an "AS IS" basis,
|
987
|
-
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
988
|
-
* for the specific language governing rights and limitations under the
|
989
|
-
* License.
|
990
|
-
*
|
991
|
-
* The Original Code is Ajax.org Code Editor (ACE).
|
992
|
-
*
|
993
|
-
* The Initial Developer of the Original Code is
|
994
|
-
* Ajax.org B.V.
|
995
|
-
* Portions created by the Initial Developer are Copyright (C) 2010
|
996
|
-
* the Initial Developer. All Rights Reserved.
|
997
|
-
*
|
998
|
-
* Contributor(s):
|
999
|
-
* Fabian Jakobs <fabian AT ajax DOT org>
|
1000
|
-
*
|
1001
|
-
* Alternatively, the contents of this file may be used under the terms of
|
1002
|
-
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
1003
|
-
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
1004
|
-
* in which case the provisions of the GPL or the LGPL are applicable instead
|
1005
|
-
* of those above. If you wish to allow use of your version of this file only
|
1006
|
-
* under the terms of either the GPL or the LGPL, and not to allow others to
|
1007
|
-
* use your version of this file under the terms of the MPL, indicate your
|
1008
|
-
* decision by deleting the provisions above and replace them with the notice
|
1009
|
-
* and other provisions required by the GPL or the LGPL. If you do not delete
|
1010
|
-
* the provisions above, a recipient may use your version of this file under
|
1011
|
-
* the terms of any one of the MPL, the GPL or the LGPL.
|
1012
|
-
*
|
1013
|
-
* ***** END LICENSE BLOCK ***** */
|
1014
|
-
|
1015
|
-
define('ace/mode/folding/fold_mode', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
|
1016
|
-
"use strict";
|
1017
|
-
|
1018
|
-
var Range = require("../../range").Range;
|
1019
|
-
|
1020
|
-
var FoldMode = exports.FoldMode = function() {};
|
1021
|
-
|
1022
|
-
(function() {
|
1023
|
-
|
1024
|
-
this.foldingStartMarker = null;
|
1025
|
-
this.foldingStopMarker = null;
|
1026
|
-
|
1027
|
-
// must return "" if there's no fold, to enable caching
|
1028
|
-
this.getFoldWidget = function(session, foldStyle, row) {
|
1029
|
-
var line = session.getLine(row);
|
1030
|
-
if (this.foldingStartMarker.test(line))
|
1031
|
-
return "start";
|
1032
|
-
if (foldStyle == "markbeginend"
|
1033
|
-
&& this.foldingStopMarker
|
1034
|
-
&& this.foldingStopMarker.test(line))
|
1035
|
-
return "end";
|
1036
|
-
return "";
|
1037
|
-
};
|
1038
|
-
|
1039
|
-
this.getFoldWidgetRange = function(session, foldStyle, row) {
|
1040
|
-
return null;
|
1041
|
-
};
|
1042
|
-
|
1043
|
-
this.indentationBlock = function(session, row, column) {
|
1044
|
-
var re = /^\s*/;
|
1045
|
-
var startRow = row;
|
1046
|
-
var endRow = row;
|
1047
|
-
var line = session.getLine(row);
|
1048
|
-
var startColumn = column || line.length;
|
1049
|
-
var startLevel = line.match(re)[0].length;
|
1050
|
-
var maxRow = session.getLength()
|
1051
|
-
|
1052
|
-
while (++row < maxRow) {
|
1053
|
-
line = session.getLine(row);
|
1054
|
-
var level = line.match(re)[0].length;
|
1055
|
-
|
1056
|
-
if (level == line.length)
|
1057
|
-
continue;
|
1058
|
-
|
1059
|
-
if (level <= startLevel)
|
1060
|
-
break;
|
1061
|
-
|
1062
|
-
endRow = row;
|
1063
|
-
}
|
1064
|
-
|
1065
|
-
if (endRow > startRow) {
|
1066
|
-
var endColumn = session.getLine(endRow).length;
|
1067
|
-
return new Range(startRow, startColumn, endRow, endColumn);
|
1068
|
-
}
|
1069
|
-
};
|
1070
|
-
|
1071
|
-
this.openingBracketBlock = function(session, bracket, row, column) {
|
1072
|
-
var start = {row: row, column: column + 1};
|
1073
|
-
var end = session.$findClosingBracket(bracket, start);
|
1074
|
-
if (!end)
|
1075
|
-
return;
|
1076
|
-
|
1077
|
-
var fw = session.foldWidgets[end.row];
|
1078
|
-
if (fw == null)
|
1079
|
-
fw = this.getFoldWidget(session, end.row);
|
1080
|
-
|
1081
|
-
if (fw == "start") {
|
1082
|
-
end.row --;
|
1083
|
-
end.column = session.getLine(end.row).length;
|
1084
|
-
}
|
1085
|
-
return Range.fromPoints(start, end);
|
1086
|
-
};
|
1087
|
-
|
1088
|
-
}).call(FoldMode.prototype);
|
1089
|
-
|
1090
|
-
});
|
1091
|
-
/* ***** BEGIN LICENSE BLOCK *****
|
1092
|
-
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
1093
|
-
*
|
1094
|
-
* The contents of this file are subject to the Mozilla Public License Version
|
1095
|
-
* 1.1 (the "License"); you may not use this file except in compliance with
|
1096
|
-
* the License. You may obtain a copy of the License at
|
1097
|
-
* http://www.mozilla.org/MPL/
|
1098
|
-
*
|
1099
|
-
* Software distributed under the License is distributed on an "AS IS" basis,
|
1100
|
-
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
1101
|
-
* for the specific language governing rights and limitations under the
|
1102
|
-
* License.
|
1103
|
-
*
|
1104
|
-
* The Original Code is Ajax.org Code Editor (ACE).
|
1105
|
-
*
|
1106
|
-
* The Initial Developer of the Original Code is
|
1107
|
-
* Ajax.org B.V.
|
1108
|
-
* Portions created by the Initial Developer are Copyright (C) 2010
|
1109
|
-
* the Initial Developer. All Rights Reserved.
|
1110
|
-
*
|
1111
|
-
* Contributor(s):
|
1112
|
-
* Fabian Jakobs <fabian AT ajax DOT org>
|
1113
|
-
*
|
1114
|
-
* Alternatively, the contents of this file may be used under the terms of
|
1115
|
-
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
1116
|
-
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
1117
|
-
* in which case the provisions of the GPL or the LGPL are applicable instead
|
1118
|
-
* of those above. If you wish to allow use of your version of this file only
|
1119
|
-
* under the terms of either the GPL or the LGPL, and not to allow others to
|
1120
|
-
* use your version of this file under the terms of the MPL, indicate your
|
1121
|
-
* decision by deleting the provisions above and replace them with the notice
|
1122
|
-
* and other provisions required by the GPL or the LGPL. If you do not delete
|
1123
|
-
* the provisions above, a recipient may use your version of this file under
|
1124
|
-
* the terms of any one of the MPL, the GPL or the LGPL.
|
1125
|
-
*
|
1126
|
-
* ***** END LICENSE BLOCK ***** */
|
1127
|
-
|
1128
|
-
define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) {
|
1129
|
-
"use strict";
|
1130
|
-
|
1131
|
-
var oop = require("../lib/oop");
|
1132
|
-
var TextMode = require("./text").Mode;
|
1133
|
-
var Tokenizer = require("../tokenizer").Tokenizer;
|
1134
|
-
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
|
1135
|
-
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
1136
|
-
var Range = require("../range").Range;
|
1137
|
-
var WorkerClient = require("../worker/worker_client").WorkerClient;
|
1138
|
-
var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
|
1139
|
-
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
1140
|
-
|
1141
|
-
var Mode = function() {
|
1142
|
-
this.$tokenizer = new Tokenizer(new JavaScriptHighlightRules().getRules());
|
1143
|
-
this.$outdent = new MatchingBraceOutdent();
|
1144
|
-
this.$behaviour = new CstyleBehaviour();
|
1145
|
-
this.foldingRules = new CStyleFoldMode();
|
1146
|
-
};
|
1147
|
-
oop.inherits(Mode, TextMode);
|
1148
|
-
|
1149
|
-
(function() {
|
1150
|
-
|
1151
|
-
|
1152
|
-
this.toggleCommentLines = function(state, doc, startRow, endRow) {
|
1153
|
-
var outdent = true;
|
1154
|
-
var re = /^(\s*)\/\//;
|
1155
|
-
|
1156
|
-
for (var i=startRow; i<= endRow; i++) {
|
1157
|
-
if (!re.test(doc.getLine(i))) {
|
1158
|
-
outdent = false;
|
1159
|
-
break;
|
1160
|
-
}
|
1161
|
-
}
|
1162
|
-
|
1163
|
-
if (outdent) {
|
1164
|
-
var deleteRange = new Range(0, 0, 0, 0);
|
1165
|
-
for (var i=startRow; i<= endRow; i++)
|
1166
|
-
{
|
1167
|
-
var line = doc.getLine(i);
|
1168
|
-
var m = line.match(re);
|
1169
|
-
deleteRange.start.row = i;
|
1170
|
-
deleteRange.end.row = i;
|
1171
|
-
deleteRange.end.column = m[0].length;
|
1172
|
-
doc.replace(deleteRange, m[1]);
|
1173
|
-
}
|
1174
|
-
}
|
1175
|
-
else {
|
1176
|
-
doc.indentRows(startRow, endRow, "//");
|
1177
|
-
}
|
1178
|
-
};
|
1179
|
-
|
1180
|
-
this.getNextLineIndent = function(state, line, tab) {
|
1181
|
-
var indent = this.$getIndent(line);
|
1182
|
-
|
1183
|
-
var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
|
1184
|
-
var tokens = tokenizedLine.tokens;
|
1185
|
-
var endState = tokenizedLine.state;
|
1186
|
-
|
1187
|
-
if (tokens.length && tokens[tokens.length-1].type == "comment") {
|
1188
|
-
return indent;
|
1189
|
-
}
|
1190
|
-
|
1191
|
-
if (state == "start" || state == "regex_allowed") {
|
1192
|
-
var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
|
1193
|
-
if (match) {
|
1194
|
-
indent += tab;
|
1195
|
-
}
|
1196
|
-
} else if (state == "doc-start") {
|
1197
|
-
if (endState == "start" || state == "regex_allowed") {
|
1198
|
-
return "";
|
1199
|
-
}
|
1200
|
-
var match = line.match(/^\s*(\/?)\*/);
|
1201
|
-
if (match) {
|
1202
|
-
if (match[1]) {
|
1203
|
-
indent += " ";
|
1204
|
-
}
|
1205
|
-
indent += "* ";
|
1206
|
-
}
|
1207
|
-
}
|
1208
|
-
|
1209
|
-
return indent;
|
1210
|
-
};
|
1211
|
-
|
1212
|
-
this.checkOutdent = function(state, line, input) {
|
1213
|
-
return this.$outdent.checkOutdent(line, input);
|
1214
|
-
};
|
1215
|
-
|
1216
|
-
this.autoOutdent = function(state, doc, row) {
|
1217
|
-
this.$outdent.autoOutdent(doc, row);
|
1218
|
-
};
|
1219
|
-
|
1220
|
-
this.createWorker = function(session) {
|
1221
|
-
var worker = new WorkerClient(["ace"], "worker-javascript.js", "ace/mode/javascript_worker", "JavaScriptWorker");
|
1222
|
-
worker.attachToDocument(session.getDocument());
|
1223
|
-
|
1224
|
-
worker.on("jslint", function(results) {
|
1225
|
-
var errors = [];
|
1226
|
-
for (var i=0; i<results.data.length; i++) {
|
1227
|
-
var error = results.data[i];
|
1228
|
-
if (error)
|
1229
|
-
errors.push({
|
1230
|
-
row: error.line-1,
|
1231
|
-
column: error.character-1,
|
1232
|
-
text: error.reason,
|
1233
|
-
type: "warning",
|
1234
|
-
lint: error
|
1235
|
-
});
|
1236
|
-
}
|
1237
|
-
session.setAnnotations(errors);
|
1238
|
-
});
|
1239
|
-
|
1240
|
-
worker.on("narcissus", function(e) {
|
1241
|
-
session.setAnnotations([e.data]);
|
1242
|
-
});
|
1243
|
-
|
1244
|
-
worker.on("terminate", function() {
|
1245
|
-
session.clearAnnotations();
|
1246
|
-
});
|
1247
|
-
|
1248
|
-
return worker;
|
1249
|
-
};
|
1250
|
-
|
1251
|
-
}).call(Mode.prototype);
|
1252
|
-
|
1253
|
-
exports.Mode = Mode;
|
1254
|
-
});
|
1255
|
-
/* ***** BEGIN LICENSE BLOCK *****
|
1256
|
-
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
1257
|
-
*
|
1258
|
-
* The contents of this file are subject to the Mozilla Public License Version
|
1259
|
-
* 1.1 (the "License"); you may not use this file except in compliance with
|
1260
|
-
* the License. You may obtain a copy of the License at
|
1261
|
-
* http://www.mozilla.org/MPL/
|
1262
|
-
*
|
1263
|
-
* Software distributed under the License is distributed on an "AS IS" basis,
|
1264
|
-
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
1265
|
-
* for the specific language governing rights and limitations under the
|
1266
|
-
* License.
|
1267
|
-
*
|
1268
|
-
* The Original Code is Ajax.org Code Editor (ACE).
|
1269
|
-
*
|
1270
|
-
* The Initial Developer of the Original Code is
|
1271
|
-
* Ajax.org B.V.
|
1272
|
-
* Portions created by the Initial Developer are Copyright (C) 2010
|
1273
|
-
* the Initial Developer. All Rights Reserved.
|
1274
|
-
*
|
1275
|
-
* Contributor(s):
|
1276
|
-
* Fabian Jakobs <fabian AT ajax DOT org>
|
1277
|
-
* Mihai Sucan <mihai DOT sucan AT gmail DOT com>
|
1278
|
-
*
|
1279
|
-
* Alternatively, the contents of this file may be used under the terms of
|
1280
|
-
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
1281
|
-
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
1282
|
-
* in which case the provisions of the GPL or the LGPL are applicable instead
|
1283
|
-
* of those above. If you wish to allow use of your version of this file only
|
1284
|
-
* under the terms of either the GPL or the LGPL, and not to allow others to
|
1285
|
-
* use your version of this file under the terms of the MPL, indicate your
|
1286
|
-
* decision by deleting the provisions above and replace them with the notice
|
1287
|
-
* and other provisions required by the GPL or the LGPL. If you do not delete
|
1288
|
-
* the provisions above, a recipient may use your version of this file under
|
1289
|
-
* the terms of any one of the MPL, the GPL or the LGPL.
|
1290
|
-
*
|
1291
|
-
* ***** END LICENSE BLOCK ***** */
|
1292
|
-
|
1293
|
-
define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/unicode', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
|
1294
|
-
"use strict";
|
1295
|
-
|
1296
|
-
var oop = require("../lib/oop");
|
1297
|
-
var lang = require("../lib/lang");
|
1298
|
-
var unicode = require("../unicode");
|
1299
|
-
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
|
1300
|
-
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
1301
|
-
|
1302
|
-
var JavaScriptHighlightRules = function() {
|
1303
|
-
|
1304
|
-
// see: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects
|
1305
|
-
var globals = lang.arrayToMap(
|
1306
|
-
// Constructors
|
1307
|
-
("Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" +
|
1308
|
-
// E4X
|
1309
|
-
"Namespace|QName|XML|XMLList|" +
|
1310
|
-
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
|
1311
|
-
"Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
|
1312
|
-
// Errors
|
1313
|
-
"Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" +
|
1314
|
-
"SyntaxError|TypeError|URIError|" +
|
1315
|
-
// Non-constructor functions
|
1316
|
-
"decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" +
|
1317
|
-
"isNaN|parseFloat|parseInt|" +
|
1318
|
-
// Other
|
1319
|
-
"JSON|Math|" +
|
1320
|
-
// Pseudo
|
1321
|
-
"this|arguments|prototype|window|document"
|
1322
|
-
).split("|")
|
1323
|
-
);
|
1324
|
-
|
1325
|
-
var keywords = lang.arrayToMap(
|
1326
|
-
("break|case|catch|continue|default|delete|do|else|finally|for|function|" +
|
1327
|
-
"if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|" +
|
1328
|
-
"const|yield|import|get|set").split("|")
|
1329
|
-
);
|
1330
|
-
|
1331
|
-
// keywords which can be followed by regular expressions
|
1332
|
-
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield";
|
1333
|
-
|
1334
|
-
var deprecated = lang.arrayToMap(
|
1335
|
-
("__parent__|__count__|escape|unescape|with|__proto__").split("|")
|
1336
|
-
);
|
1337
|
-
|
1338
|
-
var definitions = lang.arrayToMap(("const|let|var|function").split("|"));
|
1339
|
-
|
1340
|
-
var buildinConstants = lang.arrayToMap(
|
1341
|
-
("null|Infinity|NaN|undefined").split("|")
|
1342
|
-
);
|
1343
|
-
|
1344
|
-
var futureReserved = lang.arrayToMap(
|
1345
|
-
("class|enum|extends|super|export|implements|private|" +
|
1346
|
-
"public|interface|package|protected|static").split("|")
|
1347
|
-
);
|
1348
|
-
|
1349
|
-
// TODO: Unicode escape sequences
|
1350
|
-
var identifierRe = "[" + unicode.packages.L + "\\$_]["
|
1351
|
-
+ unicode.packages.L
|
1352
|
-
+ unicode.packages.Mn + unicode.packages.Mc
|
1353
|
-
+ unicode.packages.Nd
|
1354
|
-
+ unicode.packages.Pc + "\\$_]*\\b";
|
1355
|
-
|
1356
|
-
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
|
1357
|
-
"u[0-9a-fA-F]{4}|" + // unicode
|
1358
|
-
"[0-2][0-7]{0,2}|" + // oct
|
1359
|
-
"3[0-6][0-7]?|" + // oct
|
1360
|
-
"37[0-7]?|" + // oct
|
1361
|
-
"[4-7][0-7]?|" + //oct
|
1362
|
-
".)";
|
1363
|
-
|
1364
|
-
// regexp must not have capturing parentheses. Use (?:) instead.
|
1365
|
-
// regexps are ordered -> the first match is used
|
1366
|
-
|
1367
|
-
this.$rules = {
|
1368
|
-
"start" : [
|
1369
|
-
{
|
1370
|
-
token : "comment",
|
1371
|
-
regex : /\/\/.*$/
|
1372
|
-
},
|
1373
|
-
DocCommentHighlightRules.getStartRule("doc-start"),
|
1374
|
-
{
|
1375
|
-
token : "comment", // multi line comment
|
1376
|
-
merge : true,
|
1377
|
-
regex : /\/\*/,
|
1378
|
-
next : "comment"
|
1379
|
-
}, {
|
1380
|
-
token : "string",
|
1381
|
-
regex : "'(?=.)",
|
1382
|
-
next : "qstring"
|
1383
|
-
}, {
|
1384
|
-
token : "string",
|
1385
|
-
regex : '"(?=.)',
|
1386
|
-
next : "qqstring"
|
1387
|
-
}, {
|
1388
|
-
token : "constant.numeric", // hex
|
1389
|
-
regex : /0[xX][0-9a-fA-F]+\b/
|
1390
|
-
}, {
|
1391
|
-
token : "constant.numeric", // float
|
1392
|
-
regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
|
1393
|
-
}, { // match stuff like: Sound.prototype.play = function() { }
|
1394
|
-
token : [
|
1395
|
-
"storage.type",
|
1396
|
-
"punctuation.operator",
|
1397
|
-
"support.function",
|
1398
|
-
"punctuation.operator",
|
1399
|
-
"entity.name.function",
|
1400
|
-
"text",
|
1401
|
-
"keyword.operator",
|
1402
|
-
"text",
|
1403
|
-
"storage.type",
|
1404
|
-
"text",
|
1405
|
-
"paren.lparen"
|
1406
|
-
],
|
1407
|
-
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
|
1408
|
-
next: "function_arguments"
|
1409
|
-
}, { // match stuff like: Sound.prototype.play = myfunc
|
1410
|
-
token : [
|
1411
|
-
"storage.type",
|
1412
|
-
"punctuation.operator",
|
1413
|
-
"support.function",
|
1414
|
-
"punctuation.operator",
|
1415
|
-
"entity.name.function",
|
1416
|
-
"text",
|
1417
|
-
"keyword.operator",
|
1418
|
-
"text"
|
1419
|
-
],
|
1420
|
-
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
|
1421
|
-
next: "function_arguments"
|
1422
|
-
}, { // match stuff like: Sound.play = function() { }
|
1423
|
-
token : [
|
1424
|
-
"storage.type",
|
1425
|
-
"punctuation.operator",
|
1426
|
-
"entity.name.function",
|
1427
|
-
"text",
|
1428
|
-
"keyword.operator",
|
1429
|
-
"text",
|
1430
|
-
"storage.type",
|
1431
|
-
"text",
|
1432
|
-
"paren.lparen"
|
1433
|
-
],
|
1434
|
-
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
|
1435
|
-
next: "function_arguments"
|
1436
|
-
}, { // match stuff like: play = function() { }
|
1437
|
-
token : [
|
1438
|
-
"entity.name.function",
|
1439
|
-
"text",
|
1440
|
-
"keyword.operator",
|
1441
|
-
"text",
|
1442
|
-
"storage.type",
|
1443
|
-
"text",
|
1444
|
-
"paren.lparen"
|
1445
|
-
],
|
1446
|
-
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
|
1447
|
-
next: "function_arguments"
|
1448
|
-
}, { // match regular function like: function myFunc(arg) { }
|
1449
|
-
token : [
|
1450
|
-
"storage.type",
|
1451
|
-
"text",
|
1452
|
-
"entity.name.function",
|
1453
|
-
"text",
|
1454
|
-
"paren.lparen"
|
1455
|
-
],
|
1456
|
-
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
|
1457
|
-
next: "function_arguments"
|
1458
|
-
}, { // match stuff like: foobar: function() { }
|
1459
|
-
token : [
|
1460
|
-
"entity.name.function",
|
1461
|
-
"text",
|
1462
|
-
"punctuation.operator",
|
1463
|
-
"text",
|
1464
|
-
"storage.type",
|
1465
|
-
"text",
|
1466
|
-
"paren.lparen"
|
1467
|
-
],
|
1468
|
-
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
|
1469
|
-
next: "function_arguments"
|
1470
|
-
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
|
1471
|
-
token : [
|
1472
|
-
"text",
|
1473
|
-
"text",
|
1474
|
-
"storage.type",
|
1475
|
-
"text",
|
1476
|
-
"paren.lparen"
|
1477
|
-
],
|
1478
|
-
regex : "(:)(\\s*)(function)(\\s*)(\\()",
|
1479
|
-
next: "function_arguments"
|
1480
|
-
}, {
|
1481
|
-
token : "constant.language.boolean",
|
1482
|
-
regex : /(?:true|false)\b/
|
1483
|
-
}, {
|
1484
|
-
token : "keyword",
|
1485
|
-
regex : "(?:" + kwBeforeRe + ")\\b",
|
1486
|
-
next : "regex_allowed"
|
1487
|
-
}, {
|
1488
|
-
token : ["punctuation.operator", "support.function"],
|
1489
|
-
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
|
1490
|
-
}, {
|
1491
|
-
token : ["punctuation.operator", "support.function.dom"],
|
1492
|
-
regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
|
1493
|
-
}, {
|
1494
|
-
token : ["punctuation.operator", "support.constant"],
|
1495
|
-
regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
|
1496
|
-
}, {
|
1497
|
-
token : ["storage.type", "punctuation.operator", "support.function.firebug"],
|
1498
|
-
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
|
1499
|
-
}, {
|
1500
|
-
token : function(value) {
|
1501
|
-
if (globals.hasOwnProperty(value))
|
1502
|
-
return "variable.language";
|
1503
|
-
else if (deprecated.hasOwnProperty(value))
|
1504
|
-
return "invalid.deprecated";
|
1505
|
-
else if (definitions.hasOwnProperty(value))
|
1506
|
-
return "storage.type";
|
1507
|
-
else if (keywords.hasOwnProperty(value))
|
1508
|
-
return "keyword";
|
1509
|
-
else if (buildinConstants.hasOwnProperty(value))
|
1510
|
-
return "constant.language";
|
1511
|
-
else if (futureReserved.hasOwnProperty(value))
|
1512
|
-
return "invalid.illegal";
|
1513
|
-
else if (value == "debugger")
|
1514
|
-
return "invalid.deprecated";
|
1515
|
-
else
|
1516
|
-
return "identifier";
|
1517
|
-
},
|
1518
|
-
regex : identifierRe
|
1519
|
-
}, {
|
1520
|
-
token : "keyword.operator",
|
1521
|
-
regex : /!|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=|\b(?:in|instanceof|new|delete|typeof|void)/,
|
1522
|
-
next : "regex_allowed"
|
1523
|
-
}, {
|
1524
|
-
token : "punctuation.operator",
|
1525
|
-
regex : /\?|\:|\,|\;|\./,
|
1526
|
-
next : "regex_allowed"
|
1527
|
-
}, {
|
1528
|
-
token : "paren.lparen",
|
1529
|
-
regex : /[\[({]/,
|
1530
|
-
next : "regex_allowed"
|
1531
|
-
}, {
|
1532
|
-
token : "paren.rparen",
|
1533
|
-
regex : /[\])}]/
|
1534
|
-
}, {
|
1535
|
-
token : "keyword.operator",
|
1536
|
-
regex : /\/=?/,
|
1537
|
-
next : "regex_allowed"
|
1538
|
-
}, {
|
1539
|
-
token: "comment",
|
1540
|
-
regex: /^#!.*$/
|
1541
|
-
}, {
|
1542
|
-
token : "text",
|
1543
|
-
regex : /\s+/
|
1544
|
-
}
|
1545
|
-
],
|
1546
|
-
// regular expressions are only allowed after certain tokens. This
|
1547
|
-
// makes sure we don't mix up regexps with the divison operator
|
1548
|
-
"regex_allowed": [
|
1549
|
-
DocCommentHighlightRules.getStartRule("doc-start"),
|
1550
|
-
{
|
1551
|
-
token : "comment", // multi line comment
|
1552
|
-
merge : true,
|
1553
|
-
regex : "\\/\\*",
|
1554
|
-
next : "comment_regex_allowed"
|
1555
|
-
}, {
|
1556
|
-
token : "comment",
|
1557
|
-
regex : "\\/\\/.*$"
|
1558
|
-
}, {
|
1559
|
-
token: "string.regexp",
|
1560
|
-
regex: "\\/",
|
1561
|
-
next: "regex",
|
1562
|
-
merge: true
|
1563
|
-
}, {
|
1564
|
-
token : "text",
|
1565
|
-
regex : "\\s+"
|
1566
|
-
}, {
|
1567
|
-
// immediately return to the start mode without matching
|
1568
|
-
// anything
|
1569
|
-
token: "empty",
|
1570
|
-
regex: "",
|
1571
|
-
next: "start"
|
1572
|
-
}
|
1573
|
-
],
|
1574
|
-
"regex": [
|
1575
|
-
{
|
1576
|
-
token: "regexp.keyword.operator",
|
1577
|
-
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
|
1578
|
-
}, {
|
1579
|
-
// flag
|
1580
|
-
token: "string.regexp",
|
1581
|
-
regex: "/\\w*",
|
1582
|
-
next: "start",
|
1583
|
-
merge: true
|
1584
|
-
}, {
|
1585
|
-
token: "string.regexp",
|
1586
|
-
regex: "[^\\\\/\\[]+",
|
1587
|
-
merge: true
|
1588
|
-
}, {
|
1589
|
-
token: "string.regexp.charachterclass",
|
1590
|
-
regex: "\\[",
|
1591
|
-
next: "regex_character_class",
|
1592
|
-
merge: true
|
1593
|
-
}, {
|
1594
|
-
token: "empty",
|
1595
|
-
regex: "",
|
1596
|
-
next: "start"
|
1597
|
-
}
|
1598
|
-
],
|
1599
|
-
"regex_character_class": [
|
1600
|
-
{
|
1601
|
-
token: "regexp.keyword.operator",
|
1602
|
-
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
|
1603
|
-
}, {
|
1604
|
-
token: "string.regexp.charachterclass",
|
1605
|
-
regex: "]",
|
1606
|
-
next: "regex",
|
1607
|
-
merge: true
|
1608
|
-
}, {
|
1609
|
-
token: "string.regexp.charachterclass",
|
1610
|
-
regex: "[^\\\\\\]]+",
|
1611
|
-
merge: true
|
1612
|
-
}, {
|
1613
|
-
token: "empty",
|
1614
|
-
regex: "",
|
1615
|
-
next: "start"
|
1616
|
-
}
|
1617
|
-
],
|
1618
|
-
"function_arguments": [
|
1619
|
-
{
|
1620
|
-
token: "variable.parameter",
|
1621
|
-
regex: identifierRe,
|
1622
|
-
}, {
|
1623
|
-
token: "punctuation.operator",
|
1624
|
-
regex: "[, ]+",
|
1625
|
-
merge: true
|
1626
|
-
}, {
|
1627
|
-
token: "punctuation.operator",
|
1628
|
-
regex: "$",
|
1629
|
-
merge: true
|
1630
|
-
}, {
|
1631
|
-
token: "empty",
|
1632
|
-
regex: "",
|
1633
|
-
next: "start"
|
1634
|
-
}
|
1635
|
-
],
|
1636
|
-
"comment_regex_allowed" : [
|
1637
|
-
{
|
1638
|
-
token : "comment", // closing comment
|
1639
|
-
regex : ".*?\\*\\/",
|
1640
|
-
merge : true,
|
1641
|
-
next : "regex_allowed"
|
1642
|
-
}, {
|
1643
|
-
token : "comment", // comment spanning whole line
|
1644
|
-
merge : true,
|
1645
|
-
regex : ".+"
|
1646
|
-
}
|
1647
|
-
],
|
1648
|
-
"comment" : [
|
1649
|
-
{
|
1650
|
-
token : "comment", // closing comment
|
1651
|
-
regex : ".*?\\*\\/",
|
1652
|
-
merge : true,
|
1653
|
-
next : "start"
|
1654
|
-
}, {
|
1655
|
-
token : "comment", // comment spanning whole line
|
1656
|
-
merge : true,
|
1657
|
-
regex : ".+"
|
1658
|
-
}
|
1659
|
-
],
|
1660
|
-
"qqstring" : [
|
1661
|
-
{
|
1662
|
-
token : "constant.language.escape",
|
1663
|
-
regex : escapedRe
|
1664
|
-
}, {
|
1665
|
-
token : "string",
|
1666
|
-
regex : '[^"\\\\]+',
|
1667
|
-
merge : true
|
1668
|
-
}, {
|
1669
|
-
token : "string",
|
1670
|
-
regex : "\\\\$",
|
1671
|
-
next : "qqstring",
|
1672
|
-
merge : true
|
1673
|
-
}, {
|
1674
|
-
token : "string",
|
1675
|
-
regex : '"|$',
|
1676
|
-
next : "start",
|
1677
|
-
merge : true
|
1678
|
-
}
|
1679
|
-
],
|
1680
|
-
"qstring" : [
|
1681
|
-
{
|
1682
|
-
token : "constant.language.escape",
|
1683
|
-
regex : escapedRe
|
1684
|
-
}, {
|
1685
|
-
token : "string",
|
1686
|
-
regex : "[^'\\\\]+",
|
1687
|
-
merge : true
|
1688
|
-
}, {
|
1689
|
-
token : "string",
|
1690
|
-
regex : "\\\\$",
|
1691
|
-
next : "qstring",
|
1692
|
-
merge : true
|
1693
|
-
}, {
|
1694
|
-
token : "string",
|
1695
|
-
regex : "'|$",
|
1696
|
-
next : "start",
|
1697
|
-
merge : true
|
1698
|
-
}
|
1699
|
-
]
|
1700
|
-
};
|
1701
|
-
|
1702
|
-
this.embedRules(DocCommentHighlightRules, "doc-",
|
1703
|
-
[ DocCommentHighlightRules.getEndRule("start") ]);
|
1704
|
-
};
|
1705
|
-
|
1706
|
-
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
|
1707
|
-
|
1708
|
-
exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
|
1709
|
-
});
|
1710
|
-
/* ***** BEGIN LICENSE BLOCK *****
|
1711
|
-
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
1712
|
-
*
|
1713
|
-
* The contents of this file are subject to the Mozilla Public License Version
|
1714
|
-
* 1.1 (the "License"); you may not use this file except in compliance with
|
1715
|
-
* the License. You may obtain a copy of the License at
|
1716
|
-
* http://www.mozilla.org/MPL/
|
1717
|
-
*
|
1718
|
-
* Software distributed under the License is distributed on an "AS IS" basis,
|
1719
|
-
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
1720
|
-
* for the specific language governing rights and limitations under the
|
1721
|
-
* License.
|
1722
|
-
*
|
1723
|
-
* The Original Code is Ajax.org Code Editor (ACE).
|
1724
|
-
*
|
1725
|
-
* The Initial Developer of the Original Code is
|
1726
|
-
* Ajax.org B.V.
|
1727
|
-
* Portions created by the Initial Developer are Copyright (C) 2010
|
1728
|
-
* the Initial Developer. All Rights Reserved.
|
1729
|
-
*
|
1730
|
-
* Contributor(s):
|
1731
|
-
* Fabian Jakobs <fabian AT ajax DOT org>
|
1732
|
-
*
|
1733
|
-
* Alternatively, the contents of this file may be used under the terms of
|
1734
|
-
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
1735
|
-
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
1736
|
-
* in which case the provisions of the GPL or the LGPL are applicable instead
|
1737
|
-
* of those above. If you wish to allow use of your version of this file only
|
1738
|
-
* under the terms of either the GPL or the LGPL, and not to allow others to
|
1739
|
-
* use your version of this file under the terms of the MPL, indicate your
|
1740
|
-
* decision by deleting the provisions above and replace them with the notice
|
1741
|
-
* and other provisions required by the GPL or the LGPL. If you do not delete
|
1742
|
-
* the provisions above, a recipient may use your version of this file under
|
1743
|
-
* the terms of any one of the MPL, the GPL or the LGPL.
|
1744
|
-
*
|
1745
|
-
* ***** END LICENSE BLOCK ***** */
|
1746
|
-
|
1747
|
-
define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
|
1748
|
-
"use strict";
|
1749
|
-
|
1750
|
-
var oop = require("../lib/oop");
|
1751
|
-
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
1752
|
-
|
1753
|
-
var DocCommentHighlightRules = function() {
|
1754
|
-
|
1755
|
-
this.$rules = {
|
1756
|
-
"start" : [ {
|
1757
|
-
token : "comment.doc.tag",
|
1758
|
-
regex : "@[\\w\\d_]+" // TODO: fix email addresses
|
1759
|
-
}, {
|
1760
|
-
token : "comment.doc",
|
1761
|
-
merge : true,
|
1762
|
-
regex : "\\s+"
|
1763
|
-
}, {
|
1764
|
-
token : "comment.doc",
|
1765
|
-
merge : true,
|
1766
|
-
regex : "TODO"
|
1767
|
-
}, {
|
1768
|
-
token : "comment.doc",
|
1769
|
-
merge : true,
|
1770
|
-
regex : "[^@\\*]+"
|
1771
|
-
}, {
|
1772
|
-
token : "comment.doc",
|
1773
|
-
merge : true,
|
1774
|
-
regex : "."
|
1775
|
-
}]
|
1776
|
-
};
|
1777
|
-
};
|
1778
|
-
|
1779
|
-
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
|
1780
|
-
|
1781
|
-
DocCommentHighlightRules.getStartRule = function(start) {
|
1782
|
-
return {
|
1783
|
-
token : "comment.doc", // doc comment
|
1784
|
-
merge : true,
|
1785
|
-
regex : "\\/\\*(?=\\*)",
|
1786
|
-
next : start
|
1787
|
-
};
|
1788
|
-
};
|
1789
|
-
|
1790
|
-
DocCommentHighlightRules.getEndRule = function (start) {
|
1791
|
-
return {
|
1792
|
-
token : "comment.doc", // closing comment
|
1793
|
-
merge : true,
|
1794
|
-
regex : "\\*\\/",
|
1795
|
-
next : start
|
1796
|
-
};
|
1797
|
-
};
|
1798
|
-
|
1799
|
-
|
1800
|
-
exports.DocCommentHighlightRules = DocCommentHighlightRules;
|
1801
|
-
|
1802
|
-
});
|
1803
|
-
/* ***** BEGIN LICENSE BLOCK *****
|
1804
|
-
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
1805
|
-
*
|
1806
|
-
* The contents of this file are subject to the Mozilla Public License Version
|
1807
|
-
* 1.1 (the "License"); you may not use this file except in compliance with
|
1808
|
-
* the License. You may obtain a copy of the License at
|
1809
|
-
* http://www.mozilla.org/MPL/
|
1810
|
-
*
|
1811
|
-
* Software distributed under the License is distributed on an "AS IS" basis,
|
1812
|
-
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
1813
|
-
* for the specific language governing rights and limitations under the
|
1814
|
-
* License.
|
1815
|
-
*
|
1816
|
-
* The Original Code is Ajax.org Code Editor (ACE).
|
1817
|
-
*
|
1818
|
-
* The Initial Developer of the Original Code is
|
1819
|
-
* Ajax.org B.V.
|
1820
|
-
* Portions created by the Initial Developer are Copyright (C) 2010
|
1821
|
-
* the Initial Developer. All Rights Reserved.
|
1822
|
-
*
|
1823
|
-
* Contributor(s):
|
1824
|
-
* Fabian Jakobs <fabian AT ajax DOT org>
|
1825
|
-
*
|
1826
|
-
* Alternatively, the contents of this file may be used under the terms of
|
1827
|
-
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
1828
|
-
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
1829
|
-
* in which case the provisions of the GPL or the LGPL are applicable instead
|
1830
|
-
* of those above. If you wish to allow use of your version of this file only
|
1831
|
-
* under the terms of either the GPL or the LGPL, and not to allow others to
|
1832
|
-
* use your version of this file under the terms of the MPL, indicate your
|
1833
|
-
* decision by deleting the provisions above and replace them with the notice
|
1834
|
-
* and other provisions required by the GPL or the LGPL. If you do not delete
|
1835
|
-
* the provisions above, a recipient may use your version of this file under
|
1836
|
-
* the terms of any one of the MPL, the GPL or the LGPL.
|
1837
|
-
*
|
1838
|
-
* ***** END LICENSE BLOCK ***** */
|
1839
|
-
|
1840
|
-
define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
|
1841
|
-
"use strict";
|
1842
|
-
|
1843
|
-
var Range = require("../range").Range;
|
1844
|
-
|
1845
|
-
var MatchingBraceOutdent = function() {};
|
1846
|
-
|
1847
|
-
(function() {
|
1848
|
-
|
1849
|
-
this.checkOutdent = function(line, input) {
|
1850
|
-
if (! /^\s+$/.test(line))
|
1851
|
-
return false;
|
1852
|
-
|
1853
|
-
return /^\s*\}/.test(input);
|
1854
|
-
};
|
1855
|
-
|
1856
|
-
this.autoOutdent = function(doc, row) {
|
1857
|
-
var line = doc.getLine(row);
|
1858
|
-
var match = line.match(/^(\s*\})/);
|
1859
|
-
|
1860
|
-
if (!match) return 0;
|
1861
|
-
|
1862
|
-
var column = match[1].length;
|
1863
|
-
var openBracePos = doc.findMatchingBracket({row: row, column: column});
|
1864
|
-
|
1865
|
-
if (!openBracePos || openBracePos.row == row) return 0;
|
1866
|
-
|
1867
|
-
var indent = this.$getIndent(doc.getLine(openBracePos.row));
|
1868
|
-
doc.replace(new Range(row, 0, row, column-1), indent);
|
1869
|
-
};
|
1870
|
-
|
1871
|
-
this.$getIndent = function(line) {
|
1872
|
-
var match = line.match(/^(\s+)/);
|
1873
|
-
if (match) {
|
1874
|
-
return match[1];
|
1875
|
-
}
|
1876
|
-
|
1877
|
-
return "";
|
1878
|
-
};
|
1879
|
-
|
1880
|
-
}).call(MatchingBraceOutdent.prototype);
|
1881
|
-
|
1882
|
-
exports.MatchingBraceOutdent = MatchingBraceOutdent;
|
1883
|
-
});
|
1884
|
-
/* ***** BEGIN LICENSE BLOCK *****
|
1885
|
-
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
1886
|
-
*
|
1887
|
-
* The contents of this file are subject to the Mozilla Public License Version
|
1888
|
-
* 1.1 (the "License"); you may not use this file except in compliance with
|
1889
|
-
* the License. You may obtain a copy of the License at
|
1890
|
-
* http://www.mozilla.org/MPL/
|
1891
|
-
*
|
1892
|
-
* Software distributed under the License is distributed on an "AS IS" basis,
|
1893
|
-
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
1894
|
-
* for the specific language governing rights and limitations under the
|
1895
|
-
* License.
|
1896
|
-
*
|
1897
|
-
* The Original Code is Ajax.org Code Editor (ACE).
|
1898
|
-
*
|
1899
|
-
* The Initial Developer of the Original Code is
|
1900
|
-
* Ajax.org B.V.
|
1901
|
-
* Portions created by the Initial Developer are Copyright (C) 2010
|
1902
|
-
* the Initial Developer. All Rights Reserved.
|
1903
|
-
*
|
1904
|
-
* Contributor(s):
|
1905
|
-
* Fabian Jakobs <fabian AT ajax DOT org>
|
1906
|
-
*
|
1907
|
-
* Alternatively, the contents of this file may be used under the terms of
|
1908
|
-
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
1909
|
-
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
1910
|
-
* in which case the provisions of the GPL or the LGPL are applicable instead
|
1911
|
-
* of those above. If you wish to allow use of your version of this file only
|
1912
|
-
* under the terms of either the GPL or the LGPL, and not to allow others to
|
1913
|
-
* use your version of this file under the terms of the MPL, indicate your
|
1914
|
-
* decision by deleting the provisions above and replace them with the notice
|
1915
|
-
* and other provisions required by the GPL or the LGPL. If you do not delete
|
1916
|
-
* the provisions above, a recipient may use your version of this file under
|
1917
|
-
* the terms of any one of the MPL, the GPL or the LGPL.
|
1918
|
-
*
|
1919
|
-
* ***** END LICENSE BLOCK ***** */
|
1920
|
-
|
1921
|
-
define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
|
1922
|
-
"use strict";
|
1923
|
-
|
1924
|
-
var oop = require("../../lib/oop");
|
1925
|
-
var Range = require("../../range").Range;
|
1926
|
-
var BaseFoldMode = require("./fold_mode").FoldMode;
|
1927
|
-
|
1928
|
-
var FoldMode = exports.FoldMode = function() {};
|
1929
|
-
oop.inherits(FoldMode, BaseFoldMode);
|
1930
|
-
|
1931
|
-
(function() {
|
1932
|
-
|
1933
|
-
this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
|
1934
|
-
this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
|
1935
|
-
|
1936
|
-
this.getFoldWidgetRange = function(session, foldStyle, row) {
|
1937
|
-
var line = session.getLine(row);
|
1938
|
-
var match = line.match(this.foldingStartMarker);
|
1939
|
-
if (match) {
|
1940
|
-
var i = match.index;
|
1941
|
-
|
1942
|
-
if (match[1])
|
1943
|
-
return this.openingBracketBlock(session, match[1], row, i);
|
1944
|
-
|
1945
|
-
var range = session.getCommentFoldRange(row, i + match[0].length);
|
1946
|
-
range.end.column -= 2;
|
1947
|
-
return range;
|
1948
|
-
}
|
1949
|
-
|
1950
|
-
if (foldStyle !== "markbeginend")
|
1951
|
-
return;
|
1952
|
-
|
1953
|
-
var match = line.match(this.foldingStopMarker);
|
1954
|
-
if (match) {
|
1955
|
-
var i = match.index + match[0].length;
|
1956
|
-
|
1957
|
-
if (match[2]) {
|
1958
|
-
var range = session.getCommentFoldRange(row, i);
|
1959
|
-
range.end.column -= 2;
|
1960
|
-
return range;
|
1961
|
-
}
|
1962
|
-
|
1963
|
-
var end = {row: row, column: i};
|
1964
|
-
var start = session.$findOpeningBracket(match[1], end);
|
1965
|
-
|
1966
|
-
if (!start)
|
1967
|
-
return;
|
1968
|
-
|
1969
|
-
start.column++;
|
1970
|
-
end.column--;
|
1971
|
-
|
1972
|
-
return Range.fromPoints(start, end);
|
1973
|
-
}
|
1974
|
-
};
|
1975
|
-
|
1976
|
-
}).call(FoldMode.prototype);
|
1977
|
-
|
1978
|
-
});
|
1979
|
-
/* ***** BEGIN LICENSE BLOCK *****
|
1980
|
-
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
1981
|
-
*
|
1982
|
-
* The contents of this file are subject to the Mozilla Public License Version
|
1983
|
-
* 1.1 (the "License"); you may not use this file except in compliance with
|
1984
|
-
* the License. You may obtain a copy of the License at
|
1985
|
-
* http://www.mozilla.org/MPL/
|
1986
|
-
*
|
1987
|
-
* Software distributed under the License is distributed on an "AS IS" basis,
|
1988
|
-
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
1989
|
-
* for the specific language governing rights and limitations under the
|
1990
|
-
* License.
|
1991
|
-
*
|
1992
|
-
* The Original Code is Ajax.org Code Editor (ACE).
|
1993
|
-
*
|
1994
|
-
* The Initial Developer of the Original Code is
|
1995
|
-
* Ajax.org B.V.
|
1996
|
-
* Portions created by the Initial Developer are Copyright (C) 2010
|
1997
|
-
* the Initial Developer. All Rights Reserved.
|
1998
|
-
*
|
1999
|
-
* Contributor(s):
|
2000
|
-
* Fabian Jakobs <fabian AT ajax DOT org>
|
2001
|
-
*
|
2002
|
-
* Alternatively, the contents of this file may be used under the terms of
|
2003
|
-
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
2004
|
-
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
2005
|
-
* in which case the provisions of the GPL or the LGPL are applicable instead
|
2006
|
-
* of those above. If you wish to allow use of your version of this file only
|
2007
|
-
* under the terms of either the GPL or the LGPL, and not to allow others to
|
2008
|
-
* use your version of this file under the terms of the MPL, indicate your
|
2009
|
-
* decision by deleting the provisions above and replace them with the notice
|
2010
|
-
* and other provisions required by the GPL or the LGPL. If you do not delete
|
2011
|
-
* the provisions above, a recipient may use your version of this file under
|
2012
|
-
* the terms of any one of the MPL, the GPL or the LGPL.
|
2013
|
-
*
|
2014
|
-
* ***** END LICENSE BLOCK ***** */
|
2015
|
-
|
2016
|
-
define('ace/mode/svg_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_highlight_rules', 'ace/mode/xml_util'], function(require, exports, module) {
|
2017
|
-
"use strict";
|
2018
|
-
|
2019
|
-
var oop = require("../lib/oop");
|
2020
|
-
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
|
2021
|
-
var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
|
2022
|
-
var xmlUtil = require("./xml_util");
|
2023
|
-
|
2024
|
-
var SvgHighlightRules = function() {
|
2025
|
-
XmlHighlightRules.call(this);
|
2026
|
-
|
2027
|
-
this.$rules.start.splice(3, 0, {
|
2028
|
-
token : "meta.tag",
|
2029
|
-
regex : "<(?=\s*script)",
|
2030
|
-
next : "script"
|
2031
|
-
});
|
2032
|
-
|
2033
|
-
xmlUtil.tag(this.$rules, "script", "js-start");
|
2034
|
-
|
2035
|
-
this.embedRules(JavaScriptHighlightRules, "js-", [{
|
2036
|
-
token: "comment",
|
2037
|
-
regex: "\\/\\/.*(?=<\\/script>)",
|
2038
|
-
next: "tag"
|
2039
|
-
}, {
|
2040
|
-
token: "meta.tag",
|
2041
|
-
regex: "<\\/(?=script)",
|
2042
|
-
next: "tag"
|
2043
|
-
}]);
|
2044
|
-
};
|
2045
|
-
|
2046
|
-
oop.inherits(SvgHighlightRules, XmlHighlightRules);
|
2047
|
-
|
2048
|
-
exports.SvgHighlightRules = SvgHighlightRules;
|
2049
|
-
});
|
2050
|
-
/* ***** BEGIN LICENSE BLOCK *****
|
2051
|
-
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
2052
|
-
*
|
2053
|
-
* The contents of this file are subject to the Mozilla Public License Version
|
2054
|
-
* 1.1 (the "License"); you may not use this file except in compliance with
|
2055
|
-
* the License. You may obtain a copy of the License at
|
2056
|
-
* http://www.mozilla.org/MPL/
|
2057
|
-
*
|
2058
|
-
* Software distributed under the License is distributed on an "AS IS" basis,
|
2059
|
-
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
2060
|
-
* for the specific language governing rights and limitations under the
|
2061
|
-
* License.
|
2062
|
-
*
|
2063
|
-
* The Original Code is Ajax.org Code Editor (ACE).
|
2064
|
-
*
|
2065
|
-
* The Initial Developer of the Original Code is
|
2066
|
-
* Ajax.org B.V.
|
2067
|
-
* Portions created by the Initial Developer are Copyright (C) 2010
|
2068
|
-
* the Initial Developer. All Rights Reserved.
|
2069
|
-
*
|
2070
|
-
* Contributor(s):
|
2071
|
-
* Fabian Jakobs <fabian AT ajax DOT org>
|
2072
|
-
*
|
2073
|
-
* Alternatively, the contents of this file may be used under the terms of
|
2074
|
-
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
2075
|
-
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
2076
|
-
* in which case the provisions of the GPL or the LGPL are applicable instead
|
2077
|
-
* of those above. If you wish to allow use of your version of this file only
|
2078
|
-
* under the terms of either the GPL or the LGPL, and not to allow others to
|
2079
|
-
* use your version of this file under the terms of the MPL, indicate your
|
2080
|
-
* decision by deleting the provisions above and replace them with the notice
|
2081
|
-
* and other provisions required by the GPL or the LGPL. If you do not delete
|
2082
|
-
* the provisions above, a recipient may use your version of this file under
|
2083
|
-
* the terms of any one of the MPL, the GPL or the LGPL.
|
2084
|
-
*
|
2085
|
-
* ***** END LICENSE BLOCK ***** */
|
2086
|
-
|
2087
|
-
define('ace/mode/folding/mixed', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
|
2088
|
-
"use strict";
|
2089
|
-
|
2090
|
-
var oop = require("../../lib/oop");
|
2091
|
-
var BaseFoldMode = require("./fold_mode").FoldMode;
|
2092
|
-
|
2093
|
-
var FoldMode = exports.FoldMode = function(defaultMode, subModes) {
|
2094
|
-
this.defaultMode = defaultMode;
|
2095
|
-
this.subModes = subModes;
|
2096
|
-
};
|
2097
|
-
oop.inherits(FoldMode, BaseFoldMode);
|
2098
|
-
|
2099
|
-
(function() {
|
2100
|
-
|
2101
|
-
|
2102
|
-
this.$getMode = function(state) {
|
2103
|
-
for (var key in this.subModes) {
|
2104
|
-
if (state.indexOf(key) === 0)
|
2105
|
-
return this.subModes[key];
|
2106
|
-
}
|
2107
|
-
return null;
|
2108
|
-
};
|
2109
|
-
|
2110
|
-
this.$tryMode = function(state, session, foldStyle, row) {
|
2111
|
-
var mode = this.$getMode(state);
|
2112
|
-
return (mode ? mode.getFoldWidget(session, foldStyle, row) : "");
|
2113
|
-
};
|
2114
|
-
|
2115
|
-
this.getFoldWidget = function(session, foldStyle, row) {
|
2116
|
-
return (
|
2117
|
-
this.$tryMode(session.getState(row-1), session, foldStyle, row) ||
|
2118
|
-
this.$tryMode(session.getState(row), session, foldStyle, row) ||
|
2119
|
-
this.defaultMode.getFoldWidget(session, foldStyle, row)
|
2120
|
-
);
|
2121
|
-
};
|
2122
|
-
|
2123
|
-
this.getFoldWidgetRange = function(session, foldStyle, row) {
|
2124
|
-
var mode = this.$getMode(session.getState(row-1));
|
2125
|
-
|
2126
|
-
if (!mode || !mode.getFoldWidget(session, foldStyle, row))
|
2127
|
-
mode = this.$getMode(session.getState(row));
|
2128
|
-
|
2129
|
-
if (!mode || !mode.getFoldWidget(session, foldStyle, row))
|
2130
|
-
mode = this.defaultMode;
|
2131
|
-
|
2132
|
-
return mode.getFoldWidgetRange(session, foldStyle, row);
|
2133
|
-
};
|
2134
|
-
|
2135
|
-
}).call(FoldMode.prototype);
|
2136
|
-
|
2137
|
-
});
|