├── .travis.yml ├── lib ├── ace │ ├── mouse │ │ ├── dragdrop.js │ │ ├── default_gutter_handler.js │ │ └── fold_handler.js │ ├── css │ │ ├── expand-marker.png │ │ └── codefolding-fold-button-states.png │ ├── test │ │ ├── asyncjs │ │ │ ├── index.js │ │ │ └── utils.js │ │ ├── mockdom.js │ │ ├── tests.html │ │ ├── all.js │ │ ├── assertions.js │ │ └── benchmark.js │ ├── ext │ │ ├── static.css │ │ └── static_highlight_test.js │ ├── mode │ │ ├── groovy.js │ │ ├── java.js │ │ ├── scala.js │ │ ├── latex_highlight_rules.js │ │ ├── csharp.js │ │ ├── powershell.js │ │ ├── haxe.js │ │ ├── latex.js │ │ ├── sql.js │ │ ├── css_worker.js │ │ ├── coffee │ │ │ ├── coffee-script.js │ │ │ ├── parser_test.js │ │ │ └── helpers.js │ │ ├── xml.js │ │ ├── folding │ │ │ ├── pythonic.js │ │ │ └── html.js │ │ ├── coldfusion.js │ │ ├── text_test.js │ │ ├── svg_highlight_rules.js │ │ ├── css_worker_test.js │ │ ├── textile.js │ │ ├── coffee_tokenizer_test.js │ │ ├── matching_brace_outdent.js │ │ ├── svg.js │ │ ├── matching_parens_outdent.js │ │ ├── pgsql.js │ │ ├── html_test.js │ │ ├── coldfusion_test.js │ │ ├── html.js │ │ ├── json.js │ │ ├── markdown.js │ │ ├── lua.js │ │ ├── scss.js │ │ ├── javascript_worker_test.js │ │ ├── xml_test.js │ │ ├── sql_highlight_rules.js │ │ ├── coffee_worker.js │ │ └── doc_comment_highlight_rules.js │ ├── lib │ │ ├── fixoldbrowsers.js │ │ ├── net.js │ │ ├── oop.js │ │ └── event_emitter_test.js │ ├── worker │ │ └── mirror.js │ ├── requirejs │ │ └── text.js │ ├── model │ │ └── editor.js │ ├── renderloop.js │ ├── ace.js │ └── undomanager.js └── pilot │ ├── dom.js │ ├── keys.js │ ├── lang.js │ ├── oop.js │ ├── event.js │ ├── useragent.js │ ├── browser_focus.js │ ├── event_emitter.js │ ├── fixoldbrowsers.js │ ├── index.js │ └── canon.js ├── experiments ├── zenbg.png ├── worker.js ├── worker.html ├── triple_click.html ├── capture.html └── cut_copy.html ├── doc ├── site │ ├── images │ │ ├── ace.png │ │ ├── logo.png │ │ ├── bottombar.png │ │ ├── background.png │ │ ├── fork_on_github.png │ │ └── body_background.png │ └── iphone.css ├── Contributor_License_Agreement-v2.pdf └── Corporate_Contributor_License_Agreement-v2.pdf ├── .gitmodules ├── demo ├── kitchen-sink │ ├── logo.png │ ├── icons │ │ ├── error_obj.gif │ │ ├── warning_obj.gif │ │ └── Readme.txt │ ├── docs │ │ ├── csharp.cs │ │ ├── coldfusion.cfm │ │ ├── javascript.js │ │ ├── sql.sql │ │ ├── ruby.rb │ │ ├── cpp.cpp │ │ ├── html.html │ │ ├── scala.scala │ │ ├── php.php │ │ ├── java.java │ │ ├── scss.scss │ │ ├── coffeescript.coffee │ │ ├── Haxe.hx │ │ ├── textile.textile │ │ ├── powershell.ps1 │ │ ├── python.py │ │ ├── groovy.groovy │ │ ├── css.css │ │ ├── ocaml.ml │ │ ├── perl.pl │ │ ├── glsl.frag │ │ ├── clojure.clj │ │ ├── latex.tex │ │ ├── lua.lua │ │ ├── json.json │ │ ├── pgsql.pgsql │ │ ├── xml.xml │ │ ├── plaintext.txt │ │ └── svg.svg │ └── styles.css └── static-highlighter │ ├── server.js │ └── client.html ├── version.js ├── .gitignore ├── tool ├── tmthemes │ └── LICENSE └── theme.tmpl.js ├── Makefile ├── package.json └── static.js /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js -------------------------------------------------------------------------------- /lib/ace/mouse/dragdrop.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /experiments/zenbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emackey/ace/master/experiments/zenbg.png -------------------------------------------------------------------------------- /doc/site/images/ace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emackey/ace/master/doc/site/images/ace.png -------------------------------------------------------------------------------- /doc/site/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emackey/ace/master/doc/site/images/logo.png -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "doc/wiki"] 2 | path = doc/wiki 3 | url = git://github.com/ajaxorg/ace.wiki.git -------------------------------------------------------------------------------- /demo/kitchen-sink/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emackey/ace/master/demo/kitchen-sink/logo.png -------------------------------------------------------------------------------- /experiments/worker.js: -------------------------------------------------------------------------------- 1 | onmessage = function(e) { 2 | onmessage = new Function("e", e.data); 3 | }; -------------------------------------------------------------------------------- /doc/site/images/bottombar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emackey/ace/master/doc/site/images/bottombar.png -------------------------------------------------------------------------------- /lib/ace/css/expand-marker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emackey/ace/master/lib/ace/css/expand-marker.png -------------------------------------------------------------------------------- /doc/site/images/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emackey/ace/master/doc/site/images/background.png -------------------------------------------------------------------------------- /doc/site/images/fork_on_github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emackey/ace/master/doc/site/images/fork_on_github.png -------------------------------------------------------------------------------- /demo/kitchen-sink/icons/error_obj.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emackey/ace/master/demo/kitchen-sink/icons/error_obj.gif -------------------------------------------------------------------------------- /doc/site/images/body_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emackey/ace/master/doc/site/images/body_background.png -------------------------------------------------------------------------------- /demo/kitchen-sink/docs/csharp.cs: -------------------------------------------------------------------------------- 1 | public void HelloWorld() { 2 | //Say Hello! 3 | Console.WriteLine("Hello World"); 4 | } -------------------------------------------------------------------------------- /demo/kitchen-sink/icons/warning_obj.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emackey/ace/master/demo/kitchen-sink/icons/warning_obj.gif -------------------------------------------------------------------------------- /doc/Contributor_License_Agreement-v2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emackey/ace/master/doc/Contributor_License_Agreement-v2.pdf -------------------------------------------------------------------------------- /demo/kitchen-sink/docs/coldfusion.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | #welcome# -------------------------------------------------------------------------------- /lib/ace/css/codefolding-fold-button-states.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emackey/ace/master/lib/ace/css/codefolding-fold-button-states.png -------------------------------------------------------------------------------- /version.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var x; 3 | eval("x= " + require("fs").readFileSync(__dirname + "/package.json")) 4 | console.log(x.version) -------------------------------------------------------------------------------- /demo/kitchen-sink/icons/Readme.txt: -------------------------------------------------------------------------------- 1 | The icons in this folder are from the Eclipse project and licensed under the Eclipse public license version 1.0 (EPL). -------------------------------------------------------------------------------- /doc/Corporate_Contributor_License_Agreement-v2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emackey/ace/master/doc/Corporate_Contributor_License_Agreement-v2.pdf -------------------------------------------------------------------------------- /demo/kitchen-sink/docs/javascript.js: -------------------------------------------------------------------------------- 1 | function foo(items) { 2 | for (var i=0; i '2011-05-21' 5 | GROUP BY 1 6 | ORDER BY 2 DESC -------------------------------------------------------------------------------- /demo/kitchen-sink/docs/ruby.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/ruby 2 | 3 | # Program to find the factorial of a number 4 | def fact(n) 5 | if n == 0 6 | 1 7 | else 8 | n * fact(n-1) 9 | end 10 | end 11 | 12 | puts fact(ARGV[0].to_i) -------------------------------------------------------------------------------- /demo/kitchen-sink/docs/cpp.cpp: -------------------------------------------------------------------------------- 1 | // compound assignment operators 2 | 3 | #include 4 | using namespace std; 5 | 6 | int main () 7 | { 8 | int a, b=3; /* foobar */ 9 | a = b; 10 | a+=2; // equivalent to a=a+2 11 | cout << a; 12 | return 0; 13 | } -------------------------------------------------------------------------------- /lib/ace/test/asyncjs/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * async.js 3 | * Copyright(c) 2010 Fabian Jakobs 4 | * MIT Licensed 5 | */ 6 | 7 | define(function(require, exports, module) { 8 | 9 | module.exports = require("./async") 10 | module.exports.test = require("./test") 11 | require("./utils") 12 | 13 | }) -------------------------------------------------------------------------------- /demo/kitchen-sink/docs/html.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | 13 | 14 |

Juhu Kinners

15 | 16 | -------------------------------------------------------------------------------- /lib/ace/test/mockdom.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var dom = require('jsdom/lib/jsdom/level2/html').dom.level2.html; 4 | var browser = require('jsdom/lib/jsdom/browser/index').windowAugmentation(dom); 5 | 6 | global.document = browser.document; 7 | global.window = browser.window; 8 | global.self = browser.self; 9 | global.navigator = browser.navigator; 10 | global.location = browser.location; -------------------------------------------------------------------------------- /doc/site/iphone.css: -------------------------------------------------------------------------------- 1 | #wrapper { 2 | position:relative; 3 | overflow:hidden; 4 | } 5 | 6 | #wrapper .content .column1 { 7 | margin:0 16px 0 15px; 8 | } 9 | 10 | #header .content .signature { 11 | font-size:18px; 12 | bottom:0; 13 | } 14 | 15 | UL.menu-list LI { 16 | font-size:22px; 17 | } 18 | 19 | UL.menu-footer LI { 20 | font-size:22px; 21 | } 22 | 23 | PRE{ 24 | font-size:22px; 25 | } 26 | -------------------------------------------------------------------------------- /demo/kitchen-sink/docs/scala.scala: -------------------------------------------------------------------------------- 1 | //http://www.scala-lang.org/node/227 2 | /* Defines a new method 'sort' for array objects */ 3 | object implicits extends Application { 4 | implicit def arrayWrapper[A : ClassManifest](x: Array[A]) = 5 | new { 6 | def sort(p: (A, A) => Boolean) = { 7 | util.Sorting.stableSort(x, p); x 8 | } 9 | } 10 | val x = Array(2, 3, 1, 4) 11 | println("x = "+ x.sort((x: Int, y: Int) => x < y)) 12 | } -------------------------------------------------------------------------------- /demo/kitchen-sink/docs/php.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /demo/kitchen-sink/docs/java.java: -------------------------------------------------------------------------------- 1 | public class InfiniteLoop { 2 | 3 | /* 4 | * This will cause the program to hang... 5 | * 6 | * Taken from: 7 | * http://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308/ 8 | */ 9 | public static void main(String[] args) { 10 | double d = Double.parseDouble("2.2250738585072012e-308"); 11 | 12 | // unreachable code 13 | System.out.println("Value: " + d); 14 | } 15 | } -------------------------------------------------------------------------------- /demo/kitchen-sink/docs/scss.scss: -------------------------------------------------------------------------------- 1 | /* style.scss */ 2 | 3 | #navbar { 4 | $navbar-width: 800px; 5 | $items: 5; 6 | $navbar-color: #ce4dd6; 7 | 8 | width: $navbar-width; 9 | border-bottom: 2px solid $navbar-color; 10 | 11 | li { 12 | float: left; 13 | width: $navbar-width/$items - 10px; 14 | 15 | background-color: lighten($navbar-color, 20%); 16 | &:hover { 17 | background-color: lighten($navbar-color, 10%); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /demo/kitchen-sink/docs/coffeescript.coffee: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env coffee 2 | 3 | try 4 | throw URIError decodeURI(0xC0ffee * 123456.7e-8 / .9) 5 | catch e 6 | console.log 'qstring' + "qqstring" + ''' 7 | qdoc 8 | ''' + """ 9 | qqdoc 10 | """ 11 | 12 | do -> 13 | ### 14 | herecomment 15 | ### 16 | re = /regex/imgy.test /// 17 | heregex # comment 18 | ///imgy 19 | this isnt: `just JavaScript` 20 | undefined 21 | 22 | sentence = "#{ 22 / 7 } is a decent approximation of π" -------------------------------------------------------------------------------- /demo/kitchen-sink/docs/Haxe.hx: -------------------------------------------------------------------------------- 1 | class Haxe 2 | { 3 | public static function main() 4 | { 5 | // Say Hello! 6 | var greeting:String = "Hello World"; 7 | trace(greeting); 8 | 9 | var targets:Array = ["Flash","Javascript","PHP","Neko","C++","iOS","Android","webOS"]; 10 | trace("Haxe is a great language that can target:"); 11 | for (target in targets) 12 | { 13 | trace (" - " + target); 14 | } 15 | trace("And many more!"); 16 | } 17 | } -------------------------------------------------------------------------------- /demo/kitchen-sink/docs/textile.textile: -------------------------------------------------------------------------------- 1 | h1. Textile document 2 | 3 | h2. Heading Two 4 | 5 | h3. A two-line 6 | header 7 | 8 | h2. Another two-line 9 | header 10 | 11 | Paragraph: 12 | one, two, 13 | thee lines! 14 | 15 | p(classone two three). This is a paragraph with classes 16 | 17 | p(#id). (one with an id) 18 | 19 | p(one two three#my_id). ..classes + id 20 | 21 | * Unordered list 22 | ** sublist 23 | * back again! 24 | ** sublist again.. 25 | 26 | # ordered 27 | 28 | bg. Blockquote! 29 | This is a two-list blockquote..! -------------------------------------------------------------------------------- /lib/ace/ext/static.css: -------------------------------------------------------------------------------- 1 | .ace_editor { 2 | font-family: 'Monaco', 'Menlo', 'Droid Sans Mono', 'Courier New', monospace; 3 | font-size: 12px; 4 | } 5 | 6 | .ace_editor .ace_gutter { 7 | width: 25px !important; 8 | display: block; 9 | float: left; 10 | text-align: right; 11 | padding: 0 3px 0 0; 12 | margin-right: 3px; 13 | } 14 | 15 | .ace_line { clear: both; } 16 | 17 | *.ace_gutter-cell { 18 | -moz-user-select: -moz-none; 19 | -khtml-user-select: none; 20 | -webkit-user-select: none; 21 | user-select: none; 22 | } -------------------------------------------------------------------------------- /demo/kitchen-sink/docs/powershell.ps1: -------------------------------------------------------------------------------- 1 | # This is a simple comment 2 | function Hello($name) { 3 | Write-host "Hello $name" 4 | } 5 | 6 | function add($left, $right=4) { 7 | if ($right -ne 4) { 8 | return $left 9 | } elseif ($left -eq $null -and $right -eq 2) { 10 | return 3 11 | } else { 12 | return 2 13 | } 14 | } 15 | 16 | $number = 1 + 2; 17 | $number += 3 18 | 19 | Write-Host Hello -name "World" 20 | 21 | $an_array = @(1, 2, 3) 22 | $a_hash = @{"something" = "something else"} 23 | 24 | & notepad .\readme.md 25 | -------------------------------------------------------------------------------- /demo/kitchen-sink/docs/python.py: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/python 2 | 3 | import string, sys 4 | 5 | # If no arguments were given, print a helpful message 6 | if len(sys.argv)==1: 7 | print '''Usage: 8 | celsius temp1 temp2 ...''' 9 | sys.exit(0) 10 | 11 | # Loop over the arguments 12 | for i in sys.argv[1:]: 13 | try: 14 | fahrenheit=float(string.atoi(i)) 15 | except string.atoi_error: 16 | print repr(i), "not a numeric value" 17 | else: 18 | celsius=(fahrenheit-32)*5.0/9.0 19 | print '%i\260F = %i\260C' % (int(fahrenheit), int(celsius+.5)) -------------------------------------------------------------------------------- /demo/kitchen-sink/docs/groovy.groovy: -------------------------------------------------------------------------------- 1 | //http://groovy.codehaus.org/Concurrency+with+Groovy 2 | import java.util.concurrent.atomic.AtomicInteger 3 | 4 | def counter = new AtomicInteger() 5 | 6 | synchronized out(message) { 7 | println(message) 8 | } 9 | 10 | def th = Thread.start { 11 | for( i in 1..8 ) { 12 | sleep 30 13 | out "thread loop $i" 14 | counter.incrementAndGet() 15 | } 16 | } 17 | 18 | for( j in 1..4 ) { 19 | sleep 50 20 | out "main loop $j" 21 | counter.incrementAndGet() 22 | } 23 | 24 | th.join() 25 | 26 | assert counter.get() == 12 -------------------------------------------------------------------------------- /demo/kitchen-sink/docs/css.css: -------------------------------------------------------------------------------- 1 | .text-layer { 2 | font-family: Monaco, "Courier New", monospace; 3 | font-size: 12px; 4 | cursor: text; 5 | } 6 | 7 | .blinker { 8 | animation-duration: 1s; 9 | animation-name: blink; 10 | animation-iteration-count: infinite; 11 | animation-direction: alternate; 12 | animation-timing-function: linear; 13 | } 14 | 15 | @keyframes blink { 16 | 0% { 17 | opacity: 0; 18 | } 19 | 40% { 20 | opacity: 0; 21 | } 22 | 40.5% { 23 | opacity: 1 24 | } 25 | 100% { 26 | opacity: 1 27 | } 28 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Junk that could exist anywhere: 2 | .DS_Store 3 | *.swp 4 | *.tmp 5 | 6 | # Project files that should not be in the repo 7 | .project 8 | .settings/ 9 | .settings.xml 10 | .c9settings.xml 11 | .settings.xml.old 12 | .*.gz 13 | 14 | # A handy place to put stuff that git should ignore: 15 | /ignore/ 16 | node_modules/htmlparser/ 17 | node_modules/amd-loader/ 18 | node_modules/asyncjs/ 19 | node_modules/jsdom/ 20 | node_modules/libxml/ 21 | node_modules/mime/ 22 | node_modules/dryice/ 23 | node_modules/uglify-js/ 24 | node_modules/.bin/ 25 | 26 | 27 | .git-ref 28 | npm-debug.log 29 | deps/ 30 | -------------------------------------------------------------------------------- /demo/kitchen-sink/docs/ocaml.ml: -------------------------------------------------------------------------------- 1 | (* 2 | * Example of early return implementation taken from 3 | * http://ocaml.janestreet.com/?q=node/91 4 | *) 5 | 6 | let with_return (type t) (f : _ -> t) = 7 | let module M = 8 | struct exception Return of t end 9 | in 10 | let return = { return = (fun x -> raise (M.Return x)); } in 11 | try f return with M.Return x -> x 12 | 13 | 14 | (* Function that uses the 'early return' functionality provided by `with_return` *) 15 | let sum_until_first_negative list = 16 | with_return (fun r -> 17 | List.fold list ~init:0 ~f:(fun acc x -> 18 | if x >= 0 then acc + x else r.return acc)) -------------------------------------------------------------------------------- /tool/tmthemes/LICENSE: -------------------------------------------------------------------------------- 1 | If not otherwise specified (see below), files in this directory fall under the following license: 2 | 3 | Permission to copy, use, modify, sell and distribute this 4 | software is granted. This software is provided "as is" without 5 | express or implied warranty, and with no claim as to its 6 | suitability for any purpose. 7 | 8 | An exception is made for files in readable text which contain their own license information, or files where an accompanying file exists (in the same directory) with a “-license” suffix added to the base-name name of the original file, and an extension of txt, html, or similar. For example “tidy” is accompanied by “tidy-license.txt”. -------------------------------------------------------------------------------- /lib/ace/mode/groovy.js: -------------------------------------------------------------------------------- 1 | define(function(require, exports, module) { 2 | "use strict"; 3 | 4 | var oop = require("../lib/oop"); 5 | var JavaScriptMode = require("./javascript").Mode; 6 | var Tokenizer = require("../tokenizer").Tokenizer; 7 | var GroovyHighlightRules = require("./groovy_highlight_rules").GroovyHighlightRules; 8 | 9 | var Mode = function() { 10 | JavaScriptMode.call(this); 11 | this.$tokenizer = new Tokenizer(new GroovyHighlightRules().getRules()); 12 | }; 13 | oop.inherits(Mode, JavaScriptMode); 14 | 15 | (function() { 16 | 17 | this.createWorker = function(session) { 18 | return null; 19 | }; 20 | 21 | }).call(Mode.prototype); 22 | 23 | exports.Mode = Mode; 24 | }); 25 | -------------------------------------------------------------------------------- /lib/ace/mode/java.js: -------------------------------------------------------------------------------- 1 | define(function(require, exports, module) { 2 | "use strict"; 3 | 4 | var oop = require("../lib/oop"); 5 | var JavaScriptMode = require("./javascript").Mode; 6 | var Tokenizer = require("../tokenizer").Tokenizer; 7 | var JavaHighlightRules = require("./java_highlight_rules").JavaHighlightRules; 8 | 9 | var Mode = function() { 10 | JavaScriptMode.call(this); 11 | 12 | this.$tokenizer = new Tokenizer(new JavaHighlightRules().getRules()); 13 | }; 14 | oop.inherits(Mode, JavaScriptMode); 15 | 16 | (function() { 17 | 18 | this.createWorker = function(session) { 19 | return null; 20 | }; 21 | 22 | }).call(Mode.prototype); 23 | 24 | exports.Mode = Mode; 25 | }); 26 | -------------------------------------------------------------------------------- /lib/ace/mode/scala.js: -------------------------------------------------------------------------------- 1 | define(function(require, exports, module) { 2 | "use strict"; 3 | 4 | var oop = require("../lib/oop"); 5 | var JavaScriptMode = require("./javascript").Mode; 6 | var Tokenizer = require("../tokenizer").Tokenizer; 7 | var ScalaHighlightRules = require("./scala_highlight_rules").ScalaHighlightRules; 8 | 9 | var Mode = function() { 10 | JavaScriptMode.call(this); 11 | 12 | this.$tokenizer = new Tokenizer(new ScalaHighlightRules().getRules()); 13 | }; 14 | oop.inherits(Mode, JavaScriptMode); 15 | 16 | (function() { 17 | 18 | this.createWorker = function(session) { 19 | return null; 20 | }; 21 | 22 | }).call(Mode.prototype); 23 | 24 | exports.Mode = Mode; 25 | }); 26 | -------------------------------------------------------------------------------- /lib/ace/lib/fixoldbrowsers.js: -------------------------------------------------------------------------------- 1 | // vim:set ts=4 sts=4 sw=4 st: 2 | // -- kriskowal Kris Kowal Copyright (C) 2009-2010 MIT License 3 | // -- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal Project) 4 | // -- dantman Daniel Friesen Copyright(C) 2010 XXX No License Specified 5 | // -- fschaefer Florian Schäfer Copyright (C) 2010 MIT License 6 | // -- Irakli Gozalishvili Copyright (C) 2010 MIT License 7 | 8 | /*! 9 | Copyright (c) 2009, 280 North Inc. http://280north.com/ 10 | MIT License. http://github.com/280north/narwhal/blob/master/README.md 11 | */ 12 | 13 | define(function(require, exports, module) { 14 | "use strict"; 15 | 16 | require("./regexp"); 17 | require("./es5-shim"); 18 | 19 | }); -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | build: 2 | git rev-parse HEAD > .git-ref 3 | mkdir -p build/src 4 | mkdir -p build/demo/kitchen-sink 5 | mkdir -p build/textarea/src 6 | 7 | cp -r demo/kitchen-sink/styles.css build/demo/kitchen-sink/styles.css 8 | cp demo/kitchen-sink/logo.png build/demo/kitchen-sink/logo.png 9 | cp -r doc/site/images build/textarea 10 | 11 | ./Makefile.dryice.js normal 12 | ./Makefile.dryice.js demo 13 | ./Makefile.dryice.js bm 14 | 15 | clean: 16 | rm -rf build 17 | rm -rf ace-* 18 | rm -f ace-*.tgz 19 | 20 | ace.tgz: build 21 | mv build ace-`./version.js`/ 22 | cp Readme.md ace-`./version.js`/ 23 | cp LICENSE ace-`./version.js`/ 24 | tar cvfz ace-`./version.js`.tgz ace-`./version.js`/ 25 | 26 | dist: clean build ace.tgz 27 | -------------------------------------------------------------------------------- /demo/kitchen-sink/docs/perl.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | use strict; 3 | use warnings; 4 | my $num_primes = 0; 5 | my @primes; 6 | 7 | # Put 2 as the first prime so we won't have an empty array 8 | $primes[$num_primes] = 2; 9 | $num_primes++; 10 | 11 | MAIN_LOOP: 12 | for my $number_to_check (3 .. 200) 13 | { 14 | for my $p (0 .. ($num_primes-1)) 15 | { 16 | if ($number_to_check % $primes[$p] == 0) 17 | { 18 | next MAIN_LOOP; 19 | } 20 | } 21 | 22 | # If we reached this point it means $number_to_check is not 23 | # divisable by any prime number that came before it. 24 | $primes[$num_primes] = $number_to_check; 25 | $num_primes++; 26 | } 27 | 28 | for my $p (0 .. ($num_primes-1)) 29 | { 30 | print $primes[$p], ", "; 31 | } 32 | print "\n"; 33 | -------------------------------------------------------------------------------- /demo/kitchen-sink/styles.css: -------------------------------------------------------------------------------- 1 | html { 2 | height: 100%; 3 | width: 100%; 4 | overflow: hidden; 5 | } 6 | 7 | body { 8 | overflow: hidden; 9 | margin: 0; 10 | padding: 0; 11 | height: 100%; 12 | width: 100%; 13 | font-family: Arial, Helvetica, sans-serif, Tahoma, Verdana, sans-serif; 14 | font-size: 12px; 15 | background: rgb(14, 98, 165); 16 | color: white; 17 | } 18 | 19 | #logo { 20 | padding: 15px; 21 | margin-left: 70px; 22 | } 23 | 24 | #editor { 25 | position: absolute; 26 | top: 0px; 27 | left: 300px; 28 | bottom: 0px; 29 | right: 0px; 30 | background: white; 31 | } 32 | 33 | #controls { 34 | padding: 5px; 35 | } 36 | 37 | #controls td { 38 | text-align: right; 39 | } 40 | 41 | #controls td + td { 42 | text-align: left; 43 | } -------------------------------------------------------------------------------- /demo/kitchen-sink/docs/glsl.frag: -------------------------------------------------------------------------------- 1 | // Sample fragment shader from @mrdoob's #glslsandbox 2 | 3 | #ifdef GL_ES 4 | precision mediump float; 5 | #endif 6 | 7 | uniform float time; 8 | uniform vec2 mouse; 9 | uniform vec2 resolution; 10 | 11 | void main( void ) { 12 | 13 | vec2 position = ( gl_FragCoord.xy / resolution.xy ) + mouse / 4.0; 14 | 15 | float color = 0.0; 16 | color += sin( position.x * cos( time / 15.0 ) * 80.0 ) + cos( position.y * cos( time / 15.0 ) * 10.0 ); 17 | color += sin( position.y * sin( time / 10.0 ) * 40.0 ) + cos( position.x * sin( time / 25.0 ) * 40.0 ); 18 | color += sin( position.x * sin( time / 5.0 ) * 10.0 ) + sin( position.y * sin( time / 35.0 ) * 80.0 ); 19 | color *= sin( time / 10.0 ) * 0.5; 20 | 21 | gl_FragColor = vec4( vec3( color, color * 0.5, sin( color + time / 3.0 ) * 0.75 ), 1.0 ); 22 | 23 | } -------------------------------------------------------------------------------- /experiments/worker.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | worker 8 | 9 | 10 | 11 | 12 | 13 | 14 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /demo/kitchen-sink/docs/clojure.clj: -------------------------------------------------------------------------------- 1 | (defn parting 2 | "returns a String parting in a given language" 3 | ([] (parting "World")) 4 | ([name] (parting name "en")) 5 | ([name language] 6 | ; condp is similar to a case statement in other languages. 7 | ; It is described in more detail later. 8 | ; It is used here to take different actions based on whether the 9 | ; parameter "language" is set to "en", "es" or something else. 10 | (condp = language 11 | "en" (str "Goodbye, " name) 12 | "es" (str "Adios, " name) 13 | (throw (IllegalArgumentException. 14 | (str "unsupported language " language)))))) 15 | 16 | (println (parting)) ; -> Goodbye, World 17 | (println (parting "Mark")) ; -> Goodbye, Mark 18 | (println (parting "Mark" "es")) ; -> Adios, Mark 19 | (println (parting "Mark", "xy")) ; -> java.lang.IllegalArgumentException: unsupported language xy -------------------------------------------------------------------------------- /experiments/triple_click.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | triple_click 8 | 9 | 10 | 11 | 12 | 13 |
14 | Juhu Kinners 15 |
16 | 17 | 18 | 19 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /demo/kitchen-sink/docs/latex.tex: -------------------------------------------------------------------------------- 1 | \usepackage{amsmath} 2 | \title{\LaTeX} 3 | \date{} 4 | \begin{document} 5 | \maketitle 6 | \LaTeX{} is a document preparation system for the \TeX{} 7 | typesetting program. It offers programmable desktop publishing 8 | features and extensive facilities for automating most aspects of 9 | typesetting and desktop publishing, including numbering and 10 | cross-referencing, tables and figures, page layout, bibliographies, 11 | and much more. \LaTeX{} was originally written in 1984 by Leslie 12 | Lamport and has become the dominant method for using \TeX; few 13 | people write in plain \TeX{} anymore. The current version is 14 | \LaTeXe. 15 | 16 | % This is a comment; it will not be shown in the final output. 17 | % The following shows a little of the typesetting power of LaTeX: 18 | \begin{align} 19 | E &= mc^2 \\ 20 | m &= \frac{m_0}{\sqrt{1-\frac{v^2}{c^2}}} 21 | \end{align} 22 | \end{document} -------------------------------------------------------------------------------- /lib/ace/test/tests.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Ace Unit Tests 7 | 21 | 22 | 23 | 24 |
25 | 26 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /experiments/capture.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 17 | 18 | 19 | 20 |
21 | 22 |
23 | 24 | 25 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /demo/kitchen-sink/docs/lua.lua: -------------------------------------------------------------------------------- 1 | --[[-- 2 | num_args takes in 5.1 byte code and extracts the number of arguments 3 | from its function header. 4 | --]]-- 5 | 6 | function int(t) 7 | return t:byte(1)+t:byte(2)*0x100+t:byte(3)*0x10000+t:byte(4)*0x1000000 8 | end 9 | 10 | function num_args(func) 11 | local dump = string.dump(func) 12 | local offset, cursor = int(dump:sub(13)), offset + 26 13 | --Get the params and var flag (whether there's a ... in the param) 14 | return dump:sub(cursor):byte(), dump:sub(cursor+1):byte() 15 | end 16 | 17 | -- Usage: 18 | num_args(function(a,b,c,d, ...) end) -- return 4, 7 19 | 20 | -- Python styled string format operator 21 | local gm = debug.getmetatable("") 22 | 23 | gm.__mod=function(self, other) 24 | if type(other) ~= "table" then other = {other} end 25 | for i,v in ipairs(other) do other[i] = tostring(v) end 26 | return self:format(unpack(other)) 27 | end 28 | 29 | print([===[ 30 | blah blah %s, (%d %d) 31 | ]===]%{"blah", num_args(int)}) 32 | 33 | --[=[-- 34 | table.maxn is deprecated, use # instead. 35 | --]=]-- 36 | print(table.maxn{1,2,[4]=4,[8]=8) -- outputs 8 instead of 2 37 | -------------------------------------------------------------------------------- /lib/ace/worker/mirror.js: -------------------------------------------------------------------------------- 1 | define(function(require, exports, module) { 2 | "use strict"; 3 | 4 | var Document = require("../document").Document; 5 | var lang = require("../lib/lang"); 6 | 7 | var Mirror = exports.Mirror = function(sender) { 8 | this.sender = sender; 9 | var doc = this.doc = new Document(""); 10 | 11 | var deferredUpdate = this.deferredUpdate = lang.deferredCall(this.onUpdate.bind(this)); 12 | 13 | var _self = this; 14 | sender.on("change", function(e) { 15 | doc.applyDeltas([e.data]); 16 | deferredUpdate.schedule(_self.$timeout); 17 | }); 18 | }; 19 | 20 | (function() { 21 | 22 | this.$timeout = 500; 23 | 24 | this.setTimeout = function(timeout) { 25 | this.$timeout = timeout; 26 | }; 27 | 28 | this.setValue = function(value) { 29 | this.doc.setValue(value); 30 | this.deferredUpdate.schedule(this.$timeout); 31 | }; 32 | 33 | this.getValue = function(callbackId) { 34 | this.sender.callback(this.doc.getValue(), callbackId); 35 | }; 36 | 37 | this.onUpdate = function() { 38 | // abstract method 39 | }; 40 | 41 | }).call(Mirror.prototype); 42 | 43 | }); -------------------------------------------------------------------------------- /lib/ace/mode/latex_highlight_rules.js: -------------------------------------------------------------------------------- 1 | define(function(require, exports, module) { 2 | "use strict"; 3 | 4 | var oop = require("../lib/oop"); 5 | var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; 6 | 7 | var LatexHighlightRules = function() { 8 | this.$rules = { 9 | "start" : [{ 10 | // A tex command e.g. \foo 11 | token : "keyword", 12 | regex : "\\\\(?:[^a-zA-Z]|[a-zA-Z]+)", 13 | }, { 14 | // Curly and square braces 15 | token : "lparen", 16 | regex : "[[({]" 17 | }, { 18 | // Curly and square braces 19 | token : "rparen", 20 | regex : "[\\])}]" 21 | }, { 22 | // Inline math between two $ symbols 23 | token : "string", 24 | regex : "\\$(?:(?:\\\\.)|(?:[^\\$\\\\]))*?\\$" 25 | }, { 26 | // A comment. Tex comments start with % and go to 27 | // the end of the line 28 | token : "comment", 29 | regex : "%.*$" 30 | }] 31 | }; 32 | }; 33 | 34 | oop.inherits(LatexHighlightRules, TextHighlightRules); 35 | 36 | exports.LatexHighlightRules = LatexHighlightRules; 37 | 38 | }); 39 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ace", 3 | "description": "Ajax.org Code Editor is a full featured source code highlighting editor that powers the Cloud9 IDE", 4 | "version": "0.2.0", 5 | "homepage" : "http://github.com/ajaxorg/ace", 6 | "engines": {"node": ">= 0.4.0"}, 7 | "author": "Fabian Jakobs ", 8 | "main": "lib/ace", 9 | "repository" : { 10 | "type" : "git", 11 | "url" : "http://github.com/ajaxorg/ace.git" 12 | }, 13 | "dependencies": { 14 | "mime": "1.2.x" 15 | }, 16 | "devDependencies": { 17 | "asyncjs": "0.0.x", 18 | "jsdom": "0.2.x", 19 | "amd-loader": ">=0.0.3", 20 | "libxml": "0.0.x", 21 | "dryice": ">=0.3.1" 22 | }, 23 | 24 | "licenses": [{ 25 | "type": "MPL", 26 | "url": "http://www.mozilla.org/MPL/" 27 | }, 28 | { 29 | "type": "GPL", 30 | "url": "http://www.gnu.org/licenses/gpl.html" 31 | }, 32 | { 33 | "type": "LGPL", 34 | "url": "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html" 35 | }], 36 | "directories": { 37 | "lib": "lib/ace" 38 | }, 39 | "scripts": { 40 | "test": "node lib/ace/test/all.js" 41 | } 42 | } -------------------------------------------------------------------------------- /static.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var http = require("http"), 4 | url = require("url"), 5 | path = require("path"), 6 | fs = require("fs"), 7 | mime = require("mime"), 8 | port = process.env.C9_PORT || 8888; 9 | 10 | http.createServer(function(request, response) { 11 | 12 | var uri = url.parse(request.url).pathname 13 | , filename = path.join(process.cwd(), uri); 14 | 15 | path.exists(filename, function(exists) { 16 | if(!exists) { 17 | response.writeHead(404, {"Content-Type": "text/plain"}); 18 | response.write("404 Not Found\n"); 19 | response.end(); 20 | return; 21 | } 22 | 23 | if (fs.statSync(filename).isDirectory()) filename += '/index.html'; 24 | 25 | fs.readFile(filename, "binary", function(err, file) { 26 | if(err) { 27 | response.writeHead(500, {"Content-Type": "text/plain"}); 28 | response.write(err + "\n"); 29 | response.end(); 30 | return; 31 | } 32 | 33 | var contentType = mime.lookup(filename) || "text/plain"; 34 | response.writeHead(200, {"Content-Type": contentType}); 35 | response.write(file, "binary"); 36 | response.end(); 37 | }); 38 | }); 39 | }).listen(port, "0.0.0.0"); 40 | 41 | console.log("http://localhost:" + port); 42 | -------------------------------------------------------------------------------- /demo/static-highlighter/server.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Simple node.js server, which generates the synax highlighted version of itself 3 | * using the Ace modes and themes on the server and serving a static web page. 4 | */ 5 | 6 | // include ace search path and modules 7 | require("amd-loader"); 8 | 9 | // load jsdom, which is required by Ace 10 | require("../../lib/ace/test/mockdom"); 11 | 12 | var http = require("http"); 13 | var fs = require("fs"); 14 | 15 | // load the highlighter and the desired mode and theme 16 | var highlighter = require("../../lib/ace/ext/static_highlight"); 17 | var JavaScriptMode = require("../../lib/ace/mode/javascript").Mode; 18 | var theme = require("../../lib/ace/theme/twilight"); 19 | 20 | var port = process.env.PORT || 2222; 21 | 22 | http.createServer(function(req, res) { 23 | res.writeHead(200, {"Content-Type": "text/html"}); 24 | 25 | fs.readFile(__filename, "utf8", function(err, data) { 26 | var highlighted = highlighter.render(data, new JavaScriptMode(), theme); 27 | res.end('\n\ 28 | \n\ 31 | :html:\n\ 32 | '.replace(":css:", highlighted.css).replace(":html:", highlighted.html)); 33 | }); 34 | }).listen(port); 35 | 36 | console.log("Listening on port " + port); -------------------------------------------------------------------------------- /demo/static-highlighter/client.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | Static Code highlighter using Ace 8 | 9 | 10 | 11 | 12 |

Client Side Syntax Highlighting

13 | 14 |

Syntax highlighting using Ace language modes and themes.

15 | 16 |
17 | 18 | 26 | 27 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /demo/kitchen-sink/docs/json.json: -------------------------------------------------------------------------------- 1 | { 2 | "query": { 3 | "count": 10, 4 | "created": "2011-06-21T08:10:46Z", 5 | "lang": "en-US", 6 | "results": { 7 | "photo": [ 8 | { 9 | "farm": "6", 10 | "id": "5855620975", 11 | "isfamily": "0", 12 | "isfriend": "0", 13 | "ispublic": "1", 14 | "owner": "32021554@N04", 15 | "secret": "f1f5e8515d", 16 | "server": "5110", 17 | "title": "7087 bandit cat" 18 | }, 19 | { 20 | "farm": "4", 21 | "id": "5856170534", 22 | "isfamily": "0", 23 | "isfriend": "0", 24 | "ispublic": "1", 25 | "owner": "32021554@N04", 26 | "secret": "ff1efb2a6f", 27 | "server": "3217", 28 | "title": "6975 rusty cat" 29 | }, 30 | { 31 | "farm": "6", 32 | "id": "5856172972", 33 | "isfamily": "0", 34 | "isfriend": "0", 35 | "ispublic": "1", 36 | "owner": "51249875@N03", 37 | "secret": "6c6887347c", 38 | "server": "5192", 39 | "title": "watermarked-cats" 40 | }, 41 | { 42 | "farm": "6", 43 | "id": "5856168328", 44 | "isfamily": "0", 45 | "isfriend": "0", 46 | "ispublic": "1", 47 | "owner": "32021554@N04", 48 | "secret": "0c1cfdf64c", 49 | "server": "5078", 50 | "title": "7020 mandy cat" 51 | }, 52 | { 53 | "farm": "3", 54 | "id": "5856171774", 55 | "isfamily": "0", 56 | "isfriend": "0", 57 | "ispublic": "1", 58 | "owner": "32021554@N04", 59 | "secret": "7f5a3180ab", 60 | "server": "2696", 61 | "title": "7448 bobby cat" 62 | } 63 | ] 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /lib/ace/test/asyncjs/utils.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * async.js 3 | * Copyright(c) 2010 Fabian Jakobs 4 | * MIT Licensed 5 | */ 6 | 7 | define(function(require, exports, module) { 8 | 9 | var async = require("asyncjs/async") 10 | 11 | async.plugin({ 12 | delay: function(delay) { 13 | return this.each(function(item, next) { 14 | setTimeout(function() { 15 | next(); 16 | }, delay) 17 | }) 18 | }, 19 | 20 | timeout: function(timeout) { 21 | timeout = timeout || 0 22 | var source = this.source 23 | 24 | this.next = function(callback) { 25 | var called 26 | var id = setTimeout(function() { 27 | called = true 28 | callback("Source did not respond after " + timeout + "ms!") 29 | }, timeout) 30 | 31 | source.next(function(err, value) { 32 | if (called) 33 | return 34 | 35 | called = true 36 | clearTimeout(id) 37 | 38 | callback(err, value) 39 | }) 40 | } 41 | return new this.constructor(this) 42 | }, 43 | 44 | get: function(key) { 45 | return this.map(function(value, next) { 46 | next(null, value[key]) 47 | }) 48 | }, 49 | 50 | inspect: function() { 51 | return this.each(function(item, next) { 52 | console.log(JSON.stringify(item)) 53 | next() 54 | }) 55 | }, 56 | 57 | print: function() { 58 | return this.each(function(item, next) { 59 | console.log(item) 60 | next() 61 | }) 62 | } 63 | }) 64 | 65 | }) -------------------------------------------------------------------------------- /lib/ace/lib/net.js: -------------------------------------------------------------------------------- 1 | /** 2 | * based on code from: 3 | * 4 | * @license RequireJS text 0.25.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. 5 | * Available via the MIT or new BSD license. 6 | * see: http://github.com/jrburke/requirejs for details 7 | */ 8 | define(function(require, exports, module) { 9 | "use strict"; 10 | 11 | exports.get = function (url, callback) { 12 | var xhr = exports.createXhr(); 13 | xhr.open('GET', url, true); 14 | xhr.onreadystatechange = function (evt) { 15 | //Do not explicitly handle errors, those should be 16 | //visible via console output in the browser. 17 | if (xhr.readyState === 4) { 18 | callback(xhr.responseText); 19 | } 20 | }; 21 | xhr.send(null); 22 | }; 23 | 24 | var progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0']; 25 | 26 | exports.createXhr = function() { 27 | //Would love to dump the ActiveX crap in here. Need IE 6 to die first. 28 | var xhr, i, progId; 29 | if (typeof XMLHttpRequest !== "undefined") { 30 | return new XMLHttpRequest(); 31 | } else { 32 | for (i = 0; i < 3; i++) { 33 | progId = progIds[i]; 34 | try { 35 | xhr = new ActiveXObject(progId); 36 | } catch (e) {} 37 | 38 | if (xhr) { 39 | progIds = [progId]; // so faster next time 40 | break; 41 | } 42 | } 43 | } 44 | 45 | if (!xhr) { 46 | throw new Error("createXhr(): XMLHttpRequest not available"); 47 | } 48 | 49 | return xhr; 50 | }; 51 | 52 | exports.loadScript = function(path, callback) { 53 | var head = document.getElementsByTagName('head')[0]; 54 | var s = document.createElement('script'); 55 | 56 | s.src = path; 57 | head.appendChild(s); 58 | 59 | s.onload = callback; 60 | }; 61 | 62 | }); -------------------------------------------------------------------------------- /lib/ace/mode/csharp.js: -------------------------------------------------------------------------------- 1 | define(function(require, exports, module) { 2 | "use strict"; 3 | 4 | var oop = require("../lib/oop"); 5 | var TextMode = require("./text").Mode; 6 | var Tokenizer = require("../tokenizer").Tokenizer; 7 | var CSharpHighlightRules = require("./csharp_highlight_rules").CSharpHighlightRules; 8 | var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; 9 | var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; 10 | var CStyleFoldMode = require("./folding/cstyle").FoldMode; 11 | 12 | var Mode = function() { 13 | this.$tokenizer = new Tokenizer(new CSharpHighlightRules().getRules()); 14 | this.$outdent = new MatchingBraceOutdent(); 15 | this.$behaviour = new CstyleBehaviour(); 16 | this.foldingRules = new CStyleFoldMode(); 17 | }; 18 | oop.inherits(Mode, TextMode); 19 | 20 | (function() { 21 | 22 | this.getNextLineIndent = function(state, line, tab) { 23 | var indent = this.$getIndent(line); 24 | 25 | var tokenizedLine = this.$tokenizer.getLineTokens(line, state); 26 | var tokens = tokenizedLine.tokens; 27 | 28 | if (tokens.length && tokens[tokens.length-1].type == "comment") { 29 | return indent; 30 | } 31 | 32 | if (state == "start") { 33 | var match = line.match(/^.*[\{\(\[]\s*$/); 34 | if (match) { 35 | indent += tab; 36 | } 37 | } 38 | 39 | return indent; 40 | }; 41 | 42 | this.checkOutdent = function(state, line, input) { 43 | return this.$outdent.checkOutdent(line, input); 44 | }; 45 | 46 | this.autoOutdent = function(state, doc, row) { 47 | this.$outdent.autoOutdent(doc, row); 48 | }; 49 | 50 | 51 | this.createWorker = function(session) { 52 | return null; 53 | }; 54 | 55 | }).call(Mode.prototype); 56 | 57 | exports.Mode = Mode; 58 | }); 59 | -------------------------------------------------------------------------------- /lib/ace/mode/powershell.js: -------------------------------------------------------------------------------- 1 | define(function(require, exports, module) { 2 | "use strict"; 3 | 4 | var oop = require("../lib/oop"); 5 | var TextMode = require("./text").Mode; 6 | var Tokenizer = require("../tokenizer").Tokenizer; 7 | var PowershellHighlightRules = require("./powershell_highlight_rules").PowershellHighlightRules; 8 | var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; 9 | var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; 10 | var CStyleFoldMode = require("./folding/cstyle").FoldMode; 11 | 12 | var Mode = function() { 13 | this.$tokenizer = new Tokenizer(new PowershellHighlightRules().getRules()); 14 | this.$outdent = new MatchingBraceOutdent(); 15 | this.$behaviour = new CstyleBehaviour(); 16 | this.foldingRules = new CStyleFoldMode(); 17 | }; 18 | oop.inherits(Mode, TextMode); 19 | 20 | (function() { 21 | 22 | this.getNextLineIndent = function(state, line, tab) { 23 | var indent = this.$getIndent(line); 24 | 25 | var tokenizedLine = this.$tokenizer.getLineTokens(line, state); 26 | var tokens = tokenizedLine.tokens; 27 | 28 | if (tokens.length && tokens[tokens.length-1].type == "comment") { 29 | return indent; 30 | } 31 | 32 | if (state == "start") { 33 | var match = line.match(/^.*[\{\(\[]\s*$/); 34 | if (match) { 35 | indent += tab; 36 | } 37 | } 38 | 39 | return indent; 40 | }; 41 | 42 | this.checkOutdent = function(state, line, input) { 43 | return this.$outdent.checkOutdent(line, input); 44 | }; 45 | 46 | this.autoOutdent = function(state, doc, row) { 47 | this.$outdent.autoOutdent(doc, row); 48 | }; 49 | 50 | 51 | this.createWorker = function(session) { 52 | return null; 53 | }; 54 | 55 | }).call(Mode.prototype); 56 | 57 | exports.Mode = Mode; 58 | }); 59 | -------------------------------------------------------------------------------- /lib/ace/mode/haxe.js: -------------------------------------------------------------------------------- 1 | define(function(require, exports, module) { 2 | "use strict"; 3 | 4 | var oop = require("../lib/oop"); 5 | var TextMode = require("./text").Mode; 6 | var Tokenizer = require("../tokenizer").Tokenizer; 7 | var HaxeHighlightRules = require("./haxe_highlight_rules").HaxeHighlightRules; 8 | var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; 9 | var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; 10 | var CStyleFoldMode = require("./folding/cstyle").FoldMode; 11 | 12 | var Mode = function() { 13 | this.$tokenizer = new Tokenizer(new HaxeHighlightRules().getRules()); 14 | this.$outdent = new MatchingBraceOutdent(); 15 | this.$behaviour = new CstyleBehaviour(); 16 | this.foldingRules = new CStyleFoldMode(); 17 | }; 18 | oop.inherits(Mode, TextMode); 19 | 20 | (function() { 21 | 22 | this.getNextLineIndent = function(state, line, tab) { 23 | var indent = this.$getIndent(line); 24 | 25 | var tokenizedLine = this.$tokenizer.getLineTokens(line, state); 26 | var tokens = tokenizedLine.tokens; 27 | 28 | if (tokens.length && tokens[tokens.length-1].type == "comment") { 29 | return indent; 30 | } 31 | 32 | if (state == "start") { 33 | var match = line.match(/^.*[\{\(\[]\s*$/); 34 | if (match) { 35 | indent += tab; 36 | } 37 | } 38 | 39 | return indent; 40 | }; 41 | 42 | this.checkOutdent = function(state, line, input) { 43 | return this.$outdent.checkOutdent(line, input); 44 | }; 45 | 46 | this.autoOutdent = function(state, doc, row) { 47 | this.$outdent.autoOutdent(doc, row); 48 | }; 49 | 50 | 51 | this.createWorker = function(session) { 52 | return null; 53 | }; 54 | 55 | }).call(Mode.prototype); 56 | 57 | exports.Mode = Mode; 58 | }); 59 | -------------------------------------------------------------------------------- /lib/ace/mode/latex.js: -------------------------------------------------------------------------------- 1 | define(function(require, exports, module) { 2 | "use strict"; 3 | 4 | var oop = require("../lib/oop"); 5 | var TextMode = require("./text").Mode; 6 | var Tokenizer = require("../tokenizer").Tokenizer; 7 | var LatexHighlightRules = require("./latex_highlight_rules").LatexHighlightRules; 8 | var Range = require("../range").Range; 9 | 10 | var Mode = function() 11 | { 12 | this.$tokenizer = new Tokenizer(new LatexHighlightRules().getRules()); 13 | }; 14 | oop.inherits(Mode, TextMode); 15 | 16 | (function() { 17 | this.toggleCommentLines = function(state, doc, startRow, endRow) { 18 | // This code is adapted from ruby.js 19 | var outdent = true; 20 | 21 | // LaTeX comments begin with % and go to the end of the line 22 | var commentRegEx = /^(\s*)\%/; 23 | 24 | for (var i = startRow; i <= endRow; i++) { 25 | if (!commentRegEx.test(doc.getLine(i))) { 26 | outdent = false; 27 | break; 28 | } 29 | } 30 | 31 | if (outdent) { 32 | var deleteRange = new Range(0, 0, 0, 0); 33 | for (var i = startRow; i <= endRow; i++) { 34 | var line = doc.getLine(i); 35 | var m = line.match(commentRegEx); 36 | deleteRange.start.row = i; 37 | deleteRange.end.row = i; 38 | deleteRange.end.column = m[0].length; 39 | doc.replace(deleteRange, m[1]); 40 | } 41 | } 42 | else { 43 | doc.indentRows(startRow, endRow, "%"); 44 | } 45 | }; 46 | 47 | // There is no universally accepted way of indenting a tex document 48 | // so just maintain the indentation of the previous line 49 | this.getNextLineIndent = function(state, line, tab) { 50 | return this.$getIndent(line); 51 | }; 52 | 53 | }).call(Mode.prototype); 54 | 55 | exports.Mode = Mode; 56 | 57 | }); 58 | -------------------------------------------------------------------------------- /lib/ace/test/all.js: -------------------------------------------------------------------------------- 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 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 | "use strict"; 39 | 40 | require("amd-loader"); 41 | var test = require("asyncjs").test; 42 | test.walkTestCases(__dirname + "/..").exec(); -------------------------------------------------------------------------------- /lib/pilot/dom.js: -------------------------------------------------------------------------------- 1 | /* vim:ts=4:sts=4:sw=4: 2 | * ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is Ajax.org Code Editor (ACE). 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Ajax.org B.V. 19 | * Portions created by the Initial Developer are Copyright (C) 2010 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * Fabian Jakobs 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of 26 | * either the GNU General Public License Version 2 or later (the "GPL"), or 27 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 28 | * in which case the provisions of the GPL or the LGPL are applicable instead 29 | * of those above. If you wish to allow use of your version of this file only 30 | * under the terms of either the GPL or the LGPL, and not to allow others to 31 | * use your version of this file under the terms of the MPL, indicate your 32 | * decision by deleting the provisions above and replace them with the notice 33 | * and other provisions required by the GPL or the LGPL. If you do not delete 34 | * the provisions above, a recipient may use your version of this file under 35 | * the terms of any one of the MPL, the GPL or the LGPL. 36 | * 37 | * ***** END LICENSE BLOCK ***** */ 38 | 39 | define(function(require, exports, module) { 40 | console.warn("DEPRECATED: 'pilot/dom' is deprecated. Use 'ace/lib/dom' instead"); 41 | module.exports = require("ace/lib/dom"); 42 | }); 43 | -------------------------------------------------------------------------------- /lib/pilot/keys.js: -------------------------------------------------------------------------------- 1 | /* vim:ts=4:sts=4:sw=4: 2 | * ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is Ajax.org Code Editor (ACE). 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Ajax.org B.V. 19 | * Portions created by the Initial Developer are Copyright (C) 2010 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * Fabian Jakobs 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of 26 | * either the GNU General Public License Version 2 or later (the "GPL"), or 27 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 28 | * in which case the provisions of the GPL or the LGPL are applicable instead 29 | * of those above. If you wish to allow use of your version of this file only 30 | * under the terms of either the GPL or the LGPL, and not to allow others to 31 | * use your version of this file under the terms of the MPL, indicate your 32 | * decision by deleting the provisions above and replace them with the notice 33 | * and other provisions required by the GPL or the LGPL. If you do not delete 34 | * the provisions above, a recipient may use your version of this file under 35 | * the terms of any one of the MPL, the GPL or the LGPL. 36 | * 37 | * ***** END LICENSE BLOCK ***** */ 38 | 39 | define(function(require, exports, module) { 40 | console.warn("DEPRECATED: 'pilot/keys' is deprecated. Use 'ace/lib/keys' instead"); 41 | module.exports = require("ace/lib/keys"); 42 | }); 43 | -------------------------------------------------------------------------------- /lib/pilot/lang.js: -------------------------------------------------------------------------------- 1 | /* vim:ts=4:sts=4:sw=4: 2 | * ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is Ajax.org Code Editor (ACE). 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Ajax.org B.V. 19 | * Portions created by the Initial Developer are Copyright (C) 2010 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * Fabian Jakobs 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of 26 | * either the GNU General Public License Version 2 or later (the "GPL"), or 27 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 28 | * in which case the provisions of the GPL or the LGPL are applicable instead 29 | * of those above. If you wish to allow use of your version of this file only 30 | * under the terms of either the GPL or the LGPL, and not to allow others to 31 | * use your version of this file under the terms of the MPL, indicate your 32 | * decision by deleting the provisions above and replace them with the notice 33 | * and other provisions required by the GPL or the LGPL. If you do not delete 34 | * the provisions above, a recipient may use your version of this file under 35 | * the terms of any one of the MPL, the GPL or the LGPL. 36 | * 37 | * ***** END LICENSE BLOCK ***** */ 38 | 39 | define(function(require, exports, module) { 40 | console.warn("DEPRECATED: 'pilot/lang' is deprecated. Use 'ace/lib/lang' instead"); 41 | module.exports = require("ace/lib/lang"); 42 | }); 43 | -------------------------------------------------------------------------------- /lib/pilot/oop.js: -------------------------------------------------------------------------------- 1 | /* vim:ts=4:sts=4:sw=4: 2 | * ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is Ajax.org Code Editor (ACE). 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Ajax.org B.V. 19 | * Portions created by the Initial Developer are Copyright (C) 2010 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * Fabian Jakobs 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of 26 | * either the GNU General Public License Version 2 or later (the "GPL"), or 27 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 28 | * in which case the provisions of the GPL or the LGPL are applicable instead 29 | * of those above. If you wish to allow use of your version of this file only 30 | * under the terms of either the GPL or the LGPL, and not to allow others to 31 | * use your version of this file under the terms of the MPL, indicate your 32 | * decision by deleting the provisions above and replace them with the notice 33 | * and other provisions required by the GPL or the LGPL. If you do not delete 34 | * the provisions above, a recipient may use your version of this file under 35 | * the terms of any one of the MPL, the GPL or the LGPL. 36 | * 37 | * ***** END LICENSE BLOCK ***** */ 38 | 39 | define(function(require, exports, module) { 40 | console.warn("DEPRECATED: 'pilot/oop' is deprecated. Use 'ace/lib/oop' instead"); 41 | module.exports = require("ace/lib/oop"); 42 | }); 43 | -------------------------------------------------------------------------------- /lib/pilot/event.js: -------------------------------------------------------------------------------- 1 | /* vim:ts=4:sts=4:sw=4: 2 | * ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is Ajax.org Code Editor (ACE). 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Ajax.org B.V. 19 | * Portions created by the Initial Developer are Copyright (C) 2010 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * Fabian Jakobs 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of 26 | * either the GNU General Public License Version 2 or later (the "GPL"), or 27 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 28 | * in which case the provisions of the GPL or the LGPL are applicable instead 29 | * of those above. If you wish to allow use of your version of this file only 30 | * under the terms of either the GPL or the LGPL, and not to allow others to 31 | * use your version of this file under the terms of the MPL, indicate your 32 | * decision by deleting the provisions above and replace them with the notice 33 | * and other provisions required by the GPL or the LGPL. If you do not delete 34 | * the provisions above, a recipient may use your version of this file under 35 | * the terms of any one of the MPL, the GPL or the LGPL. 36 | * 37 | * ***** END LICENSE BLOCK ***** */ 38 | 39 | define(function(require, exports, module) { 40 | console.warn("DEPRECATED: 'pilot/event' is deprecated. Use 'ace/lib/event' instead"); 41 | module.exports = require("ace/lib/event"); 42 | }); 43 | -------------------------------------------------------------------------------- /lib/pilot/useragent.js: -------------------------------------------------------------------------------- 1 | /* vim:ts=4:sts=4:sw=4: 2 | * ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is Ajax.org Code Editor (ACE). 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Ajax.org B.V. 19 | * Portions created by the Initial Developer are Copyright (C) 2010 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * Fabian Jakobs 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of 26 | * either the GNU General Public License Version 2 or later (the "GPL"), or 27 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 28 | * in which case the provisions of the GPL or the LGPL are applicable instead 29 | * of those above. If you wish to allow use of your version of this file only 30 | * under the terms of either the GPL or the LGPL, and not to allow others to 31 | * use your version of this file under the terms of the MPL, indicate your 32 | * decision by deleting the provisions above and replace them with the notice 33 | * and other provisions required by the GPL or the LGPL. If you do not delete 34 | * the provisions above, a recipient may use your version of this file under 35 | * the terms of any one of the MPL, the GPL or the LGPL. 36 | * 37 | * ***** END LICENSE BLOCK ***** */ 38 | 39 | define(function(require, exports, module) { 40 | console.warn("DEPRECATED: 'pilot/useragent' is deprecated. Use 'ace/lib/useragent' instead"); 41 | module.exports = require("ace/lib/useragent"); 42 | }); 43 | -------------------------------------------------------------------------------- /lib/pilot/browser_focus.js: -------------------------------------------------------------------------------- 1 | /* vim:ts=4:sts=4:sw=4: 2 | * ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is Ajax.org Code Editor (ACE). 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Ajax.org B.V. 19 | * Portions created by the Initial Developer are Copyright (C) 2010 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * Fabian Jakobs 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of 26 | * either the GNU General Public License Version 2 or later (the "GPL"), or 27 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 28 | * in which case the provisions of the GPL or the LGPL are applicable instead 29 | * of those above. If you wish to allow use of your version of this file only 30 | * under the terms of either the GPL or the LGPL, and not to allow others to 31 | * use your version of this file under the terms of the MPL, indicate your 32 | * decision by deleting the provisions above and replace them with the notice 33 | * and other provisions required by the GPL or the LGPL. If you do not delete 34 | * the provisions above, a recipient may use your version of this file under 35 | * the terms of any one of the MPL, the GPL or the LGPL. 36 | * 37 | * ***** END LICENSE BLOCK ***** */ 38 | 39 | define(function(require, exports, module) { 40 | console.warn("DEPRECATED: 'pilot/browser_focus' is deprecated. Use 'ace/lib/browser_focus' instead"); 41 | module.exports = require("ace/lib/browser_focus"); 42 | }); 43 | -------------------------------------------------------------------------------- /lib/pilot/event_emitter.js: -------------------------------------------------------------------------------- 1 | /* vim:ts=4:sts=4:sw=4: 2 | * ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is Ajax.org Code Editor (ACE). 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Ajax.org B.V. 19 | * Portions created by the Initial Developer are Copyright (C) 2010 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * Fabian Jakobs 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of 26 | * either the GNU General Public License Version 2 or later (the "GPL"), or 27 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 28 | * in which case the provisions of the GPL or the LGPL are applicable instead 29 | * of those above. If you wish to allow use of your version of this file only 30 | * under the terms of either the GPL or the LGPL, and not to allow others to 31 | * use your version of this file under the terms of the MPL, indicate your 32 | * decision by deleting the provisions above and replace them with the notice 33 | * and other provisions required by the GPL or the LGPL. If you do not delete 34 | * the provisions above, a recipient may use your version of this file under 35 | * the terms of any one of the MPL, the GPL or the LGPL. 36 | * 37 | * ***** END LICENSE BLOCK ***** */ 38 | 39 | define(function(require, exports, module) { 40 | console.warn("DEPRECATED: 'pilot/event_emitter' is deprecated. Use 'ace/lib/event_emitter' instead"); 41 | module.exports = require("ace/lib/event_emitter"); 42 | }); 43 | -------------------------------------------------------------------------------- /lib/pilot/fixoldbrowsers.js: -------------------------------------------------------------------------------- 1 | /* vim:ts=4:sts=4:sw=4: 2 | * ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is Ajax.org Code Editor (ACE). 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Ajax.org B.V. 19 | * Portions created by the Initial Developer are Copyright (C) 2010 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * Fabian Jakobs 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of 26 | * either the GNU General Public License Version 2 or later (the "GPL"), or 27 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 28 | * in which case the provisions of the GPL or the LGPL are applicable instead 29 | * of those above. If you wish to allow use of your version of this file only 30 | * under the terms of either the GPL or the LGPL, and not to allow others to 31 | * use your version of this file under the terms of the MPL, indicate your 32 | * decision by deleting the provisions above and replace them with the notice 33 | * and other provisions required by the GPL or the LGPL. If you do not delete 34 | * the provisions above, a recipient may use your version of this file under 35 | * the terms of any one of the MPL, the GPL or the LGPL. 36 | * 37 | * ***** END LICENSE BLOCK ***** */ 38 | 39 | define(function(require, exports, module) { 40 | console.warn("DEPRECATED: 'pilot/fixoldbrowsers' is deprecated. Use 'ace/lib/fixoldbrowsers' instead"); 41 | module.exports = require("ace/lib/fixoldbrowsers"); 42 | }); 43 | -------------------------------------------------------------------------------- /tool/theme.tmpl.js: -------------------------------------------------------------------------------- 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 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(function(require, exports, module) { 39 | 40 | exports.isDark = %isDark%; 41 | exports.cssClass = "%cssClass%"; 42 | exports.cssText = %css%; 43 | 44 | var dom = require("../lib/dom"); 45 | dom.importCssString(exports.cssText, exports.cssClass); 46 | }); 47 | -------------------------------------------------------------------------------- /lib/pilot/index.js: -------------------------------------------------------------------------------- 1 | /* vim:ts=4:sts=4:sw=4: 2 | * ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is Ajax.org Code Editor (ACE). 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Ajax.org B.V. 19 | * Portions created by the Initial Developer are Copyright (C) 2010 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * Fabian Jakobs 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of 26 | * either the GNU General Public License Version 2 or later (the "GPL"), or 27 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 28 | * in which case the provisions of the GPL or the LGPL are applicable instead 29 | * of those above. If you wish to allow use of your version of this file only 30 | * under the terms of either the GPL or the LGPL, and not to allow others to 31 | * use your version of this file under the terms of the MPL, indicate your 32 | * decision by deleting the provisions above and replace them with the notice 33 | * and other provisions required by the GPL or the LGPL. If you do not delete 34 | * the provisions above, a recipient may use your version of this file under 35 | * the terms of any one of the MPL, the GPL or the LGPL. 36 | * 37 | * ***** END LICENSE BLOCK ***** */ 38 | 39 | define(function(require, exports, module) { 40 | require("pilot/browser_focus"); 41 | require("pilot/dom"); 42 | require("pilot/event"); 43 | require("pilot/event_emitter"); 44 | require("pilot/fixoldbrowsers"); 45 | require("pilot/keys"); 46 | require("pilot/lang"); 47 | require("pilot/oop"); 48 | require("pilot/useragent"); 49 | require("pilot/canon"); 50 | }); 51 | -------------------------------------------------------------------------------- /lib/ace/mouse/default_gutter_handler.js: -------------------------------------------------------------------------------- 1 | /* vim:ts=4:sts=4:sw=4: 2 | * ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is Ajax.org Code Editor (ACE). 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Ajax.org B.V. 19 | * Portions created by the Initial Developer are Copyright (C) 2010 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * Fabian Jakobs 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of 26 | * either the GNU General Public License Version 2 or later (the "GPL"), or 27 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 28 | * in which case the provisions of the GPL or the LGPL are applicable instead 29 | * of those above. If you wish to allow use of your version of this file only 30 | * under the terms of either the GPL or the LGPL, and not to allow others to 31 | * use your version of this file under the terms of the MPL, indicate your 32 | * decision by deleting the provisions above and replace them with the notice 33 | * and other provisions required by the GPL or the LGPL. If you do not delete 34 | * the provisions above, a recipient may use your version of this file under 35 | * the terms of any one of the MPL, the GPL or the LGPL. 36 | * 37 | * ***** END LICENSE BLOCK ***** */ 38 | 39 | define(function(require, exports, module) { 40 | "use strict"; 41 | 42 | function GutterHandler(editor) { 43 | editor.setDefaultHandler("gutterclick", function(e) { 44 | var row = e.getDocumentPosition().row; 45 | var selection = editor.session.selection; 46 | 47 | selection.moveCursorTo(row, 0); 48 | selection.selectLine(); 49 | }); 50 | } 51 | 52 | exports.GutterHandler = GutterHandler; 53 | 54 | }); -------------------------------------------------------------------------------- /lib/ace/requirejs/text.js: -------------------------------------------------------------------------------- 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 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 | /** 39 | * Extremely simplified version of the requireJS text plugin 40 | */ 41 | 42 | (function() { 43 | 44 | var globalRequire = require; 45 | 46 | define(function (require, exports, module) { 47 | "use strict"; 48 | 49 | exports.load = function (name, req, onLoad, config) { 50 | if (req.isBrowser) 51 | require("ace/lib/net").get(req.toUrl(name), onLoad); 52 | else 53 | //Using special require.nodeRequire, something added by r.js. 54 | globalRequire.nodeRequire('fs').readFileSync(req.toUrl(name), 'utf8'); 55 | }; 56 | }); 57 | 58 | })(); -------------------------------------------------------------------------------- /lib/pilot/canon.js: -------------------------------------------------------------------------------- 1 | /* vim:ts=4:sts=4:sw=4: 2 | * ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is Ajax.org Code Editor (ACE). 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Ajax.org B.V. 19 | * Portions created by the Initial Developer are Copyright (C) 2010 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * Fabian Jakobs 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of 26 | * either the GNU General Public License Version 2 or later (the "GPL"), or 27 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 28 | * in which case the provisions of the GPL or the LGPL are applicable instead 29 | * of those above. If you wish to allow use of your version of this file only 30 | * under the terms of either the GPL or the LGPL, and not to allow others to 31 | * use your version of this file under the terms of the MPL, indicate your 32 | * decision by deleting the provisions above and replace them with the notice 33 | * and other provisions required by the GPL or the LGPL. If you do not delete 34 | * the provisions above, a recipient may use your version of this file under 35 | * the terms of any one of the MPL, the GPL or the LGPL. 36 | * 37 | * ***** END LICENSE BLOCK ***** */ 38 | 39 | define(function(require, exports, module) { 40 | console.warn("DEPRECATED: 'pilot/canon' is deprecated."); 41 | //return require("ace/lib/dom"); 42 | 43 | exports.addCommand = function() { 44 | console.warn("DEPRECATED: 'canon.addCommand()' is deprecated. Use 'editor.commands.addCommand(command)' instead."); 45 | console.trace(); 46 | } 47 | 48 | exports.removeCommand = function() { 49 | console.warn("DEPRECATED: 'canon.removeCommand()' is deprecated. Use 'editor.commands.removeCommand(command)' instead."); 50 | console.trace(); 51 | } 52 | }); 53 | -------------------------------------------------------------------------------- /lib/ace/ext/static_highlight_test.js: -------------------------------------------------------------------------------- 1 | if (typeof process !== "undefined") { 2 | require("amd-loader"); 3 | require("../test/mockdom"); 4 | } 5 | 6 | define(function(require, exports, module) { 7 | "use strict"; 8 | 9 | var assert = require("assert"); 10 | var highlighter = require("./static_highlight"); 11 | var JavaScriptMode = require("../mode/javascript").Mode; 12 | 13 | // Execution ORDER: test.setUpSuite, setUp, testFn, tearDown, test.tearDownSuite 14 | module.exports = { 15 | timeout: 10000, 16 | 17 | "test simple snippet": function(next) { 18 | var theme = require("../theme/tomorrow"); 19 | var snippet = "/** this is a function\n\ 20 | *\n\ 21 | */\n\ 22 | function hello (a, b, c) {\n\ 23 | console.log(a * b + c + 'sup?');\n\ 24 | }"; 25 | var mode = new JavaScriptMode(); 26 | 27 | var isError = false, result; 28 | try { 29 | result = highlighter.render(snippet, mode, theme); 30 | } 31 | catch (e) { 32 | console.log(e); 33 | isError = true; 34 | } 35 | // todo: write something more meaningful 36 | assert.equal(isError, false); 37 | 38 | next(); 39 | }, 40 | 41 | "test css from theme is used": function(next) { 42 | var theme = require("../theme/tomorrow"); 43 | var snippet = "/** this is a function\n\ 44 | *\n\ 45 | */\n\ 46 | function hello (a, b, c) {\n\ 47 | console.log(a * b + c + 'sup?');\n\ 48 | }"; 49 | var mode = new JavaScriptMode(); 50 | 51 | var isError = false, result; 52 | result = highlighter.render(snippet, mode, theme); 53 | 54 | assert.ok(result.css.indexOf(theme.cssText) !== -1); 55 | 56 | next(); 57 | }, 58 | 59 | "test theme classname should be in output html": function (next) { 60 | var theme = require("../theme/tomorrow"); 61 | var snippet = "/** this is a function\n\ 62 | *\n\ 63 | */\n\ 64 | function hello (a, b, c) {\n\ 65 | console.log(a * b + c + 'sup?');\n\ 66 | }"; 67 | var mode = new JavaScriptMode(); 68 | 69 | var isError = false, result; 70 | result = highlighter.render(snippet, mode, theme); 71 | assert.equal(!!result.html.match(/
/), true); 72 | 73 | next(); 74 | } 75 | }; 76 | 77 | }); 78 | 79 | if (typeof module !== "undefined" && module === require.main) { 80 | require("asyncjs").test.testcase(module.exports).exec(); 81 | } -------------------------------------------------------------------------------- /lib/ace/lib/oop.js: -------------------------------------------------------------------------------- 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 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(function(require, exports, module) { 39 | "use strict"; 40 | 41 | exports.inherits = (function() { 42 | var tempCtor = function() {}; 43 | return function(ctor, superCtor) { 44 | tempCtor.prototype = superCtor.prototype; 45 | ctor.super_ = superCtor.prototype; 46 | ctor.prototype = new tempCtor(); 47 | ctor.prototype.constructor = ctor; 48 | }; 49 | }()); 50 | 51 | exports.mixin = function(obj, mixin) { 52 | for (var key in mixin) { 53 | obj[key] = mixin[key]; 54 | } 55 | }; 56 | 57 | exports.implement = function(proto, mixin) { 58 | exports.mixin(proto, mixin); 59 | }; 60 | 61 | }); 62 | -------------------------------------------------------------------------------- /lib/ace/test/assertions.js: -------------------------------------------------------------------------------- 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 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(function(require, exports, module) { 39 | "use strict"; 40 | 41 | var assert = require("assert"); 42 | 43 | assert.position = function(cursor, row, column) { 44 | assert.equal(cursor.row, row); 45 | assert.equal(cursor.column, column); 46 | }; 47 | 48 | assert.range = function(range, startRow, startColumn, endRow, endColumn) { 49 | assert.position(range.start, startRow, startColumn); 50 | assert.position(range.end, endRow, endColumn); 51 | }; 52 | 53 | assert.notOk = function(value) { 54 | assert.equal(value, false); 55 | }; 56 | 57 | exports.jsonEquals = function(foundJson, expectedJson) { 58 | assert.equal(JSON.stringify(foundJson), JSON.stringify(expectedJson)); 59 | }; 60 | 61 | module.exports = assert; 62 | 63 | }); -------------------------------------------------------------------------------- /lib/ace/mode/sql.js: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * The Original Code is Ajax.org Code Editor (ACE). 3 | * 4 | * Contributor(s): 5 | * Jonathan Camile 6 | * 7 | * Alternatively, the contents of this file may be used under the terms of 8 | * either the GNU General Public License Version 2 or later (the "GPL"), or 9 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 10 | * in which case the provisions of the GPL or the LGPL are applicable instead 11 | * of those above. If you wish to allow use of your version of this file only 12 | * under the terms of either the GPL or the LGPL, and not to allow others to 13 | * use your version of this file under the terms of the MPL, indicate your 14 | * decision by deleting the provisions above and replace them with the notice 15 | * and other provisions required by the GPL or the LGPL. If you do not delete 16 | * the provisions above, a recipient may use your version of this file under 17 | * the terms of any one of the MPL, the GPL or the LGPL. 18 | * 19 | * ***** END LICENSE BLOCK ***** */ 20 | 21 | define(function(require, exports, module) { 22 | "use strict"; 23 | 24 | var oop = require("../lib/oop"); 25 | var TextMode = require("./text").Mode; 26 | var Tokenizer = require("../tokenizer").Tokenizer; 27 | var SqlHighlightRules = require("./sql_highlight_rules").SqlHighlightRules; 28 | var Range = require("../range").Range; 29 | 30 | var Mode = function() { 31 | this.$tokenizer = new Tokenizer(new SqlHighlightRules().getRules()); 32 | }; 33 | oop.inherits(Mode, TextMode); 34 | 35 | (function() { 36 | 37 | this.toggleCommentLines = function(state, doc, startRow, endRow) { 38 | var outdent = true; 39 | var outentedRows = []; 40 | var re = /^(\s*)--/; 41 | 42 | for (var i=startRow; i<= endRow; i++) { 43 | if (!re.test(doc.getLine(i))) { 44 | outdent = false; 45 | break; 46 | } 47 | } 48 | 49 | if (outdent) { 50 | var deleteRange = new Range(0, 0, 0, 0); 51 | for (var i=startRow; i<= endRow; i++) 52 | { 53 | var line = doc.getLine(i); 54 | var m = line.match(re); 55 | deleteRange.start.row = i; 56 | deleteRange.end.row = i; 57 | deleteRange.end.column = m[0].length; 58 | doc.replace(deleteRange, m[1]); 59 | } 60 | } 61 | else { 62 | doc.indentRows(startRow, endRow, "--"); 63 | } 64 | }; 65 | 66 | }).call(Mode.prototype); 67 | 68 | exports.Mode = Mode; 69 | 70 | }); 71 | -------------------------------------------------------------------------------- /lib/ace/mode/css_worker.js: -------------------------------------------------------------------------------- 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 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(function(require, exports, module) { 39 | "use strict"; 40 | 41 | var oop = require("../lib/oop"); 42 | var Mirror = require("../worker/mirror").Mirror; 43 | var CSSLint = require("./css/csslint").CSSLint; 44 | 45 | var Worker = exports.Worker = function(sender) { 46 | Mirror.call(this, sender); 47 | this.setTimeout(200); 48 | }; 49 | 50 | oop.inherits(Worker, Mirror); 51 | 52 | (function() { 53 | 54 | this.onUpdate = function() { 55 | var value = this.doc.getValue(); 56 | 57 | var result = CSSLint.verify(value); 58 | this.sender.emit("csslint", result.messages.map(function(msg) { 59 | delete msg.rule; 60 | return msg; 61 | })); 62 | }; 63 | 64 | }).call(Worker.prototype); 65 | 66 | }); -------------------------------------------------------------------------------- /lib/ace/mode/coffee/coffee-script.js: -------------------------------------------------------------------------------- 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 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(function(require, exports, module) { 39 | 40 | var Lexer = require("./lexer").Lexer; 41 | var parser = require("./parser"); 42 | 43 | var lexer = new Lexer(); 44 | parser.lexer = { 45 | lex: function() { 46 | var tag, _ref2; 47 | _ref2 = this.tokens[this.pos++] || [''], tag = _ref2[0], this.yytext = _ref2[1], this.yylineno = _ref2[2]; 48 | return tag; 49 | }, 50 | setInput: function(tokens) { 51 | this.tokens = tokens; 52 | return this.pos = 0; 53 | }, 54 | upcomingInput: function() { 55 | return ""; 56 | } 57 | }; 58 | parser.yy = require('./nodes'); 59 | 60 | exports.parse = function(code) { 61 | return parser.parse(lexer.tokenize(code)); 62 | }; 63 | }); -------------------------------------------------------------------------------- /demo/kitchen-sink/docs/pgsql.pgsql: -------------------------------------------------------------------------------- 1 | 2 | BEGIN; 3 | 4 | /** 5 | * Samples from PostgreSQL src/tutorial/basics.source 6 | */ 7 | CREATE TABLE weather ( 8 | city varchar(80), 9 | temp_lo int, -- low temperature 10 | temp_hi int, -- high temperature 11 | prcp real, -- precipitation 12 | "date" date 13 | ); 14 | 15 | CREATE TABLE cities ( 16 | name varchar(80), 17 | location point 18 | ); 19 | 20 | 21 | INSERT INTO weather 22 | VALUES ('San Francisco', 46, 50, 0.25, '1994-11-27'); 23 | 24 | INSERT INTO cities 25 | VALUES ('San Francisco', '(-194.0, 53.0)'); 26 | 27 | INSERT INTO weather (city, temp_lo, temp_hi, prcp, "date") 28 | VALUES ('San Francisco', 43, 57, 0.0, '1994-11-29'); 29 | 30 | INSERT INTO weather (date, city, temp_hi, temp_lo) 31 | VALUES ('1994-11-29', 'Hayward', 54, 37); 32 | 33 | 34 | SELECT city, (temp_hi+temp_lo)/2 AS temp_avg, "date" FROM weather; 35 | 36 | SELECT city, temp_lo, temp_hi, prcp, "date", location 37 | FROM weather, cities 38 | WHERE city = name; 39 | 40 | 41 | 42 | /** 43 | * Dollar quotes starting at the end of the line are colored as SQL unless 44 | * a special language tag is used. Pearl and Python are currently implemented 45 | * but lots of others are possible. 46 | */ 47 | create or replace function blob_content_chunked( 48 | in p_data bytea, 49 | in p_chunk integer) 50 | returns setof bytea as $$ 51 | -- Still SQL comments 52 | declare 53 | v_size integer = octet_length(p_data); 54 | begin 55 | for i in 1..v_size by p_chunk loop 56 | return next substring(p_data from i for p_chunk); 57 | end loop; 58 | end; 59 | $$ language plpgsql stable; 60 | 61 | 62 | -- pl/perl 63 | CREATE FUNCTION perl_max (integer, integer) RETURNS integer AS $perl$ 64 | # perl comment... 65 | my ($x,$y) = @_; 66 | if (! defined $x) { 67 | if (! defined $y) { return undef; } 68 | return $y; 69 | } 70 | if (! defined $y) { return $x; } 71 | if ($x > $y) { return $x; } 72 | return $y; 73 | $perl$ LANGUAGE plperl; 74 | 75 | -- pl/python 76 | CREATE FUNCTION usesavedplan() RETURNS trigger AS $python$ 77 | # python comment... 78 | if SD.has_key("plan"): 79 | plan = SD["plan"] 80 | else: 81 | plan = plpy.prepare("SELECT 1") 82 | SD["plan"] = plan 83 | $python$ LANGUAGE plpythonu; 84 | 85 | 86 | -- psql commands 87 | \df cash* 88 | 89 | 90 | -- Some string samples. 91 | select 'don''t do it now;' || 'maybe later'; 92 | select E'dont\'t do it'; 93 | select length('some other''s stuff' || $$cat in hat's stuff $$); 94 | 95 | select $$ strings 96 | over multiple 97 | lines - use dollar quotes 98 | $$; 99 | 100 | END; 101 | -------------------------------------------------------------------------------- /lib/ace/mode/coffee/parser_test.js: -------------------------------------------------------------------------------- 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 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 | if (typeof process !== "undefined") { 39 | require("amd-loader"); 40 | } 41 | 42 | define(function(require, exports, module) { 43 | "use strict"; 44 | 45 | var assert = require("../../test/assertions"); 46 | var coffee = require("../coffee/coffee-script"); 47 | 48 | 49 | module.exports = { 50 | 51 | "test parse valid coffee script": function() { 52 | coffee.parse("square = (x) -> x * x"); 53 | }, 54 | 55 | "test parse invalid coffee script": function() { 56 | try { 57 | coffee.parse("a = 12 f"); 58 | } catch (e) { 59 | assert.ok((e + "").indexOf("Parse error on line 1: Unexpected 'IDENTIFIER'") >= 0); 60 | } 61 | } 62 | }; 63 | 64 | }); 65 | 66 | if (typeof module !== "undefined" && module === require.main) { 67 | require("asyncjs").test.testcase(module.exports).exec(); 68 | } -------------------------------------------------------------------------------- /lib/ace/mode/xml.js: -------------------------------------------------------------------------------- 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 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(function(require, exports, module) { 39 | "use strict"; 40 | 41 | var oop = require("../lib/oop"); 42 | var TextMode = require("./text").Mode; 43 | var Tokenizer = require("../tokenizer").Tokenizer; 44 | var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; 45 | var XmlBehaviour = require("./behaviour/xml").XmlBehaviour; 46 | var XmlFoldMode = require("./folding/xml").FoldMode; 47 | 48 | var Mode = function() { 49 | this.$tokenizer = new Tokenizer(new XmlHighlightRules().getRules()); 50 | this.$behaviour = new XmlBehaviour(); 51 | this.foldingRules = new XmlFoldMode(); 52 | }; 53 | 54 | oop.inherits(Mode, TextMode); 55 | 56 | (function() { 57 | 58 | this.getNextLineIndent = function(state, line, tab) { 59 | return this.$getIndent(line); 60 | }; 61 | 62 | }).call(Mode.prototype); 63 | 64 | exports.Mode = Mode; 65 | }); 66 | -------------------------------------------------------------------------------- /lib/ace/model/editor.js: -------------------------------------------------------------------------------- 1 | /* vim:ts=4:sts=4:sw=4: 2 | * ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is Ajax.org Code Editor (ACE). 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Ajax.org B.V. 19 | * Portions created by the Initial Developer are Copyright (C) 2011 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * Fabian Jakobs 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of 26 | * either the GNU General Public License Version 2 or later (the "GPL"), or 27 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 28 | * in which case the provisions of the GPL or the LGPL are applicable instead 29 | * of those above. If you wish to allow use of your version of this file only 30 | * under the terms of either the GPL or the LGPL, and not to allow others to 31 | * use your version of this file under the terms of the MPL, indicate your 32 | * decision by deleting the provisions above and replace them with the notice 33 | * and other provisions required by the GPL or the LGPL. If you do not delete 34 | * the provisions above, a recipient may use your version of this file under 35 | * the terms of any one of the MPL, the GPL or the LGPL. 36 | * 37 | * ***** END LICENSE BLOCK ***** */ 38 | 39 | define(function(require, exports, module) { 40 | "use strict"; 41 | 42 | var oop = require("ace/lib/oop"); 43 | var EventEmitter = require("ace/lib/event_emitter").EventEmitter; 44 | 45 | var Editor = exports.Editor = function() { 46 | this._buffers = []; 47 | this._windows = []; 48 | }; 49 | 50 | (function() { 51 | 52 | oop.implement(this, EventEmitter); 53 | 54 | this.addBuffer = function(buffer) { 55 | this._buffers.push(buffer); 56 | return this._buffers.length-1; 57 | }; 58 | 59 | this.addWindow = function(win) { 60 | this._windows.push(win); 61 | return this._windows.length-1; 62 | }; 63 | 64 | this.openInWindow = function(bufferId, winId) { 65 | this._windows[winId || 0].setBuffer(this._buffers[bufferId]); 66 | }; 67 | 68 | }).call(Editor.prototype); 69 | 70 | }); -------------------------------------------------------------------------------- /lib/ace/lib/event_emitter_test.js: -------------------------------------------------------------------------------- 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 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 | if (typeof process !== "undefined") { 39 | require("amd-loader"); 40 | } 41 | 42 | define(function(require, exports, module) { 43 | "use strict"; 44 | 45 | var oop = require("../lib/oop"); 46 | var EventEmitter = require("./event_emitter").EventEmitter; 47 | var assert = require("../test/assertions"); 48 | 49 | var Emitter = function() {}; 50 | 51 | oop.implement(Emitter.prototype, EventEmitter); 52 | 53 | module.exports = { 54 | "test: dispatch event with no data" : function() { 55 | var emitter = new Emitter(); 56 | 57 | var called = false; 58 | emitter.addEventListener("juhu", function(e) { 59 | called = true; 60 | assert.equal(e.type, "juhu"); 61 | }); 62 | 63 | emitter._emit("juhu"); 64 | assert.ok(called); 65 | } 66 | }; 67 | 68 | }); 69 | 70 | if (typeof module !== "undefined" && module === require.main) { 71 | require("asyncjs").test.testcase(module.exports).exec() 72 | } -------------------------------------------------------------------------------- /lib/ace/mode/folding/pythonic.js: -------------------------------------------------------------------------------- 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 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(function(require, exports, module) { 39 | "use strict"; 40 | 41 | var oop = require("../../lib/oop"); 42 | var BaseFoldMode = require("./fold_mode").FoldMode; 43 | 44 | var FoldMode = exports.FoldMode = function(markers) { 45 | this.foldingStartMarker = new RegExp("(?:([\\[{])|(" + markers + "))(?:\\s*)(?:#.*)?$"); 46 | }; 47 | oop.inherits(FoldMode, BaseFoldMode); 48 | 49 | (function() { 50 | 51 | this.getFoldWidgetRange = function(session, foldStyle, row) { 52 | var line = session.getLine(row); 53 | var match = line.match(this.foldingStartMarker); 54 | if (match) { 55 | if (match[1]) 56 | return this.openingBracketBlock(session, match[1], row, match.index); 57 | if (match[2]) 58 | return this.indentationBlock(session, row, match.index + match[2].length); 59 | return this.indentationBlock(session, row); 60 | } 61 | } 62 | 63 | }).call(FoldMode.prototype); 64 | 65 | }); -------------------------------------------------------------------------------- /demo/kitchen-sink/docs/xml.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | true 6 | 7 | 26 8 | 25 9 | 21978 10 | 11 | 12 | 14 | 24865670 15 | Continent 16 | Africa 17 | 18 | 20 | 24865675 21 | Continent 22 | Europe 23 | 24 | 26 | 24865673 27 | Continent 28 | South America 29 | 30 | 32 | 28289421 33 | Continent 34 | Antarctic 35 | 36 | 38 | 24865671 39 | Continent 40 | Asia 41 | 42 | 44 | 24865672 45 | Continent 46 | North America 47 | 48 | 50 | 55949070 51 | Continent 52 | Australia 53 | 54 | 55 | -------------------------------------------------------------------------------- /lib/ace/mode/coldfusion.js: -------------------------------------------------------------------------------- 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 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(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 CssMode = require("./css").Mode; 45 | var Tokenizer = require("../tokenizer").Tokenizer; 46 | var ColdfusionHighlightRules = require("./coldfusion_highlight_rules").ColdfusionHighlightRules; 47 | 48 | var Mode = function() { 49 | XmlMode.call(this); 50 | 51 | var highlighter = new ColdfusionHighlightRules(); 52 | this.$tokenizer = new Tokenizer(highlighter.getRules()); 53 | 54 | this.$embeds = highlighter.getEmbeds(); 55 | this.createModeDelegates({ 56 | "js-": JavaScriptMode, 57 | "css-": CssMode 58 | }); 59 | }; 60 | oop.inherits(Mode, XmlMode); 61 | 62 | (function() { 63 | 64 | this.getNextLineIndent = function(state, line, tab) { 65 | return this.$getIndent(line); 66 | }; 67 | 68 | }).call(Mode.prototype); 69 | 70 | exports.Mode = Mode; 71 | }); 72 | -------------------------------------------------------------------------------- /lib/ace/mode/text_test.js: -------------------------------------------------------------------------------- 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 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 | if (typeof process !== "undefined") { 39 | require("amd-loader"); 40 | } 41 | 42 | define(function(require, exports, module) { 43 | "use strict"; 44 | 45 | var EditSession = require("../edit_session").EditSession; 46 | var TextMode = require("./text").Mode; 47 | var assert = require("../test/assertions"); 48 | 49 | module.exports = { 50 | setUp : function() { 51 | this.mode = new TextMode(); 52 | }, 53 | 54 | "test: toggle comment lines should not do anything" : function() { 55 | var session = new EditSession([" abc", "cde", "fg"]); 56 | 57 | this.mode.toggleCommentLines("start", session, 0, 1); 58 | assert.equal([" abc", "cde", "fg"].join("\n"), session.toString()); 59 | }, 60 | 61 | 62 | "text: lines should not be indented" : function() { 63 | assert.equal("", this.mode.getNextLineIndent("start", " abc", " ")); 64 | } 65 | }; 66 | 67 | }); 68 | 69 | if (typeof module !== "undefined" && module === require.main) { 70 | require("asyncjs").test.testcase(module.exports).exec() 71 | } -------------------------------------------------------------------------------- /lib/ace/mouse/fold_handler.js: -------------------------------------------------------------------------------- 1 | /* vim:ts=4:sts=4:sw=4: 2 | * ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is Ajax.org Code Editor (ACE). 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Ajax.org B.V. 19 | * Portions created by the Initial Developer are Copyright (C) 2010 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * Fabian Jakobs 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of 26 | * either the GNU General Public License Version 2 or later (the "GPL"), or 27 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 28 | * in which case the provisions of the GPL or the LGPL are applicable instead 29 | * of those above. If you wish to allow use of your version of this file only 30 | * under the terms of either the GPL or the LGPL, and not to allow others to 31 | * use your version of this file under the terms of the MPL, indicate your 32 | * decision by deleting the provisions above and replace them with the notice 33 | * and other provisions required by the GPL or the LGPL. If you do not delete 34 | * the provisions above, a recipient may use your version of this file under 35 | * the terms of any one of the MPL, the GPL or the LGPL. 36 | * 37 | * ***** END LICENSE BLOCK ***** */ 38 | 39 | define(function(require, exports, module) { 40 | "use strict"; 41 | 42 | function FoldHandler(editor) { 43 | 44 | editor.on("click", function(e) { 45 | var position = e.getDocumentPosition(); 46 | var session = editor.session; 47 | 48 | // If the user dclicked on a fold, then expand it. 49 | var fold = session.getFoldAt(position.row, position.column, 1); 50 | if (fold) { 51 | if (e.getAccelKey()) 52 | session.removeFold(fold); 53 | else 54 | session.expandFold(fold); 55 | 56 | e.stop(); 57 | } 58 | }); 59 | 60 | editor.on("gutterclick", function(e) { 61 | if (e.domEvent.target.className.indexOf("ace_fold-widget") != -1) { 62 | var row = e.getDocumentPosition().row; 63 | editor.session.onFoldWidgetClick(row, e.domEvent); 64 | e.stop(); 65 | } 66 | }); 67 | } 68 | 69 | exports.FoldHandler = FoldHandler; 70 | 71 | }); -------------------------------------------------------------------------------- /lib/ace/mode/svg_highlight_rules.js: -------------------------------------------------------------------------------- 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 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(function(require, exports, module) { 39 | "use strict"; 40 | 41 | var oop = require("../lib/oop"); 42 | var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; 43 | var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; 44 | var xmlUtil = require("./xml_util"); 45 | 46 | var SvgHighlightRules = function() { 47 | XmlHighlightRules.call(this); 48 | 49 | this.$rules.start.splice(3, 0, { 50 | token : "meta.tag", 51 | regex : "<(?=\s*script)", 52 | next : "script" 53 | }); 54 | 55 | xmlUtil.tag(this.$rules, "script", "js-start"); 56 | 57 | this.embedRules(JavaScriptHighlightRules, "js-", [{ 58 | token: "comment", 59 | regex: "\\/\\/.*(?=<\\/script>)", 60 | next: "tag" 61 | }, { 62 | token: "meta.tag", 63 | regex: "<\\/(?=script)", 64 | next: "tag" 65 | }]); 66 | }; 67 | 68 | oop.inherits(SvgHighlightRules, XmlHighlightRules); 69 | 70 | exports.SvgHighlightRules = SvgHighlightRules; 71 | }); 72 | -------------------------------------------------------------------------------- /lib/ace/mode/css_worker_test.js: -------------------------------------------------------------------------------- 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 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 | if (typeof process !== "undefined") { 39 | require("amd-loader"); 40 | } 41 | 42 | define(function(require, exports, module) { 43 | "use strict"; 44 | 45 | var assert = require("../test/assertions"); 46 | var Worker = require("./css_worker").Worker; 47 | 48 | 49 | module.exports = { 50 | setUp : function() { 51 | this.sender = { 52 | on: function() {}, 53 | callback: function(data, id) { 54 | this.data = data; 55 | }, 56 | events: [], 57 | emit: function(type, e) { 58 | this.events.push([type, e]); 59 | } 60 | }; 61 | }, 62 | 63 | "test check for syntax error": function() { 64 | var worker = new Worker(this.sender); 65 | worker.setValue("Juhu Kinners"); 66 | worker.deferredUpdate.call(); 67 | assert.equal(this.sender.events[0][1][0].type, "error"); 68 | } 69 | }; 70 | 71 | }); 72 | 73 | if (typeof module !== "undefined" && module === require.main) { 74 | require("asyncjs").test.testcase(module.exports).exec(); 75 | } -------------------------------------------------------------------------------- /lib/ace/renderloop.js: -------------------------------------------------------------------------------- 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 23 | * Irakli Gozalishvili (http://jeditoolkit.com) 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of 26 | * either the GNU General Public License Version 2 or later (the "GPL"), or 27 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 28 | * in which case the provisions of the GPL or the LGPL are applicable instead 29 | * of those above. If you wish to allow use of your version of this file only 30 | * under the terms of either the GPL or the LGPL, and not to allow others to 31 | * use your version of this file under the terms of the MPL, indicate your 32 | * decision by deleting the provisions above and replace them with the notice 33 | * and other provisions required by the GPL or the LGPL. If you do not delete 34 | * the provisions above, a recipient may use your version of this file under 35 | * the terms of any one of the MPL, the GPL or the LGPL. 36 | * 37 | * ***** END LICENSE BLOCK ***** */ 38 | 39 | define(function(require, exports, module) { 40 | "use strict"; 41 | 42 | var event = require("./lib/event"); 43 | 44 | var RenderLoop = function(onRender, win) { 45 | this.onRender = onRender; 46 | this.pending = false; 47 | this.changes = 0; 48 | this.window = win || window; 49 | }; 50 | 51 | (function() { 52 | 53 | this.schedule = function(change) { 54 | //this.onRender(change); 55 | //return; 56 | this.changes = this.changes | change; 57 | if (!this.pending) { 58 | this.pending = true; 59 | var _self = this; 60 | event.nextTick(function() { 61 | _self.pending = false; 62 | var changes; 63 | while (changes = _self.changes) { 64 | _self.changes = 0; 65 | _self.onRender(changes); 66 | } 67 | }, this.window); 68 | } 69 | }; 70 | 71 | }).call(RenderLoop.prototype); 72 | 73 | exports.RenderLoop = RenderLoop; 74 | }); 75 | -------------------------------------------------------------------------------- /demo/kitchen-sink/docs/plaintext.txt: -------------------------------------------------------------------------------- 1 | Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. 2 | 3 | Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. 4 | 5 | Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. 6 | 7 | Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. 8 | 9 | Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis. 10 | 11 | At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, At accusam aliquyam diam diam dolore dolores duo eirmod eos erat, et nonumy sed tempor et et invidunt justo labore Stet clita ea et gubergren, kasd magna no rebum. sanctus sea sed takimata ut vero voluptua. est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur -------------------------------------------------------------------------------- /lib/ace/mode/textile.js: -------------------------------------------------------------------------------- 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 | * Kelley van Evert 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(function(require, exports, module) { 39 | "use strict"; 40 | 41 | var oop = require("../lib/oop"); 42 | var TextMode = require("./text").Mode; 43 | var Tokenizer = require("../tokenizer").Tokenizer; 44 | var TextileHighlightRules = require("./textile_highlight_rules").TextileHighlightRules; 45 | var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; 46 | 47 | var Mode = function() { 48 | this.$tokenizer = new Tokenizer(new TextileHighlightRules().getRules()); 49 | this.$outdent = new MatchingBraceOutdent(); 50 | }; 51 | oop.inherits(Mode, TextMode); 52 | 53 | (function() { 54 | this.getNextLineIndent = function(state, line, tab) { 55 | if (state == "intag") 56 | return tab; 57 | 58 | return ""; 59 | }; 60 | 61 | this.checkOutdent = function(state, line, input) { 62 | return this.$outdent.checkOutdent(line, input); 63 | }; 64 | 65 | this.autoOutdent = function(state, doc, row) { 66 | this.$outdent.autoOutdent(doc, row); 67 | }; 68 | 69 | }).call(Mode.prototype); 70 | 71 | exports.Mode = Mode; 72 | 73 | }); 74 | -------------------------------------------------------------------------------- /lib/ace/mode/coffee_tokenizer_test.js: -------------------------------------------------------------------------------- 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 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 | if (typeof process !== "undefined") { 39 | require("amd-loader"); 40 | } 41 | 42 | define(function(require, exports, module) { 43 | "use strict"; 44 | 45 | var Mode = require("./coffee").Mode; 46 | var assert = require("../test/assertions"); 47 | 48 | module.exports = { 49 | setUp : function() { 50 | this.tokenizer = new Mode().getTokenizer(); 51 | }, 52 | 53 | "test: tokenize keyword": function() { 54 | var tokens = this.tokenizer.getLineTokens("for", "start").tokens; 55 | assert.equal(tokens.length, 1); 56 | assert.equal(tokens[0].type, "keyword"); 57 | }, 58 | 59 | // TODO: disable. not yet implemented 60 | "!test tokenize string with interpolation": function() { 61 | var tokens = this.tokenizer.getLineTokens('"#{ 22 / 7 } is a decent approximation of π"', "start").tokens; 62 | console.log(tokens); 63 | assert.equal(tokens.length, 12); 64 | //assert.equal(tokens[0].type, "keyword"); 65 | } 66 | }; 67 | 68 | }); 69 | 70 | if (typeof module !== "undefined" && module === require.main) { 71 | require("asyncjs").test.testcase(module.exports).exec(); 72 | } -------------------------------------------------------------------------------- /experiments/cut_copy.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | Text Events 8 | 9 | 10 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
32 |
33 | 34 | 35 |
36 | 37 |
38 | 39 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /lib/ace/ace.js: -------------------------------------------------------------------------------- 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 Mozilla Skywriter. 15 | * 16 | * The Initial Developer of the Original Code is 17 | * Mozilla. 18 | * Portions created by the Initial Developer are Copyright (C) 2009 19 | * the Initial Developer. All Rights Reserved. 20 | * 21 | * Contributor(s): 22 | * Kevin Dangoor (kdangoor@mozilla.com) 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(function(require, exports, module) { 39 | "use strict"; 40 | 41 | require("./lib/fixoldbrowsers"); 42 | 43 | var Dom = require("./lib/dom"); 44 | var Event = require("./lib/event"); 45 | 46 | var Editor = require("./editor").Editor; 47 | var EditSession = require("./edit_session").EditSession; 48 | var UndoManager = require("./undomanager").UndoManager; 49 | var Renderer = require("./virtual_renderer").VirtualRenderer; 50 | 51 | exports.edit = function(el) { 52 | if (typeof(el) == "string") { 53 | el = document.getElementById(el); 54 | } 55 | 56 | var doc = new EditSession(Dom.getInnerText(el)); 57 | doc.setUndoManager(new UndoManager()); 58 | el.innerHTML = ''; 59 | 60 | var editor = new Editor(new Renderer(el, require("./theme/textmate"))); 61 | editor.setSession(doc); 62 | 63 | var env = {}; 64 | env.document = doc; 65 | env.editor = editor; 66 | editor.resize(); 67 | Event.addListener(window, "resize", function() { 68 | editor.resize(); 69 | }); 70 | el.env = env; 71 | // Store env on editor such that it can be accessed later on from 72 | // the returned object. 73 | editor.env = env; 74 | return editor; 75 | }; 76 | 77 | }); -------------------------------------------------------------------------------- /lib/ace/mode/folding/html.js: -------------------------------------------------------------------------------- 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 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(function(require, exports, module) { 39 | "use strict"; 40 | 41 | var oop = require("../../lib/oop"); 42 | var MixedFoldMode = require("./mixed").FoldMode; 43 | var XmlFoldMode = require("./xml").FoldMode; 44 | var CStyleFoldMode = require("./cstyle").FoldMode; 45 | 46 | var FoldMode = exports.FoldMode = function() { 47 | MixedFoldMode.call(this, new XmlFoldMode({ 48 | // void elements 49 | "area": 1, 50 | "base": 1, 51 | "br": 1, 52 | "col": 1, 53 | "command": 1, 54 | "embed": 1, 55 | "hr": 1, 56 | "img": 1, 57 | "input": 1, 58 | "keygen": 1, 59 | "link": 1, 60 | "meta": 1, 61 | "param": 1, 62 | "source": 1, 63 | "track": 1, 64 | "wbr": 1, 65 | 66 | // optional tags 67 | "li": 1, 68 | "dt": 1, 69 | "dd": 1, 70 | "p": 1, 71 | "rt": 1, 72 | "rp": 1, 73 | "optgroup": 1, 74 | "option": 1, 75 | "colgroup": 1, 76 | "td": 1, 77 | "th": 1 78 | }), { 79 | "js-": new CStyleFoldMode(), 80 | "css-": new CStyleFoldMode() 81 | }); 82 | }; 83 | 84 | oop.inherits(FoldMode, MixedFoldMode); 85 | 86 | }); -------------------------------------------------------------------------------- /lib/ace/mode/matching_brace_outdent.js: -------------------------------------------------------------------------------- 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 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(function(require, exports, module) { 39 | "use strict"; 40 | 41 | var Range = require("../range").Range; 42 | 43 | var MatchingBraceOutdent = function() {}; 44 | 45 | (function() { 46 | 47 | this.checkOutdent = function(line, input) { 48 | if (! /^\s+$/.test(line)) 49 | return false; 50 | 51 | return /^\s*\}/.test(input); 52 | }; 53 | 54 | this.autoOutdent = function(doc, row) { 55 | var line = doc.getLine(row); 56 | var match = line.match(/^(\s*\})/); 57 | 58 | if (!match) return 0; 59 | 60 | var column = match[1].length; 61 | var openBracePos = doc.findMatchingBracket({row: row, column: column}); 62 | 63 | if (!openBracePos || openBracePos.row == row) return 0; 64 | 65 | var indent = this.$getIndent(doc.getLine(openBracePos.row)); 66 | doc.replace(new Range(row, 0, row, column-1), indent); 67 | }; 68 | 69 | this.$getIndent = function(line) { 70 | var match = line.match(/^(\s+)/); 71 | if (match) { 72 | return match[1]; 73 | } 74 | 75 | return ""; 76 | }; 77 | 78 | }).call(MatchingBraceOutdent.prototype); 79 | 80 | exports.MatchingBraceOutdent = MatchingBraceOutdent; 81 | }); 82 | -------------------------------------------------------------------------------- /lib/ace/mode/svg.js: -------------------------------------------------------------------------------- 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 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(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 | -------------------------------------------------------------------------------- /lib/ace/mode/matching_parens_outdent.js: -------------------------------------------------------------------------------- 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 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(function(require, exports, module) { 39 | "use strict"; 40 | 41 | var Range = require("../range").Range; 42 | 43 | var MatchingParensOutdent = function() {}; 44 | 45 | (function() { 46 | 47 | this.checkOutdent = function(line, input) { 48 | if (! /^\s+$/.test(line)) 49 | return false; 50 | 51 | return /^\s*\)/.test(input); 52 | }; 53 | 54 | this.autoOutdent = function(doc, row) { 55 | var line = doc.getLine(row); 56 | var match = line.match(/^(\s*\))/); 57 | 58 | if (!match) return 0; 59 | 60 | var column = match[1].length; 61 | var openBracePos = doc.findMatchingBracket({row: row, column: column}); 62 | 63 | if (!openBracePos || openBracePos.row == row) return 0; 64 | 65 | var indent = this.$getIndent(doc.getLine(openBracePos.row)); 66 | doc.replace(new Range(row, 0, row, column-1), indent); 67 | }; 68 | 69 | this.$getIndent = function(line) { 70 | var match = line.match(/^(\s+)/); 71 | if (match) { 72 | return match[1]; 73 | } 74 | 75 | return ""; 76 | }; 77 | 78 | }).call(MatchingParensOutdent.prototype); 79 | 80 | exports.MatchingParensOutdent = MatchingParensOutdent; 81 | }); 82 | -------------------------------------------------------------------------------- /lib/ace/mode/pgsql.js: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * The Original Code is Ajax.org Code Editor (ACE). 3 | * 4 | * Contributor(s): 5 | * Jonathan Camile 6 | * 7 | * Alternatively, the contents of this file may be used under the terms of 8 | * either the GNU General Public License Version 2 or later (the "GPL"), or 9 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 10 | * in which case the provisions of the GPL or the LGPL are applicable instead 11 | * of those above. If you wish to allow use of your version of this file only 12 | * under the terms of either the GPL or the LGPL, and not to allow others to 13 | * use your version of this file under the terms of the MPL, indicate your 14 | * decision by deleting the provisions above and replace them with the notice 15 | * and other provisions required by the GPL or the LGPL. If you do not delete 16 | * the provisions above, a recipient may use your version of this file under 17 | * the terms of any one of the MPL, the GPL or the LGPL. 18 | * 19 | * ***** END LICENSE BLOCK ***** */ 20 | 21 | define(function(require, exports, module) { 22 | 23 | var oop = require("ace/lib/oop"); 24 | var TextMode = require("ace/mode/text").Mode; 25 | var Tokenizer = require("ace/tokenizer").Tokenizer; 26 | var PgsqlHighlightRules = require("ace/mode/pgsql_highlight_rules").PgsqlHighlightRules; 27 | var Range = require("ace/range").Range; 28 | // var EditSession = require("ace/edit_session").EditSession; 29 | 30 | var Mode = function() { 31 | this.$tokenizer = new Tokenizer(new PgsqlHighlightRules().getRules()); 32 | }; 33 | oop.inherits(Mode, TextMode); 34 | 35 | (function() { 36 | 37 | this.toggleCommentLines = function(state, doc, startRow, endRow) { 38 | var outdent = true; 39 | // var outentedRows = []; 40 | var re = /^(\s*)--/; 41 | 42 | for (var i=startRow; i<= endRow; i++) { 43 | if (!re.test(doc.getLine(i))) { 44 | outdent = false; 45 | break; 46 | } 47 | } 48 | 49 | if (outdent) { 50 | var deleteRange = new Range(0, 0, 0, 0); 51 | for (var i=startRow; i<= endRow; i++) 52 | { 53 | var line = doc.getLine(i); 54 | var m = line.match(re); 55 | deleteRange.start.row = i; 56 | deleteRange.end.row = i; 57 | deleteRange.end.column = m[0].length; 58 | doc.replace(deleteRange, m[1]); 59 | } 60 | } 61 | else { 62 | doc.indentRows(startRow, endRow, "--"); 63 | } 64 | }; 65 | 66 | 67 | this.getNextLineIndent = function(state, line, tab) { 68 | if (state == "start" || state == "keyword.statementEnd") { 69 | return ""; 70 | } else { 71 | return this.$getIndent(line); // Keep whatever indent the previous line has 72 | } 73 | } 74 | 75 | }).call(Mode.prototype); 76 | 77 | exports.Mode = Mode; 78 | }); 79 | -------------------------------------------------------------------------------- /demo/kitchen-sink/docs/svg.svg: -------------------------------------------------------------------------------- 1 | 5 | 6 | Test Tube Progress Bar 7 | Created for the Web Directions SVG competition 8 | 9 |