You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ga...@apache.org on 2013/10/29 16:39:50 UTC

[05/51] [partial] working replacement

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/sh_highlight_rules.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/sh_highlight_rules.js b/src/fauxton/assets/js/libs/ace/mode/sh_highlight_rules.js
new file mode 100644
index 0000000..d9ed560
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/sh_highlight_rules.js
@@ -0,0 +1,144 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Distributed under the BSD license:
+ *
+ * Copyright (c) 2010, Ajax.org B.V.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Ajax.org B.V. nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+define(function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var reservedKeywords = exports.reservedKeywords = (
+        '!|{|}|case|do|done|elif|else|'+
+        'esac|fi|for|if|in|then|until|while|'+
+        '&|;|export|local|read|typeset|unset|'+
+        'elif|select|set'
+    );
+
+var languageConstructs = exports.languageConstructs = (
+    '[|]|alias|bg|bind|break|builtin|'+
+     'cd|command|compgen|complete|continue|'+
+     'dirs|disown|echo|enable|eval|exec|'+
+     'exit|fc|fg|getopts|hash|help|history|'+
+     'jobs|kill|let|logout|popd|printf|pushd|'+
+     'pwd|return|set|shift|shopt|source|'+
+     'suspend|test|times|trap|type|ulimit|'+
+     'umask|unalias|wait'
+);
+
+var ShHighlightRules = function() {
+    var keywordMapper = this.createKeywordMapper({
+        "keyword": reservedKeywords,
+        "support.function.builtin": languageConstructs,
+        "invalid.deprecated": "debugger"
+    }, "identifier");
+
+    var integer = "(?:(?:[1-9]\\d*)|(?:0))";
+    // var integer = "(?:" + decimalInteger + ")";
+
+    var fraction = "(?:\\.\\d+)";
+    var intPart = "(?:\\d+)";
+    var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))";
+    var exponentFloat = "(?:(?:" + pointFloat + "|" +  intPart + ")" + ")";
+    var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")";
+    var fileDescriptor = "(?:&" + intPart + ")";
+
+    var variableName = "[a-zA-Z][a-zA-Z0-9_]*";
+    var variable = "(?:(?:\\$" + variableName + ")|(?:" + variableName + "=))";
+
+    var builtinVariable = "(?:\\$(?:SHLVL|\\$|\\!|\\?))";
+
+    var func = "(?:" + variableName + "\\s*\\(\\))";
+
+    this.$rules = {
+        "start" : [{
+            token : "constant",
+            regex : /\\./
+        }, {
+            token : ["text", "comment"],
+            regex : /(^|\s)(#.*)$/
+        }, {
+            token : "string",
+            regex : '"',
+            push : [{
+                token : "constant.language.escape",
+                regex : /\\(?:[$abeEfnrtv\\'"]|x[a-fA-F\d]{1,2}|u[a-fA-F\d]{4}([a-fA-F\d]{4})?|c.|\d{1,3})/
+            }, {
+                token : "constant",
+                regex : /\$\w+/
+            }, {
+                token : "string",
+                regex : '"',
+                next: "pop"
+            }, {
+                defaultToken: "string"
+            }]
+        }, {
+            token : "variable.language",
+            regex : builtinVariable
+        }, {
+            token : "variable",
+            regex : variable
+        }, {
+            token : "support.function",
+            regex : func
+        }, {
+            token : "support.function",
+            regex : fileDescriptor
+        }, {
+            token : "string",           // ' string
+            start : "'", end : "'"
+        }, {
+            token : "constant.numeric", // float
+            regex : floatNumber
+        }, {
+            token : "constant.numeric", // integer
+            regex : integer + "\\b"
+        }, {
+            token : keywordMapper,
+            regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
+        }, {
+            token : "keyword.operator",
+            regex : "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!="
+        }, {
+            token : "paren.lparen",
+            regex : "[\\[\\(\\{]"
+        }, {
+            token : "paren.rparen",
+            regex : "[\\]\\)\\}]"
+        } ]
+    };
+    
+    this.normalizeRules();
+};
+
+oop.inherits(ShHighlightRules, TextHighlightRules);
+
+exports.ShHighlightRules = ShHighlightRules;
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/sjs.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/sjs.js b/src/fauxton/assets/js/libs/ace/mode/sjs.js
new file mode 100644
index 0000000..e075d60
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/sjs.js
@@ -0,0 +1,59 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Distributed under the BSD license:
+ *
+ * Copyright (c) 2010, Ajax.org B.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Ajax.org B.V. nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+define(function(require, exports, module) {
+"use strict";
+var oop = require("../lib/oop");
+var JSMode = require("./javascript").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var SJSHighlightRules = require("./sjs_highlight_rules").SJSHighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+var Mode = function() {
+    var highlighter = new SJSHighlightRules();
+
+    this.$tokenizer = new Tokenizer(highlighter.getRules());
+    this.$outdent = new MatchingBraceOutdent();
+    this.$behaviour = new CstyleBehaviour();
+    this.$keywordList = highlighter.$keywordList;
+    this.foldingRules = new CStyleFoldMode();
+};
+oop.inherits(Mode, JSMode);
+(function() {
+    // disable jshint
+    this.createWorker = function(session) {
+        return null;
+    }
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/sjs_highlight_rules.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/sjs_highlight_rules.js b/src/fauxton/assets/js/libs/ace/mode/sjs_highlight_rules.js
new file mode 100644
index 0000000..29ddda3
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/sjs_highlight_rules.js
@@ -0,0 +1,233 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Distributed under the BSD license:
+ *
+ * Copyright (c) 2010, Ajax.org B.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Ajax.org B.V. nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+define(function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var SJSHighlightRules = function() {
+    var parent = new JavaScriptHighlightRules();
+    var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
+        "u[0-9a-fA-F]{4}|" + // unicode
+        "[0-2][0-7]{0,2}|" + // oct
+        "3[0-6][0-7]?|" + // oct
+        "37[0-7]?|" + // oct
+        "[4-7][0-7]?|" + //oct
+        ".)";
+
+    var contextAware = function(f) {
+        f.isContextAware = true;
+        return f;
+    };
+
+    var ctxBegin = function(opts) {
+        return {
+            token: opts.token,
+            regex: opts.regex,
+            next: contextAware(function(currentState, stack) {
+                if (stack.length === 0)
+                    stack.unshift(currentState);
+                stack.unshift(opts.next);
+                return opts.next;
+            }),
+        };
+    };
+
+    var ctxEnd = function(opts) {
+        return {
+            token: opts.token,
+            regex: opts.regex,
+            next: contextAware(function(currentState, stack) {
+                stack.shift();
+                return stack[0] || "start";
+            }),
+        };
+    };
+
+    this.$rules = parent.$rules;
+    this.$rules.no_regex = [
+        {
+            token: "keyword",
+            regex: "(waitfor|or|and|collapse|spawn|retract)\\b"
+        },
+        {
+            token: "keyword.operator",
+            regex: "(->|=>|\\.\\.)"
+        },
+        {
+            token: "variable.language",
+            regex: "(hold|default)\\b"
+        },
+        ctxBegin({
+            token: "string",
+            regex: "`",
+            next: "bstring"
+        }),
+        ctxBegin({
+            token: "string",
+            regex: '"',
+            next: "qqstring"
+        }),
+        ctxBegin({
+            token: "string",
+            regex: '"',
+            next: "qqstring"
+        }),
+        {
+            token: ["paren.lparen", "text", "paren.rparen"],
+            regex: "(\\{)(\\s*)(\\|)",
+            next: "block_arguments",
+        }
+
+    ].concat(this.$rules.no_regex);
+
+    this.$rules.block_arguments = [
+        {
+            token: "paren.rparen",
+            regex: "\\|",
+            next: "no_regex",
+        }
+    ].concat(this.$rules.function_arguments);
+
+    this.$rules.bstring = [
+        {
+            token : "constant.language.escape",
+            regex : escapedRe
+        },
+        {
+            token : "string",
+            regex : "\\\\$",
+            next: "bstring"
+        },
+        ctxBegin({
+            token : "paren.lparen",
+            regex : "\\$\\{",
+            next: "string_interp"
+        }),
+        ctxBegin({
+            token : "paren.lparen",
+            regex : "\\$",
+            next: "bstring_interp_single"
+        }),
+        ctxEnd({
+            token : "string",
+            regex : "`",
+        }),
+        {
+            defaultToken: "string"
+        }
+    ];
+    
+    this.$rules.qqstring = [
+        {
+            token : "constant.language.escape",
+            regex : escapedRe
+        },
+        {
+            token : "string",
+            regex : "\\\\$",
+            next: "qqstring",
+        },
+        ctxBegin({
+            token : "paren.lparen",
+            regex : "#\\{",
+            next: "string_interp"
+        }),
+        ctxEnd({
+            token : "string",
+            regex : '"',
+        }),
+        {
+            defaultToken: "string"
+        }
+    ];
+
+    // collect all context-aware (or stateless), brace-less
+    // states. This gives us most normal highlighting
+    // for use within interpreted contexts
+    // without interfering with context nesting
+    var embeddableRules = [];
+    for (var i=0; i<this.$rules.no_regex.length; i++) {
+        var rule = this.$rules.no_regex[i];
+        var token = String(rule.token);
+        if(token.indexOf('paren') == -1 && (!rule.next || rule.next.isContextAware)) {
+            embeddableRules.push(rule);
+        }
+    };
+
+    this.$rules.string_interp = [
+        ctxEnd({
+            token: "paren.rparen",
+            regex: "\\}"
+        }),
+        ctxBegin({
+            token: "paren.lparen",
+            regex: '{',
+            next: "string_interp"
+        }),
+    ].concat(embeddableRules);
+
+    // backtick strings can have single interpolation, which accept
+    // \w+ followed by an optional set of function call parens
+    this.$rules.bstring_interp_single = [
+        {
+            token: ["identifier", "paren.lparen"],
+            regex: '(\\w+)(\\()',
+            next: 'bstring_interp_single_call'
+        },
+        // identifier-only match ends this interp
+        ctxEnd({
+            token : "identifier",
+            regex : "\\w*",
+        })
+    ];
+    
+    // the call part of a bstring_interp_single
+    // is terminated by a close paren `)`, but
+    // can have nested parens.
+    this.$rules.bstring_interp_single_call = [
+        ctxBegin({
+            token: "paren.lparen",
+            regex: "\\(",
+            next: "bstring_interp_single_call"
+        }),
+        ctxEnd({
+            token: "paren.rparen",
+            regex: "\\)"
+        })
+    ].concat(embeddableRules);
+}
+oop.inherits(SJSHighlightRules, TextHighlightRules);
+
+exports.SJSHighlightRules = SJSHighlightRules;
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/snippets.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/snippets.js b/src/fauxton/assets/js/libs/ace/mode/snippets.js
new file mode 100644
index 0000000..865e0b3
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/snippets.js
@@ -0,0 +1,112 @@
+define(function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var SnippetHighlightRules = function() {
+
+    var builtins = "SELECTION|CURRENT_WORD|SELECTED_TEXT|CURRENT_LINE|LINE_INDEX|" +
+        "LINE_NUMBER|SOFT_TABS|TAB_SIZE|FILENAME|FILEPATH|FULLNAME";
+
+    this.$rules = {
+        "start" : [
+            {token:"constant.language.escape", regex: /\\[\$}`\\]/},
+            {token:"keyword", regex: "\\$(?:TM_)?(?:" + builtins + ")\\b"},
+            {token:"variable", regex: "\\$\\w+"},
+            {onMatch: function(value, state, stack) {
+                if (stack[1])
+                    stack[1]++;
+                else
+                    stack.unshift(state, 1);
+                return this.tokenName;
+            }, tokenName: "markup.list", regex: "\\${", next: "varDecl"},
+            {onMatch: function(value, state, stack) {
+                if (!stack[1])
+                    return "text";
+                stack[1]--;
+                if (!stack[1])
+                    stack.splice(0,2);
+                return this.tokenName;
+            }, tokenName: "markup.list", regex: "}"},
+            {token: "doc.comment", regex:/^\${2}-{5,}$/}
+        ],
+        "varDecl" : [
+            {regex: /\d+\b/, token: "constant.numeric"},
+            {token:"keyword", regex: "(?:TM_)?(?:" + builtins + ")\\b"},
+            {token:"variable", regex: "\\w+"},
+            {regex: /:/, token: "punctuation.operator", next: "start"},
+            {regex: /\//, token: "string.regex", next: "regexp"},
+            {regex: "", next: "start"}
+        ],
+        "regexp" : [
+            {regex: /\\./, token: "escape"},
+            {regex: /\[/, token: "regex.start", next: "charClass"},
+            {regex: "/", token: "string.regex", next: "format"},
+            //{"default": "string.regex"},
+            {"token": "string.regex", regex:"."}
+        ],
+        charClass : [
+            {regex: "\\.", token: "escape"},
+            {regex: "\\]", token: "regex.end", next: "regexp"},
+            {"token": "string.regex", regex:"."}
+        ],
+        "format" : [
+            {regex: /\\[ulULE]/, token: "keyword"},
+            {regex: /\$\d+/, token: "variable"},
+            {regex: "/[gim]*:?", token: "string.regex", next: "start"},
+            // {"default": "string"},
+            {"token": "string", regex:"."}
+        ]
+    };
+};
+oop.inherits(SnippetHighlightRules, TextHighlightRules);
+
+exports.SnippetHighlightRules = SnippetHighlightRules;
+
+var SnippetGroupHighlightRules = function() {
+    this.$rules = {
+        "start" : [
+			{token: "text", regex: "^\\t", next: "sn-start"},
+			{token:"invalid", regex: /^ \s*/},
+            {token:"comment", regex: /^#.*/},
+            {token:"constant.language.escape", regex: "^regex ", next: "regex"},
+            {token:"constant.language.escape", regex: "^(trigger|endTrigger|name|snippet|guard|endGuard|tabTrigger|key)\\b"}
+        ],
+		"regex" : [
+			{token:"text", regex: "\\."},
+			{token:"keyword", regex: "/"},
+			{token:"empty", regex: "$", next: "start"}
+		]
+    };
+	this.embedRules(SnippetHighlightRules, "sn-", [
+		{token: "text", regex: "^\\t", next: "sn-start"},
+		{onMatch: function(value, state, stack) {
+			stack.splice(stack.length);
+			return this.tokenName;
+		}, tokenName: "text", regex: "^(?!\t)", next: "start"}
+	])
+	
+};
+
+oop.inherits(SnippetGroupHighlightRules, TextHighlightRules);
+
+exports.SnippetGroupHighlightRules = SnippetGroupHighlightRules;
+
+var FoldMode = require("./folding/coffee").FoldMode;
+
+var Mode = function() {
+    this.HighlightRules = SnippetGroupHighlightRules;
+    this.foldingRules = new FoldMode();
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+    this.$indentWithTabs = true;
+}).call(Mode.prototype);
+exports.Mode = Mode;
+
+
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/soy_template.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/soy_template.js b/src/fauxton/assets/js/libs/ace/mode/soy_template.js
new file mode 100644
index 0000000..493c49c
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/soy_template.js
@@ -0,0 +1,60 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Distributed under the BSD license:
+ *
+ * Copyright (c) 2012, Ajax.org B.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Ajax.org B.V. nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * Contributor(s):
+ *
+ *
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/*
+  THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
+*/
+
+define(function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var HtmlMode = require("./html").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var SoyTemplateHighlightRules = require("./soy_template_highlight_rules").SoyTemplateHighlightRules;
+
+var Mode = function() {
+    HtmlMode.call(this);
+    this.HighlightRules = SoyTemplateHighlightRules;
+};
+oop.inherits(Mode, HtmlMode);
+
+(function() {
+    this.lineCommentStart = "//";
+    this.blockComment = {start: "/*", end: "*/"};
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/soy_template_highlight_rules.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/soy_template_highlight_rules.js b/src/fauxton/assets/js/libs/ace/mode/soy_template_highlight_rules.js
new file mode 100644
index 0000000..50e3ae4
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/soy_template_highlight_rules.js
@@ -0,0 +1,356 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Distributed under the BSD license:
+ *
+ * Copyright (c) 2012, Ajax.org B.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Ajax.org B.V. nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/* This file was autogenerated from tm bundles\SoyTemplate\Syntaxes\SoyTemplate.tmLanguage (uuid: ) */
+/****************************************************************************************
+ * IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. *
+ * fileTypes                                                                            *
+ ****************************************************************************************/
+
+define(function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
+
+var SoyTemplateHighlightRules = function() {
+    HtmlHighlightRules.call(this);
+
+    // regexp must not have capturing parentheses. Use (?:) instead.
+    // regexps are ordered -> the first match is used
+
+    var soyRules = { start: 
+       [ { include: '#template' },
+         { include: '#if' },
+         { include: '#comment-line' },
+         { include: '#comment-block' },
+         { include: '#comment-doc' },
+         { include: '#call' },
+         { include: '#css' },
+         { include: '#param' },
+         { include: '#print' },
+         { include: '#msg' },
+         { include: '#for' },
+         { include: '#foreach' },
+         { include: '#switch' },
+         { include: '#tag' },
+         { include: 'text.html.basic' } ],
+      '#call': 
+       [ { token: 
+            [ 'punctuation.definition.tag.begin.soy',
+              'meta.tag.call.soy' ],
+           regex: '(\\{/?)(\\s*)(?=call|delcall)',
+           push: 
+            [ { token: 'punctuation.definition.tag.end.soy',
+                regex: '\\}',
+                next: 'pop' },
+              { include: '#string-quoted-single' },
+              { include: '#string-quoted-double' },
+              { token: ['entity.name.tag.soy', 'variable.parameter.soy'],
+                regex: '(call|delcall)(\\s+[\\.\\w]+)'},
+              { token: 
+                 [ 'entity.other.attribute-name.soy',
+                   'text',
+                   'keyword.operator.soy' ],
+                regex: '\\b(data)(\\s*)(=)' },
+              { defaultToken: 'meta.tag.call.soy' } ] } ],
+      '#comment-line': 
+       [ { token: 
+            [ 'comment.line.double-slash.soy',
+              'punctuation.definition.comment.soy',
+              'comment.line.double-slash.soy' ],
+           regex: '(\\s+)(//)(.*$)' } ],
+      '#comment-block': 
+       [ { token: 'punctuation.definition.comment.begin.soy',
+           regex: '/\\*(?!\\*)',
+           push: 
+            [ { token: 'punctuation.definition.comment.end.soy',
+                regex: '\\*/',
+                next: 'pop' },
+              { defaultToken: 'comment.block.soy' } ] } ],
+      '#comment-doc': 
+       [ { token: 'punctuation.definition.comment.begin.soy',
+           regex: '/\\*\\*(?!/)',
+           push: 
+            [ { token: 'punctuation.definition.comment.end.soy',
+                regex: '\\*/',
+                next: 'pop' },
+              { token: [ 'support.type.soy', 'text', 'variable.parameter.soy' ],
+                regex: '(@param|@param\\?)(\\s+)(\\w+)' },
+              { defaultToken: 'comment.block.documentation.soy' } ] } ],
+      '#css': 
+       [ { token: 
+            [ 'punctuation.definition.tag.begin.soy',
+              'meta.tag.css.soy',
+              'entity.name.tag.soy' ],
+           regex: '(\\{/?)(\\s*)(css)\\b',
+           push: 
+            [ { token: 'punctuation.definition.tag.end.soy',
+                regex: '\\}',
+                next: 'pop' },
+              { token: 'support.constant.soy',
+                regex: '\\b(?:LITERAL|REFERENCE|BACKEND_SPECIFIC|GOOG)\\b' },
+              { defaultToken: 'meta.tag.css.soy' } ] } ],
+      '#for': 
+       [ { token: 
+            [ 'punctuation.definition.tag.begin.soy',
+              'meta.tag.for.soy',
+              'entity.name.tag.soy' ],
+           regex: '(\\{/?)(\\s*)(for)\\b',
+           push: 
+            [ { token: 'punctuation.definition.tag.end.soy',
+                regex: '\\}',
+                next: 'pop' },
+              { token: 'keyword.operator.soy', regex: '\\bin\\b' },
+              { token: 'support.function.soy', regex: '\\brange\\b' },
+              { include: '#variable' },
+              { include: '#number' },
+              { include: '#primitive' },
+              { defaultToken: 'meta.tag.for.soy' } ] } ],
+      '#foreach': 
+       [ { token: 
+            [ 'punctuation.definition.tag.begin.soy',
+              'meta.tag.foreach.soy',
+              'entity.name.tag.soy' ],
+           regex: '(\\{/?)(\\s*)(foreach)\\b',
+           push: 
+            [ { token: 'punctuation.definition.tag.end.soy',
+                regex: '\\}',
+                next: 'pop' },
+              { token: 'keyword.operator.soy', regex: '\\bin\\b' },
+              { include: '#variable' },
+              { defaultToken: 'meta.tag.foreach.soy' } ] } ],
+      '#function': 
+       [ { token: 'support.function.soy',
+           regex: '\\b(?:isFirst|isLast|index|hasData|length|keys|round|floor|ceiling|min|max|randomInt)\\b' } ],
+      '#if': 
+       [ { token: 
+            [ 'punctuation.definition.tag.begin.soy',
+              'meta.tag.if.soy',
+              'entity.name.tag.soy' ],
+           regex: '(\\{/?)(\\s*)(if|elseif)\\b',
+           push: 
+            [ { token: 'punctuation.definition.tag.end.soy',
+                regex: '\\}',
+                next: 'pop' },
+              { include: '#variable' },
+              { include: '#operator' },
+              { include: '#function' },
+              { include: '#string-quoted-single' },
+              { include: '#string-quoted-double' },
+              { defaultToken: 'meta.tag.if.soy' } ] } ],
+      '#namespace': 
+       [ { token: [ 'entity.name.tag.soy', 'text', 'variable.parameter.soy' ],
+           regex: '(namespace|delpackage)(\\s+)([\\w\\.]+)' } ],
+      '#number': [ { token: 'constant.numeric', regex: '[\\d]+' } ],
+      '#operator': 
+       [ { token: 'keyword.operator.soy',
+           regex: '==|!=|\\band\\b|\\bor\\b|\\bnot\\b|-|\\+|/|\\?:' } ],
+      '#param': 
+       [ { token: 
+            [ 'punctuation.definition.tag.begin.soy',
+              'meta.tag.param.soy',
+              'entity.name.tag.soy' ],
+           regex: '(\\{/?)(\\s*)(param)',
+           push: 
+            [ { token: 'punctuation.definition.tag.end.soy',
+                regex: '\\}',
+                next: 'pop' },
+              { include: '#variable' },
+              { token: 
+                 [ 'entity.other.attribute-name.soy',
+                   'text',
+                   'keyword.operator.soy' ],
+                regex: '\\b([\\w]*)(\\s*)((?::)?)' },
+              { defaultToken: 'meta.tag.param.soy' } ] } ],
+      '#primitive': 
+       [ { token: 'constant.language.soy',
+           regex: '\\b(?:null|false|true)\\b' } ],
+      '#msg': 
+       [ { token: 
+            [ 'punctuation.definition.tag.begin.soy',
+              'meta.tag.msg.soy',
+              'entity.name.tag.soy' ],
+           regex: '(\\{/?)(\\s*)(msg)\\b',
+           push: 
+            [ { token: 'punctuation.definition.tag.end.soy',
+                regex: '\\}',
+                next: 'pop' },
+              { include: '#string-quoted-single' },
+              { include: '#string-quoted-double' },
+              { token: 
+                 [ 'entity.other.attribute-name.soy',
+                   'text',
+                   'keyword.operator.soy' ],
+                regex: '\\b(meaning|desc)(\\s*)(=)' },
+              { defaultToken: 'meta.tag.msg.soy' } ] } ],
+      '#print': 
+       [ { token: 
+            [ 'punctuation.definition.tag.begin.soy',
+              'meta.tag.print.soy',
+              'entity.name.tag.soy' ],
+           regex: '(\\{/?)(\\s*)(print)\\b',
+           push: 
+            [ { token: 'punctuation.definition.tag.end.soy',
+                regex: '\\}',
+                next: 'pop' },
+              { include: '#variable' },
+              { include: '#print-parameter' },
+              { include: '#number' },
+              { include: '#primitive' },
+              { include: '#attribute-lookup' },
+              { defaultToken: 'meta.tag.print.soy' } ] } ],
+      '#print-parameter': 
+       [ { token: 'keyword.operator.soy', regex: '\\|' },
+         { token: 'variable.parameter.soy',
+           regex: 'noAutoescape|id|escapeHtml|escapeJs|insertWorkBreaks|truncate' } ],
+      '#special-character': 
+       [ { token: 'support.constant.soy',
+           regex: '\\bsp\\b|\\bnil\\b|\\\\r|\\\\n|\\\\t|\\blb\\b|\\brb\\b' } ],
+      '#string-quoted-double': [ { token: 'string.quoted.double', regex: '"[^"]*"' } ],
+      '#string-quoted-single': [ { token: 'string.quoted.single', regex: '\'[^\']*\'' } ],
+      '#switch': 
+       [ { token: 
+            [ 'punctuation.definition.tag.begin.soy',
+              'meta.tag.switch.soy',
+              'entity.name.tag.soy' ],
+           regex: '(\\{/?)(\\s*)(switch|case)\\b',
+           push: 
+            [ { token: 'punctuation.definition.tag.end.soy',
+                regex: '\\}',
+                next: 'pop' },
+              { include: '#variable' },
+              { include: '#function' },
+              { include: '#number' },
+              { include: '#string-quoted-single' },
+              { include: '#string-quoted-double' },
+              { defaultToken: 'meta.tag.switch.soy' } ] } ],
+      '#attribute-lookup': 
+       [ { token: 'punctuation.definition.attribute-lookup.begin.soy',
+           regex: '\\[',
+           push: 
+            [ { token: 'punctuation.definition.attribute-lookup.end.soy',
+                regex: '\\]',
+                next: 'pop' },
+              { include: '#variable' },
+              { include: '#function' },
+              { include: '#operator' },
+              { include: '#number' },
+              { include: '#primitive' },
+              { include: '#string-quoted-single' },
+              { include: '#string-quoted-double' } ] } ],
+      '#tag': 
+       [ { token: 'punctuation.definition.tag.begin.soy',
+           regex: '\\{',
+           push: 
+            [ { token: 'punctuation.definition.tag.end.soy',
+                regex: '\\}',
+                next: 'pop' },
+              { include: '#namespace' },
+              { include: '#variable' },
+              { include: '#special-character' },
+              { include: '#tag-simple' },
+              { include: '#function' },
+              { include: '#operator' },
+              { include: '#attribute-lookup' },
+              { include: '#number' },
+              { include: '#primitive' },
+              { include: '#print-parameter' } ] } ],
+      '#tag-simple': 
+       [ { token: 'entity.name.tag.soy',
+           regex: '{{\\s*(?:literal|else|ifempty|default)\\s*(?=\\})'} ],
+      '#template': 
+       [ { token: 
+            [ 'punctuation.definition.tag.begin.soy',
+              'meta.tag.template.soy' ],
+           regex: '(\\{/?)(\\s*)(?=template|deltemplate)',
+           push: 
+            [ { token: 'punctuation.definition.tag.end.soy',
+                regex: '\\}',
+                next: 'pop' },
+              { token: ['entity.name.tag.soy', 'text', 'entity.name.function.soy' ],
+                regex: '(template|deltemplate)(\\s+)([\\.\\w]+)',
+                originalRegex: '(?<=template|deltemplate)\\s+([\\.\\w]+)' },
+              { token: 
+                 [ 'entity.other.attribute-name.soy',
+                   'text',
+                   'keyword.operator.soy',
+                   'text',
+                   'string.quoted.double.soy' ],
+                regex: '\\b(private)(\\s*)(=)(\\s*)("true"|"false")' },
+              { token: 
+                 [ 'entity.other.attribute-name.soy',
+                   'text',
+                   'keyword.operator.soy',
+                   'text',
+                   'string.quoted.single.soy' ],
+                regex: '\\b(private)(\\s*)(=)(\\s*)(\'true\'|\'false\')' },
+              { token: 
+                 [ 'entity.other.attribute-name.soy',
+                   'text',
+                   'keyword.operator.soy',
+                   'text',
+                   'string.quoted.double.soy' ],
+                regex: '\\b(autoescape)(\\s*)(=)(\\s*)("true"|"false"|"contextual")' },
+              { token: 
+                 [ 'entity.other.attribute-name.soy',
+                   'text',
+                   'keyword.operator.soy',
+                   'text',
+                   'string.quoted.single.soy' ],
+                regex: '\\b(autoescape)(\\s*)(=)(\\s*)(\'true\'|\'false\'|\'contextual\')' },
+              { defaultToken: 'meta.tag.template.soy' } ] } ],
+      '#variable': [ { token: 'variable.other.soy', regex: '\\$[\\w\\.]+' } ] }
+    
+    
+    for (var i in soyRules) {
+        if (this.$rules[i]) {
+            this.$rules[i].unshift.call(this.$rules[i], soyRules[i]);
+        } else {
+            this.$rules[i] = soyRules[i];
+        }
+    }
+    
+    this.normalizeRules();
+};
+
+SoyTemplateHighlightRules.metaData = { comment: 'SoyTemplate',
+      fileTypes: [ 'soy' ],
+      firstLineMatch: '\\{\\s*namespace\\b',
+      foldingStartMarker: '\\{\\s*template\\s+[^\\}]*\\}',
+      foldingStopMarker: '\\{\\s*/\\s*template\\s*\\}',
+      name: 'SoyTemplate',
+      scopeName: 'source.soy' }
+
+
+oop.inherits(SoyTemplateHighlightRules, HtmlHighlightRules);
+
+exports.SoyTemplateHighlightRules = SoyTemplateHighlightRules;
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/space.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/space.js b/src/fauxton/assets/js/libs/ace/mode/space.js
new file mode 100644
index 0000000..3210298
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/space.js
@@ -0,0 +1,21 @@
+define(function(require, exports, module) {
+"use strict";
+var oop = require("../lib/oop");
+// defines the parent mode
+var TextMode = require("./text").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var FoldMode = require("./folding/coffee").FoldMode;
+// defines the language specific highlighters and folding rules
+var SpaceHighlightRules = require("./space_highlight_rules").SpaceHighlightRules;
+var Mode = function() {
+    // set everything up
+    var highlighter = new SpaceHighlightRules();
+    this.$tokenizer = new Tokenizer(highlighter.getRules());
+    this.foldingRules = new FoldMode();
+};
+oop.inherits(Mode, TextMode);
+(function() {
+    
+}).call(Mode.prototype);
+exports.Mode = Mode;
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/space_highlight_rules.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/space_highlight_rules.js b/src/fauxton/assets/js/libs/ace/mode/space_highlight_rules.js
new file mode 100644
index 0000000..4a347b1
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/space_highlight_rules.js
@@ -0,0 +1,56 @@
+define(function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var SpaceHighlightRules = function() {
+
+    // Todo: support multiline values that escape the newline with spaces.
+    this.$rules = {
+        "start" : [
+            {
+                token : "empty_line",
+                regex : / */,
+                next : "key"
+            },
+            {
+                token : "empty_line",
+                regex : /$/,
+                next : "key"
+            }
+        ],
+        "key" : [
+            {
+                token : "variable",
+                regex : /\S+/
+            },
+            {
+                token : "empty_line",
+                regex : /$/,
+                next : "start"
+            },{
+                token : "keyword.operator",
+                regex : / /,
+                next  : "value"
+            }
+        ],
+        "value" : [
+            {
+                token : "keyword.operator",
+                regex : /$/,
+                next  : "start"
+            },
+            {
+                token : "string",
+                regex : /[^$]/
+            }
+        ]
+    };
+    
+};
+
+oop.inherits(SpaceHighlightRules, TextHighlightRules);
+
+exports.SpaceHighlightRules = SpaceHighlightRules;
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/sql.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/sql.js b/src/fauxton/assets/js/libs/ace/mode/sql.js
new file mode 100644
index 0000000..d10a472
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/sql.js
@@ -0,0 +1,53 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Distributed under the BSD license:
+ *
+ * Copyright (c) 2010, Ajax.org B.V.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Ajax.org B.V. nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+define(function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var SqlHighlightRules = require("./sql_highlight_rules").SqlHighlightRules;
+var Range = require("../range").Range;
+
+var Mode = function() {
+    this.HighlightRules = SqlHighlightRules;
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+
+    this.lineCommentStart = "--";
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/sql_highlight_rules.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/sql_highlight_rules.js b/src/fauxton/assets/js/libs/ace/mode/sql_highlight_rules.js
new file mode 100644
index 0000000..e16ac9a
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/sql_highlight_rules.js
@@ -0,0 +1,94 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Distributed under the BSD license:
+ *
+ * Copyright (c) 2010, Ajax.org B.V.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Ajax.org B.V. nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+define(function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var SqlHighlightRules = function() {
+
+    var keywords = (
+        "select|insert|update|delete|from|where|and|or|group|by|order|limit|offset|having|as|case|" +
+        "when|else|end|type|left|right|join|on|outer|desc|asc"
+    );
+
+    var builtinConstants = (
+        "true|false|null"
+    );
+
+    var builtinFunctions = (
+        "count|min|max|avg|sum|rank|now|coalesce"
+    );
+
+    var keywordMapper = this.createKeywordMapper({
+        "support.function": builtinFunctions,
+        "keyword": keywords,
+        "constant.language": builtinConstants
+    }, "identifier", true);
+
+    this.$rules = {
+        "start" : [ {
+            token : "comment",
+            regex : "--.*$"
+        }, {
+            token : "string",           // " string
+            regex : '".*?"'
+        }, {
+            token : "string",           // ' string
+            regex : "'.*?'"
+        }, {
+            token : "constant.numeric", // float
+            regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
+        }, {
+            token : keywordMapper,
+            regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
+        }, {
+            token : "keyword.operator",
+            regex : "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="
+        }, {
+            token : "paren.lparen",
+            regex : "[\\(]"
+        }, {
+            token : "paren.rparen",
+            regex : "[\\)]"
+        }, {
+            token : "text",
+            regex : "\\s+"
+        } ]
+    };
+};
+
+oop.inherits(SqlHighlightRules, TextHighlightRules);
+
+exports.SqlHighlightRules = SqlHighlightRules;
+});
+

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/stylus.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/stylus.js b/src/fauxton/assets/js/libs/ace/mode/stylus.js
new file mode 100644
index 0000000..e33220b
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/stylus.js
@@ -0,0 +1,59 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Distributed under the BSD license:
+ *
+ * Copyright (c) 2012, Ajax.org B.V.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Ajax.org B.V. nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * Contributor(s):
+ * 
+ *
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/*
+  THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
+*/
+
+define(function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var StylusHighlightRules = require("./stylus_highlight_rules").StylusHighlightRules;
+var FoldMode = require("./folding/coffee").FoldMode;
+
+var Mode = function() {
+    this.HighlightRules = StylusHighlightRules;
+    this.foldingRules = new FoldMode();
+};
+oop.inherits(Mode, TextMode);
+
+(function() { 
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/stylus_highlight_rules.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/stylus_highlight_rules.js b/src/fauxton/assets/js/libs/ace/mode/stylus_highlight_rules.js
new file mode 100644
index 0000000..c9fb624
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/stylus_highlight_rules.js
@@ -0,0 +1,165 @@
+/*
+  THIS FILE WAS AUTOGENERATED BY Stylus.tmlanguage (UUID: 60519324-6A3A-4382-9E0B-546993A3869A) */
+
+define(function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+var CssHighlightRules = require("./css_highlight_rules");
+
+var StylusHighlightRules = function() {
+
+    // regexp must not have capturing parentheses. Use (?:) instead.
+    // regexps are ordered -> the first match is used
+
+    var keywordMapper = this.createKeywordMapper({
+        "support.type": CssHighlightRules.supportType,
+        "support.function": CssHighlightRules.supportFunction,
+        "support.constant": CssHighlightRules.supportConstant,
+        "support.constant.color": CssHighlightRules.supportConstantColor,
+        "support.constant.fonts": CssHighlightRules.supportConstantFonts
+    }, "text", true);
+
+    this.$rules = {
+    start: [
+        {
+            token : "comment",
+            regex : /\/\/.*$/
+        },
+        {
+            token : "comment", // multi line comment
+            regex : /\/\*/,
+            next : "comment"
+        },
+        {
+            token: ["entity.name.function.stylus", "text"],
+            regex: "^([-a-zA-Z_][-\\w]*)?(\\()"
+        },
+        {
+            token: ["entity.other.attribute-name.class.stylus"],
+            regex: "\\.-?[_a-zA-Z]+[_a-zA-Z0-9-]*"
+        },
+        {
+            token: ["entity.language.stylus"],
+            regex: "^ *&"
+        },
+        {
+            token: ["variable.language.stylus"],
+            regex: "(arguments)"
+        },
+        {
+            token: ["keyword.stylus"],
+            regex: "@[-\\w]+"
+        },
+        {
+            token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
+            regex : CssHighlightRules.pseudoElements
+        }, {
+            token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
+            regex : CssHighlightRules.pseudoClasses
+        }, 
+        {
+            token: ["entity.name.tag.stylus"],
+            regex: "(?:\\b)(a|abbr|acronym|address|area|article|aside|audio|b|base|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|datalist|dd|del|details|dfn|dialog|div|dl|dt|em|eventsource|fieldset|figure|figcaption|footer|form|frame|frameset|(?:h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|label|legend|li|link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|samp|script|section|select|small|span|strike|strong|style|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video)(?:\\b)"
+        },
+        {
+            token : "constant.numeric",  // hex6 color
+            regex : "#[a-f0-9]{6}"
+        }, 
+        {
+            token : "constant.numeric", // hex3 color
+            regex : "#[a-f0-9]{3}"
+        }, 
+        {
+            token: ["punctuation.definition.entity.stylus", "entity.other.attribute-name.id.stylus"],
+            regex: "(#)([a-zA-Z][a-zA-Z0-9_-]*)"
+        },
+        {
+            token: "meta.vendor-prefix.stylus",
+            regex: "-webkit-|-moz\\-|-ms-|-o-"
+        },
+        {
+            token: "keyword.control.stylus",
+            regex: "(?:!important|for|in|return|true|false|null|if|else|unless|return)\\b"
+        },
+        {
+            token: "keyword.operator.stylus",
+            regex: "!|~|\\+|-|(?:\\*)?\\*|\\/|%|(?:\\.)\\.\\.|<|>|(?:=|:|\\?|\\+|-|\\*|\\/|%|<|>)?=|!="
+        },
+        {
+            token: "keyword.operator.stylus",
+            regex: "(?:in|is(?:nt)?|not)\\b"
+        },
+        {
+            token : "string",
+            regex : "'(?=.)",
+            next  : "qstring"
+        }, {
+            token : "string",
+            regex : '"(?=.)',
+            next  : "qqstring"
+        }, 
+        {
+            token : "constant.numeric",
+            regex : CssHighlightRules.numRe
+        }, 
+        {
+            token : "keyword",
+            regex : "(?:ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)\\b"
+        }, 
+        {
+            token : keywordMapper,
+            regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+        }
+    ],
+    "comment" : [
+        {
+            token : "comment", // closing comment
+            regex : ".*?\\*\\/",
+            next : "start"
+        }, {
+            token : "comment", // comment spanning whole line
+            regex : ".+"
+        }
+    ],
+    "qqstring" : [
+        {
+            token : "string",
+            regex : '[^"\\\\]+'
+        }, 
+        {
+            token : "string",
+            regex : "\\\\$",
+            next  : "qqstring"
+        }, 
+        {
+            token : "string",
+            regex : '"|$',
+            next  : "start"
+        }
+    ],
+    "qstring" : [
+        {
+            token : "string",
+            regex : "[^'\\\\]+"
+        }, 
+        {
+            token : "string",
+            regex : "\\\\$",
+            next  : "qstring"
+        }, 
+        {
+            token : "string",
+            regex : "'|$",
+            next  : "start"
+        }
+    ]
+}
+
+};
+
+oop.inherits(StylusHighlightRules, TextHighlightRules);
+
+exports.StylusHighlightRules = StylusHighlightRules;
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/svg.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/svg.js b/src/fauxton/assets/js/libs/ace/mode/svg.js
new file mode 100644
index 0000000..0ca57e1
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/svg.js
@@ -0,0 +1,69 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Distributed under the BSD license:
+ *
+ * Copyright (c) 2010, Ajax.org B.V.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Ajax.org B.V. nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+define(function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var XmlMode = require("./xml").Mode;
+var JavaScriptMode = require("./javascript").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var SvgHighlightRules = require("./svg_highlight_rules").SvgHighlightRules;
+var MixedFoldMode = require("./folding/mixed").FoldMode;
+var XmlFoldMode = require("./folding/xml").FoldMode;
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+var Mode = function() {
+    XmlMode.call(this);
+    
+    this.HighlightRules = SvgHighlightRules;
+    
+    this.createModeDelegates({
+        "js-": JavaScriptMode
+    });
+    
+    this.foldingRules = new MixedFoldMode(new XmlFoldMode({}), {
+        "js-": new CStyleFoldMode()
+    });
+};
+
+oop.inherits(Mode, XmlMode);
+
+(function() {
+
+    this.getNextLineIndent = function(state, line, tab) {
+        return this.$getIndent(line);
+    };
+    
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/svg_highlight_rules.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/svg_highlight_rules.js b/src/fauxton/assets/js/libs/ace/mode/svg_highlight_rules.js
new file mode 100644
index 0000000..25722d7
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/svg_highlight_rules.js
@@ -0,0 +1,49 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Distributed under the BSD license:
+ *
+ * Copyright (c) 2010, Ajax.org B.V.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Ajax.org B.V. nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+define(function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
+var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
+
+var SvgHighlightRules = function() {
+    XmlHighlightRules.call(this);
+
+    this.embedTagRules(JavaScriptHighlightRules, "js-", "script");
+
+    this.normalizeRules();
+};
+
+oop.inherits(SvgHighlightRules, XmlHighlightRules);
+
+exports.SvgHighlightRules = SvgHighlightRules;
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/tcl.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/tcl.js b/src/fauxton/assets/js/libs/ace/mode/tcl.js
new file mode 100644
index 0000000..c8e7c43
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/tcl.js
@@ -0,0 +1,84 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Distributed under the BSD license:
+ *
+ * Copyright (c) 2010, Ajax.org B.V.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Ajax.org B.V. nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+define(function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var TclHighlightRules = require("./tcl_highlight_rules").TclHighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+var Range = require("../range").Range;
+
+var Mode = function() {
+    this.HighlightRules = TclHighlightRules;
+    this.$outdent = new MatchingBraceOutdent();
+    this.foldingRules = new CStyleFoldMode();
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+
+    this.lineCommentStart = "#";
+
+    this.getNextLineIndent = function(state, line, tab) {
+        var indent = this.$getIndent(line);
+
+        var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
+        var tokens = tokenizedLine.tokens;
+
+        if (tokens.length && tokens[tokens.length-1].type == "comment") {
+            return indent;
+        }
+        
+        if (state == "start") {
+            var match = line.match(/^.*[\{\(\[]\s*$/);
+            if (match) {
+                indent += tab;
+            }
+        }
+
+        return indent;
+    };
+
+    this.checkOutdent = function(state, line, input) {
+        return this.$outdent.checkOutdent(line, input);
+    };
+
+    this.autoOutdent = function(state, doc, row) {
+        this.$outdent.autoOutdent(doc, row);
+    };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/tcl_highlight_rules.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/tcl_highlight_rules.js b/src/fauxton/assets/js/libs/ace/mode/tcl_highlight_rules.js
new file mode 100644
index 0000000..55b0ad6
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/tcl_highlight_rules.js
@@ -0,0 +1,172 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Distributed under the BSD license:
+ *
+ * Copyright (c) 2010, Ajax.org B.V.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Ajax.org B.V. nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+define(function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var TclHighlightRules = function() {
+
+    //TODO var builtinFunctions = "";
+
+    this.$rules = {
+        "start" : [
+           {
+                token : "comment",
+                regex : "#.*\\\\$",
+                next  : "commentfollow"
+            }, {
+                token : "comment",
+                regex : "#.*$"
+            }, {
+                token : "support.function",
+                regex : '[\\\\]$',
+                next  : "splitlineStart"
+            }, {
+                token : "text",
+                regex : '[\\\\](?:["]|[{]|[}]|[[]|[]]|[$]|[\])'
+            }, {
+                token : "text", // last value before command
+                regex : '^|[^{][;][^}]|[/\r/]',
+                next  : "commandItem"
+            }, {
+                token : "string", // single line
+                regex : '[ ]*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
+            }, {
+                token : "string", // multi line """ string start
+                regex : '[ ]*["]',
+                next  : "qqstring"
+            }, {
+                token : "variable.instance",
+                regex : "[$]",
+                next  : "variable"
+            }, {
+                token : "support.function",
+                regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|{\\*}|;|::"
+            }, {
+                token : "identifier",
+                regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
+            }, {
+                token : "paren.lparen",
+                regex : "[[{]",
+                next  : "commandItem"
+            }, {
+                token : "paren.lparen",
+                regex : "[(]"
+            },  {
+                token : "paren.rparen",
+                regex : "[\\])}]"
+            }, {
+                token : "text",
+                regex : "\\s+"
+            }
+        ],
+        "commandItem" : [
+            {
+                token : "comment",
+                regex : "#.*\\\\$",
+                next  : "commentfollow"
+            }, {
+                token : "comment",
+                regex : "#.*$",
+                next  : "start"
+            }, {
+                token : "string", // single line
+                regex : '[ ]*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
+            }, {
+                token : "variable.instance", 
+                regex : "[$]",
+                next  : "variable"
+            }, {
+                token : "support.function",
+                regex : "(?:[:][:])[a-zA-Z0-9_/]+(?:[:][:])",
+                next  : "commandItem"
+            }, {
+                token : "support.function",
+                regex : "[a-zA-Z0-9_/]+(?:[:][:])",
+                next  : "commandItem"
+            }, {
+                token : "support.function",
+                regex : "(?:[:][:])",
+                next  : "commandItem"
+            }, {
+                token : "paren.rparen",
+                regex : "[\\])}]"
+            }, {
+                token : "support.function",
+                regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|{\\*}|;|::"
+            }, {
+                token : "keyword",
+                regex : "[a-zA-Z0-9_/]+",
+                next  : "start"
+            } ],
+        "commentfollow" : [ 
+            {
+                token : "comment",
+                regex : ".*\\\\$",
+                next  : "commentfollow"
+            }, {
+                token : "comment",
+                regex : '.+',
+                next  : "start"
+        } ],
+        "splitlineStart" : [ 
+            {
+                token : "text",
+                regex : "^.",
+                next  : "start"
+            }],
+        "variable" : [ 
+            {
+                token : "variable.instance", // variable tcl
+                regex : "[a-zA-Z_\\d]+(?:[(][a-zA-Z_\\d]+[)])?",
+                next  : "start"
+            }, {
+                token : "variable.instance", // variable tcl with braces
+                regex : "{?[a-zA-Z_\\d]+}?",
+                next  : "start"
+            }],  
+        "qqstring" : [ {
+            token : "string", // multi line """ string end
+            regex : '(?:[^\\\\]|\\\\.)*?["]',
+            next : "start"
+        }, {
+            token : "string",
+            regex : '.+'
+        } ]
+    };
+};
+
+oop.inherits(TclHighlightRules, TextHighlightRules);
+
+exports.TclHighlightRules = TclHighlightRules;
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/tex.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/tex.js b/src/fauxton/assets/js/libs/ace/mode/tex.js
new file mode 100644
index 0000000..cf7b737
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/tex.js
@@ -0,0 +1,68 @@
+/*
+ * tex.js
+ *
+ * Copyright (C) 2009-11 by RStudio, Inc.
+ *
+ * The Initial Developer of the Original Code is
+ * Ajax.org B.V.
+ * Portions created by the Initial Developer are Copyright (C) 2010
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Distributed under the BSD license:
+ *
+ * Copyright (c) 2010, Ajax.org B.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Ajax.org B.V. nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ *
+ */
+define(function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+var TexHighlightRules = require("./tex_highlight_rules").TexHighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+
+var Mode = function(suppressHighlighting) {
+	if (suppressHighlighting)
+    	this.HighlightRules = TextHighlightRules;
+	else
+    	this.HighlightRules = TexHighlightRules;
+    this.$outdent = new MatchingBraceOutdent();
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+   this.getNextLineIndent = function(state, line, tab) {
+      return this.$getIndent(line);
+   };
+
+   this.allowAutoInsert = function() {
+      return false;
+   };
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/tex_highlight_rules.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/tex_highlight_rules.js b/src/fauxton/assets/js/libs/ace/mode/tex_highlight_rules.js
new file mode 100644
index 0000000..c64d031
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/tex_highlight_rules.js
@@ -0,0 +1,107 @@
+/*
+ * tex_highlight_rules.js
+ *
+ * Copyright (C) 2009-11 by RStudio, Inc.
+ *
+ * The Initial Developer of the Original Code is
+ * Ajax.org B.V.
+ * Portions created by the Initial Developer are Copyright (C) 2010
+ * the Initial Developer. All Rights Reserved.
+ *
+ * This program is licensed to you under the terms of version 3 of the
+ * GNU Affero General Public License. This program is distributed WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT,
+ * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the
+ * AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details.
+ *
+ */
+define(function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var lang = require("../lib/lang");
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var TexHighlightRules = function(textClass) {
+
+    if (!textClass)
+        textClass = "text";
+
+    // regexp must not have capturing parentheses. Use (?:) instead.
+    // regexps are ordered -> the first match is used
+
+    this.$rules = {
+        "start" : [
+	        {
+	            token : "comment",
+	            regex : "%.*$"
+	        }, {
+	            token : textClass, // non-command
+	            regex : "\\\\[$&%#\\{\\}]"
+	        }, {
+	            token : "keyword", // command
+	            regex : "\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b",
+               next : "nospell"
+	        }, {
+	            token : "keyword", // command
+	            regex : "\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])"
+	        }, {
+               // Obviously these are neither keywords nor operators, but
+               // labelling them as such was the easiest way to get them
+               // to be colored distinctly from regular text
+               token : "paren.keyword.operator",
+	            regex : "[[({]"
+	        }, {
+               // Obviously these are neither keywords nor operators, but
+               // labelling them as such was the easiest way to get them
+               // to be colored distinctly from regular text
+               token : "paren.keyword.operator",
+	            regex : "[\\])}]"
+	        }, {
+	            token : textClass,
+	            regex : "\\s+"
+	        }
+        ],
+        // This mode is necessary to prevent spell checking, but to keep the
+        // same syntax highlighting behavior. The list of commands comes from
+        // Texlipse.
+        "nospell" : [
+           {
+               token : "comment",
+               regex : "%.*$",
+               next : "start"
+           }, {
+               token : "nospell." + textClass, // non-command
+               regex : "\\\\[$&%#\\{\\}]"
+           }, {
+               token : "keyword", // command
+               regex : "\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b"
+           }, {
+               token : "keyword", // command
+               regex : "\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])",
+               next : "start"
+           }, {
+               token : "paren.keyword.operator",
+               regex : "[[({]"
+           }, {
+               token : "paren.keyword.operator",
+               regex : "[\\])]"
+           }, {
+               token : "paren.keyword.operator",
+               regex : "}",
+               next : "start"
+           }, {
+               token : "nospell." + textClass,
+               regex : "\\s+"
+           }, {
+               token : "nospell." + textClass,
+               regex : "\\w+"
+           }
+        ]
+    };
+};
+
+oop.inherits(TexHighlightRules, TextHighlightRules);
+
+exports.TexHighlightRules = TexHighlightRules;
+});