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:40:04 UTC
[19/51] [partial] working replacement
http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/ftl_highlight_rules.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/ftl_highlight_rules.js b/src/fauxton/assets/js/libs/ace/mode/ftl_highlight_rules.js
new file mode 100644
index 0000000..0a79520
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/ftl_highlight_rules.js
@@ -0,0 +1,195 @@
+/* ***** 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 HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var FtlLangHighlightRules = function () {
+
+ var stringBuiltIns = "\\?|substring|cap_first|uncap_first|capitalize|chop_linebreak|date|time|datetime|"
+ + "ends_with|html|groups|index_of|j_string|js_string|json_string|last_index_of|length|lower_case|"
+ + "left_pad|right_pad|contains|matches|number|replace|rtf|url|split|starts_with|string|trim|"
+ + "upper_case|word_list|xhtml|xml";
+ var numberBuiltIns = "c|round|floor|ceiling";
+ var dateBuiltIns = "iso_[a-z_]+";
+ var seqBuiltIns = "first|last|seq_contains|seq_index_of|seq_last_index_of|reverse|size|sort|sort_by|chunk";
+ var hashBuiltIns = "keys|values";
+ var xmlBuiltIns = "children|parent|root|ancestors|node_name|node_type|node_namespace";
+ var expertBuiltIns = "byte|double|float|int|long|short|number_to_date|number_to_time|number_to_datetime|"
+ + "eval|has_content|interpret|is_[a-z_]+|namespacenew";
+ var allBuiltIns = stringBuiltIns + numberBuiltIns + dateBuiltIns + seqBuiltIns + hashBuiltIns
+ + xmlBuiltIns + expertBuiltIns;
+
+ var deprecatedBuiltIns = "default|exists|if_exists|web_safe";
+
+ var variables = "data_model|error|globals|lang|locale|locals|main|namespace|node|current_node|"
+ + "now|output_encoding|template_name|url_escaping_charset|vars|version";
+
+ var operators = "gt|gte|lt|lte|as|in|using";
+
+ var reserved = "true|false";
+
+ var attributes = "encoding|parse|locale|number_format|date_format|time_format|datetime_format|time_zone|"
+ + "url_escaping_charset|classic_compatible|strip_whitespace|strip_text|strict_syntax|ns_prefixes|"
+ + "attributes";
+
+ this.$rules = {
+ "start" : [{
+ token : "constant.character.entity",
+ regex : /&[^;]+;/
+ }, {
+ token : "support.function",
+ regex : "\\?("+allBuiltIns+")"
+ }, {
+ token : "support.function.deprecated",
+ regex : "\\?("+deprecatedBuiltIns+")"
+ }, {
+ token : "language.variable",
+ regex : "\\.(?:"+variables+")"
+ }, {
+ token : "constant.language",
+ regex : "\\b("+reserved+")\\b"
+ }, {
+ token : "keyword.operator",
+ regex : "\\b(?:"+operators+")\\b"
+ }, {
+ token : "entity.other.attribute-name",
+ regex : attributes
+ }, {
+ token : "string", //
+ regex : /['"]/,
+ next : "qstring"
+ }, {
+ // Deal with variable names that contains number
+ // e.g. <#if var42 == 42 >
+ token : function(value) {
+ if (value.match("^[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?$")) {
+ return "constant.numeric";
+ } else {
+ return "variable";
+ }
+ },
+ regex : /[\w.+\-]+/
+ }, {
+ token : "keyword.operator",
+ regex : "!|\\.|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^="
+ }, {
+ token : "paren.lparen",
+ regex : "[[({]"
+ }, {
+ token : "paren.rparen",
+ regex : "[\\])}]"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }],
+
+ "qstring" : [{
+ token : "constant.character.escape",
+ regex : '\\\\[nrtvef\\\\"$]'
+ }, {
+ token : "string",
+ regex : /['"]/,
+ next : "start"
+ }, {
+ defaultToken : "string"
+ }]
+ };
+};
+
+oop.inherits(FtlLangHighlightRules, TextHighlightRules);
+
+var FtlHighlightRules = function() {
+ HtmlHighlightRules.call(this);
+
+ var directives = "assign|attempt|break|case|compress|default|elseif|else|escape|fallback|function|flush|"
+ + "ftl|global|if|import|include|list|local|lt|macro|nested|noescape|noparse|nt|recover|recurse|return|rt|"
+ + "setting|stop|switch|t|visit";
+
+ var startRules = [
+ {
+ token : "comment",
+ regex : "<#--",
+ next : "ftl-dcomment"
+ }, {
+ token : "string.interpolated",
+ regex : "\\${",
+ push : "ftl-start"
+ }, {
+ token : "keyword.function",
+ regex : "</?#("+directives+")",
+ push : "ftl-start"
+ }, {
+ token : "keyword.other",
+ regex : "</?@[a-zA-Z\\.]+",
+ push : "ftl-start"
+ }
+ ];
+
+ var endRules = [
+ {
+ token : "keyword",
+ regex : "/?>",
+ next : "pop"
+ }, {
+ token : "string.interpolated",
+ regex : "}",
+ next : "pop"
+ }
+ ];
+
+ for (var key in this.$rules)
+ this.$rules[key].unshift.apply(this.$rules[key], startRules);
+
+ this.embedRules(FtlLangHighlightRules, "ftl-", endRules, ["start"]);
+
+ this.addRules({
+ "ftl-dcomment" : [{
+ token : "comment",
+ regex : ".*?-->",
+ next : "pop"
+ }, {
+ token : "comment",
+ regex : ".+"
+ }]
+ });
+
+ this.normalizeRules();
+};
+
+oop.inherits(FtlHighlightRules, HtmlHighlightRules);
+
+exports.FtlHighlightRules = FtlHighlightRules;
+});
+
http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/glsl.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/glsl.js b/src/fauxton/assets/js/libs/ace/mode/glsl.js
new file mode 100644
index 0000000..202ec9f
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/glsl.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 CMode = require("./c_cpp").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var glslHighlightRules = require("./glsl_highlight_rules").glslHighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+var Range = require("../range").Range;
+var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+var Mode = function() {
+ this.HighlightRules = glslHighlightRules;
+
+ this.$outdent = new MatchingBraceOutdent();
+ this.$behaviour = new CstyleBehaviour();
+ this.foldingRules = new CStyleFoldMode();
+};
+oop.inherits(Mode, CMode);
+
+exports.Mode = Mode;
+});
http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/glsl_highlight_rules.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/glsl_highlight_rules.js b/src/fauxton/assets/js/libs/ace/mode/glsl_highlight_rules.js
new file mode 100644
index 0000000..552df6c
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/glsl_highlight_rules.js
@@ -0,0 +1,81 @@
+/* ***** 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 c_cppHighlightRules = require("./c_cpp_highlight_rules").c_cppHighlightRules;
+
+var glslHighlightRules = function() {
+
+ var keywords = (
+ "attribute|const|uniform|varying|break|continue|do|for|while|" +
+ "if|else|in|out|inout|float|int|void|bool|true|false|" +
+ "lowp|mediump|highp|precision|invariant|discard|return|mat2|mat3|" +
+ "mat4|vec2|vec3|vec4|ivec2|ivec3|ivec4|bvec2|bvec3|bvec4|sampler2D|" +
+ "samplerCube|struct"
+ );
+
+ var buildinConstants = (
+ "radians|degrees|sin|cos|tan|asin|acos|atan|pow|" +
+ "exp|log|exp2|log2|sqrt|inversesqrt|abs|sign|floor|ceil|fract|mod|" +
+ "min|max|clamp|mix|step|smoothstep|length|distance|dot|cross|" +
+ "normalize|faceforward|reflect|refract|matrixCompMult|lessThan|" +
+ "lessThanEqual|greaterThan|greaterThanEqual|equal|notEqual|any|all|" +
+ "not|dFdx|dFdy|fwidth|texture2D|texture2DProj|texture2DLod|" +
+ "texture2DProjLod|textureCube|textureCubeLod|" +
+ "gl_MaxVertexAttribs|gl_MaxVertexUniformVectors|gl_MaxVaryingVectors|" +
+ "gl_MaxVertexTextureImageUnits|gl_MaxCombinedTextureImageUnits|" +
+ "gl_MaxTextureImageUnits|gl_MaxFragmentUniformVectors|gl_MaxDrawBuffers|" +
+ "gl_DepthRangeParameters|gl_DepthRange|" +
+ // The following two are only for MIME x-shader/x-vertex.
+ "gl_Position|gl_PointSize|" +
+ // The following five are only for MIME x-shader/x-fragment.
+ "gl_FragCoord|gl_FrontFacing|gl_PointCoord|gl_FragColor|gl_FragData"
+ );
+
+ var keywordMapper = this.createKeywordMapper({
+ "variable.language": "this",
+ "keyword": keywords,
+ "constant.language": buildinConstants
+ }, "identifier");
+
+ this.$rules = new c_cppHighlightRules().$rules;
+ this.$rules.start.forEach(function(rule) {
+ if (typeof rule.token == "function")
+ rule.token = keywordMapper;
+ })
+};
+
+oop.inherits(glslHighlightRules, c_cppHighlightRules);
+
+exports.glslHighlightRules = glslHighlightRules;
+});
http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/golang.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/golang.js b/src/fauxton/assets/js/libs/ace/mode/golang.js
new file mode 100644
index 0000000..62b6875
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/golang.js
@@ -0,0 +1,55 @@
+define(function(require, exports, module) {
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var GolangHighlightRules = require("./golang_highlight_rules").GolangHighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+var Mode = function() {
+ this.HighlightRules = GolangHighlightRules;
+ this.$outdent = new MatchingBraceOutdent();
+ this.foldingRules = new CStyleFoldMode();
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+
+ this.lineCommentStart = "//";
+ this.blockComment = {start: "/*", end: "*/"};
+
+ this.getNextLineIndent = function(state, line, tab) {
+ var indent = this.$getIndent(line);
+
+ var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
+ var tokens = tokenizedLine.tokens;
+ var endState = tokenizedLine.state;
+
+ 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;
+ };//end getNextLineIndent
+
+ 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/golang_highlight_rules.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/golang_highlight_rules.js b/src/fauxton/assets/js/libs/ace/mode/golang_highlight_rules.js
new file mode 100644
index 0000000..5bd40b4
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/golang_highlight_rules.js
@@ -0,0 +1,111 @@
+define(function(require, exports, module) {
+ var oop = require("../lib/oop");
+ var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+ var GolangHighlightRules = function() {
+ var keywords = (
+ "else|break|case|return|goto|if|const|select|" +
+ "continue|struct|default|switch|for|range|" +
+ "func|import|package|chan|defer|fallthrough|go|interface|map|range|" +
+ "select|type|var"
+ );
+ var builtinTypes = (
+ "string|uint8|uint16|uint32|uint64|int8|int16|int32|int64|float32|" +
+ "float64|complex64|complex128|byte|rune|uint|int|uintptr|bool|error"
+ );
+ var builtinFunctions = (
+ "make|close|new|panic|recover"
+ );
+ var builtinConstants = ("nil|true|false|iota");
+
+ var keywordMapper = this.createKeywordMapper({
+ "keyword": keywords,
+ "constant.language": builtinConstants,
+ "support.function": builtinFunctions,
+ "support.type": builtinTypes
+ }, "identifier");
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ },
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ regex : "\\/\\*",
+ next : "comment"
+ }, {
+ token : "string", // single line
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
+ }, {
+ token : "string", // single line
+ regex : '[`](?:[^`]*)[`]'
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : '[`](?:[^`]*)$',
+ next : "bqstring"
+ }, {
+ token : "constant.numeric", // rune
+ regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))[']"
+ }, {
+ token : "constant.numeric", // hex
+ regex : "0[xX][0-9a-fA-F]+\\b"
+ }, {
+ 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 : "punctuation.operator",
+ regex : "\\?|\\:|\\,|\\;|\\."
+ }, {
+ token : "paren.lparen",
+ regex : "[[({]"
+ }, {
+ token : "paren.rparen",
+ regex : "[\\])}]"
+ }, {
+ token: "invalid",
+ regex: "\\s+$"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }
+ ],
+ "comment" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ next : "start"
+ }, {
+ token : "comment", // comment spanning whole line
+ regex : ".+"
+ }
+ ],
+ "bqstring" : [
+ {
+ token : "string",
+ regex : '(?:[^`]*)`',
+ next : "start"
+ }, {
+ token : "string",
+ regex : '.+'
+ }
+ ]
+ };
+
+ this.embedRules(DocCommentHighlightRules, "doc-",
+ [ DocCommentHighlightRules.getEndRule("start") ]);
+ };
+ oop.inherits(GolangHighlightRules, TextHighlightRules);
+
+ exports.GolangHighlightRules = GolangHighlightRules;
+});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/groovy.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/groovy.js b/src/fauxton/assets/js/libs/ace/mode/groovy.js
new file mode 100644
index 0000000..91d88e0
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/groovy.js
@@ -0,0 +1,24 @@
+define(function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var JavaScriptMode = require("./javascript").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var GroovyHighlightRules = require("./groovy_highlight_rules").GroovyHighlightRules;
+
+var Mode = function() {
+ JavaScriptMode.call(this);
+ this.HighlightRules = GroovyHighlightRules;
+};
+oop.inherits(Mode, JavaScriptMode);
+
+(function() {
+
+ 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/groovy_highlight_rules.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/groovy_highlight_rules.js b/src/fauxton/assets/js/libs/ace/mode/groovy_highlight_rules.js
new file mode 100644
index 0000000..fb3b78e
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/groovy_highlight_rules.js
@@ -0,0 +1,173 @@
+define(function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var GroovyHighlightRules = function() {
+
+ var keywords = (
+ "assert|with|abstract|continue|for|new|switch|" +
+ "assert|default|goto|package|synchronized|" +
+ "boolean|do|if|private|this|" +
+ "break|double|implements|protected|throw|" +
+ "byte|else|import|public|throws|" +
+ "case|enum|instanceof|return|transient|" +
+ "catch|extends|int|short|try|" +
+ "char|final|interface|static|void|" +
+ "class|finally|long|strictfp|volatile|" +
+ "def|float|native|super|while"
+ );
+
+ var buildinConstants = (
+ "null|Infinity|NaN|undefined"
+ );
+
+ var langClasses = (
+ "AbstractMethodError|AssertionError|ClassCircularityError|"+
+ "ClassFormatError|Deprecated|EnumConstantNotPresentException|"+
+ "ExceptionInInitializerError|IllegalAccessError|"+
+ "IllegalThreadStateException|InstantiationError|InternalError|"+
+ "NegativeArraySizeException|NoSuchFieldError|Override|Process|"+
+ "ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|"+
+ "SuppressWarnings|TypeNotPresentException|UnknownError|"+
+ "UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|"+
+ "InstantiationException|IndexOutOfBoundsException|"+
+ "ArrayIndexOutOfBoundsException|CloneNotSupportedException|"+
+ "NoSuchFieldException|IllegalArgumentException|NumberFormatException|"+
+ "SecurityException|Void|InheritableThreadLocal|IllegalStateException|"+
+ "InterruptedException|NoSuchMethodException|IllegalAccessException|"+
+ "UnsupportedOperationException|Enum|StrictMath|Package|Compiler|"+
+ "Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|"+
+ "NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|"+
+ "NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|"+
+ "Character|Boolean|StackTraceElement|Appendable|StringBuffer|"+
+ "Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|"+
+ "StackOverflowError|OutOfMemoryError|VirtualMachineError|"+
+ "ArrayStoreException|ClassCastException|LinkageError|"+
+ "NoClassDefFoundError|ClassNotFoundException|RuntimeException|"+
+ "Exception|ThreadDeath|Error|Throwable|System|ClassLoader|"+
+ "Cloneable|Class|CharSequence|Comparable|String|Object"
+ );
+
+ // TODO var importClasses = "";
+
+ var keywordMapper = this.createKeywordMapper({
+ "variable.language": "this",
+ "keyword": keywords,
+ "support.function": langClasses,
+ "constant.language": buildinConstants
+ }, "identifier");
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ },
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ regex : "\\/\\*",
+ next : "comment"
+ }, {
+ token : "string.regexp",
+ regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
+ }, {
+ token : "string",
+ regex : '"""',
+ next : "qqstring"
+ }, {
+ token : "string",
+ regex : "'''",
+ next : "qstring"
+ }, {
+ token : "string", // single line
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
+ }, {
+ token : "string", // single line
+ regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
+ }, {
+ token : "constant.numeric", // hex
+ regex : "0[xX][0-9a-fA-F]+\\b"
+ }, {
+ token : "constant.numeric", // float
+ regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
+ }, {
+ token : "constant.language.boolean",
+ regex : "(?:true|false)\\b"
+ }, {
+ token : keywordMapper,
+ // TODO: Unicode escape sequences
+ // TODO: Unicode identifiers
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
+ }, {
+ token : "keyword.operator",
+ regex : "\\?:|\\?\\.|\\*\\.|<=>|=~|==~|\\.@|\\*\\.@|\\.&|as|in|is|!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
+ }, {
+ token : "lparen",
+ regex : "[[({]"
+ }, {
+ token : "rparen",
+ regex : "[\\])}]"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }
+ ],
+ "comment" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ next : "start"
+ }, {
+ token : "comment", // comment spanning whole line
+ regex : ".+"
+ }
+ ],
+ "qqstring" : [
+ {
+ token : "constant.language.escape",
+ regex : /\\(?:u[0-9A-Fa-f]{4}|.|$)/
+ }, {
+ token : "constant.language.escape",
+ regex : /\$[\w\d]+/
+ }, {
+ token : "constant.language.escape",
+ regex : /\$\{[^"\}]+\}?/
+ }, {
+ token : "string",
+ regex : '"{3,5}',
+ next : "start"
+ }, {
+ token : "string",
+ regex : '.+?'
+ }
+ ],
+ "qstring" : [
+ {
+ token : "constant.language.escape",
+ regex : /\\(?:u[0-9A-Fa-f]{4}|.|$)/
+ }, {
+ token : "string",
+ regex : "'{3,5}",
+ next : "start"
+ }, {
+ token : "string",
+ regex : ".+?"
+ }
+ ]
+ };
+
+ this.embedRules(DocCommentHighlightRules, "doc-",
+ [ DocCommentHighlightRules.getEndRule("start") ]);
+};
+
+oop.inherits(GroovyHighlightRules, TextHighlightRules);
+
+exports.GroovyHighlightRules = GroovyHighlightRules;
+});
http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/haml.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/haml.js b/src/fauxton/assets/js/libs/ace/mode/haml.js
new file mode 100644
index 0000000..23ea9e6
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/haml.js
@@ -0,0 +1,61 @@
+/* ***** 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):
+ *
+ * Garen J. Torikian < gjtorikian AT gmail DOT com >
+ *
+ * ***** 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 HamlHighlightRules = require("./haml_highlight_rules").HamlHighlightRules;
+var FoldMode = require("./folding/coffee").FoldMode;
+
+var Mode = function() {
+ this.HighlightRules = HamlHighlightRules;
+ this.foldingRules = new FoldMode();
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+ this.lineCommentStart = ["//", "#"];
+
+}).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/haml_highlight_rules.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/haml_highlight_rules.js b/src/fauxton/assets/js/libs/ace/mode/haml_highlight_rules.js
new file mode 100644
index 0000000..6219bc7
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/haml_highlight_rules.js
@@ -0,0 +1,132 @@
+define(function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+var RubyExports = require("./ruby_highlight_rules");
+var RubyHighlightRules = RubyExports.RubyHighlightRules;
+
+var HamlHighlightRules = function() {
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules =
+ {
+ "start": [
+ {
+ token : "punctuation.section.comment",
+ regex : /^\s*\/.*/
+ },
+ {
+ token : "punctuation.section.comment",
+ regex : /^\s*#.*/
+ },
+ {
+ token: "string.quoted.double",
+ regex: "==.+?=="
+ },
+ {
+ token: "keyword.other.doctype",
+ regex: "^!!!\\s*(?:[a-zA-Z0-9-_]+)?"
+ },
+ RubyExports.qString,
+ RubyExports.qqString,
+ RubyExports.tString,
+ {
+ token: ["entity.name.tag.haml"],
+ regex: /^\s*%[\w:]+/,
+ next: "tag_single"
+ },
+ {
+ token: [ "meta.escape.haml" ],
+ regex: "^\\s*\\\\."
+ },
+ RubyExports.constantNumericHex,
+ RubyExports.constantNumericFloat,
+
+ RubyExports.constantOtherSymbol,
+ {
+ token: "text",
+ regex: "=|-|~",
+ next: "embedded_ruby"
+ }
+ ],
+ "tag_single": [
+ {
+ token: "entity.other.attribute-name.class.haml",
+ regex: "\\.[\\w-]+"
+ },
+ {
+ token: "entity.other.attribute-name.id.haml",
+ regex: "#[\\w-]+"
+ },
+ {
+ token: "punctuation.section",
+ regex: "\\{",
+ next: "section"
+ },
+
+ RubyExports.constantOtherSymbol,
+
+ {
+ token: "text",
+ regex: /\s/,
+ next: "start"
+ },
+ {
+ token: "empty",
+ regex: "$|(?!\\.|#|\\{|\\[|=|-|~|\\/)",
+ next: "start"
+ }
+ ],
+ "section": [
+ RubyExports.constantOtherSymbol,
+
+ RubyExports.qString,
+ RubyExports.qqString,
+ RubyExports.tString,
+
+ RubyExports.constantNumericHex,
+ RubyExports.constantNumericFloat,
+ {
+ token: "punctuation.section",
+ regex: "\\}",
+ next: "start"
+ }
+ ],
+ "embedded_ruby": [
+ RubyExports.constantNumericHex,
+ RubyExports.constantNumericFloat,
+ {
+ token : "support.class", // class name
+ regex : "[A-Z][a-zA-Z_\\d]+"
+ },
+ {
+ token : new RubyHighlightRules().getKeywords(),
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
+ },
+ {
+ token : ["keyword", "text", "text"],
+ regex : "(?:do|\\{)(?: \\|[^|]+\\|)?$",
+ next : "start"
+ },
+ {
+ token : ["text"],
+ regex : "^$",
+ next : "start"
+ },
+ {
+ token : ["text"],
+ regex : "^(?!.*\\|\\s*$)",
+ next : "start"
+ }
+ ]
+}
+
+};
+
+oop.inherits(HamlHighlightRules, TextHighlightRules);
+
+exports.HamlHighlightRules = HamlHighlightRules;
+});
http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/handlebars.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/handlebars.js b/src/fauxton/assets/js/libs/ace/mode/handlebars.js
new file mode 100644
index 0000000..55af534
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/handlebars.js
@@ -0,0 +1,29 @@
+/* global define */
+
+define(function(require, exports, module) {
+ "use strict";
+
+var oop = require("../lib/oop");
+var HtmlMode = require("./html").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var HandlebarsHighlightRules = require("./handlebars_highlight_rules").HandlebarsHighlightRules;
+var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour;
+var HtmlFoldMode = require("./folding/html").FoldMode;
+
+var Mode = function() {
+ HtmlMode.call(this);
+ this.HighlightRules = HandlebarsHighlightRules;
+ this.$behaviour = new HtmlBehaviour();
+
+
+ this.foldingRules = new HtmlFoldMode();
+};
+
+oop.inherits(Mode, HtmlMode);
+
+(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/handlebars_highlight_rules.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/handlebars_highlight_rules.js b/src/fauxton/assets/js/libs/ace/mode/handlebars_highlight_rules.js
new file mode 100644
index 0000000..e224335
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/handlebars_highlight_rules.js
@@ -0,0 +1,72 @@
+/* global define */
+
+define(function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
+var xmlUtil = require("./xml_util");
+function pop2(currentState, stack) {
+ stack.splice(0, 3);
+ return stack.shift() || "start";
+}
+var HandlebarsHighlightRules = function() {
+ HtmlHighlightRules.call(this);
+ var hbs = {
+ regex : "(?={{)",
+ push : "handlebars"
+ }
+ for (var key in this.$rules) {
+ this.$rules[key].unshift(hbs);
+ }
+ this.$rules.handlebars = [{
+ token : "comment.start",
+ regex : "{{!--",
+ push : [{
+ token : "comment.end",
+ regex : "--}}",
+ next : pop2
+ }, {
+ defaultToken : "comment"
+ }]
+ }, {
+ token : "comment.start",
+ regex : "{{!",
+ push : [{
+ token : "comment.end",
+ regex : "}}",
+ next : pop2
+ }, {
+ defaultToken : "comment"
+ }]
+ }, {
+ token : "storage.type.start", // begin section
+ regex : "{{[#\\^/&]?",
+ push : [{
+ token : "storage.type.end",
+ regex : "}}",
+ next : pop2
+ }, {
+ token : "variable.parameter",
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$]*"
+ }]
+ }, {
+ token : "support.function", // unescaped variable
+ regex : "{{{",
+ push : [{
+ token : "support.function",
+ regex : "}}}",
+ next : pop2
+ }, {
+ token : "variable.parameter",
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$]*"
+ }]
+ }];
+
+ this.normalizeRules();
+};
+
+oop.inherits(HandlebarsHighlightRules, HtmlHighlightRules);
+
+exports.HandlebarsHighlightRules = HandlebarsHighlightRules;
+});
http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/haskell.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/haskell.js b/src/fauxton/assets/js/libs/ace/mode/haskell.js
new file mode 100644
index 0000000..5b36905
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/haskell.js
@@ -0,0 +1,62 @@
+/* ***** 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 HaskellHighlightRules = require("./haskell_highlight_rules").HaskellHighlightRules;
+// TODO: pick appropriate fold mode
+var FoldMode = require("./folding/cstyle").FoldMode;
+
+var Mode = function() {
+ this.HighlightRules = HaskellHighlightRules;
+ this.foldingRules = new FoldMode();
+};
+oop.inherits(Mode, TextMode);
+
+(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/haskell_highlight_rules.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/haskell_highlight_rules.js b/src/fauxton/assets/js/libs/ace/mode/haskell_highlight_rules.js
new file mode 100644
index 0000000..fdfaa53
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/haskell_highlight_rules.js
@@ -0,0 +1,246 @@
+/* ***** 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\haskell.tmbundle\Syntaxes\Haskell.plist (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 TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var HaskellHighlightRules = function() {
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = { start:
+ [ { token:
+ [ 'punctuation.definition.entity.haskell',
+ 'keyword.operator.function.infix.haskell',
+ 'punctuation.definition.entity.haskell' ],
+ regex: '(`)([a-zA-Z_\']*?)(`)',
+ comment: 'In case this regex seems unusual for an infix operator, note that Haskell allows any ordinary function application (elem 4 [1..10]) to be rewritten as an infix expression (4 `elem` [1..10]).' },
+ { token: 'constant.language.unit.haskell', regex: '\\(\\)' },
+ { token: 'constant.language.empty-list.haskell',
+ regex: '\\[\\]' },
+ { token: 'keyword.other.haskell',
+ regex: 'module',
+ push:
+ [ { token: 'keyword.other.haskell', regex: 'where', next: 'pop' },
+ { include: '#module_name' },
+ { include: '#module_exports' },
+ { token: 'invalid', regex: '[a-z]+' },
+ { defaultToken: 'meta.declaration.module.haskell' } ] },
+ { token: 'keyword.other.haskell',
+ regex: '\\bclass\\b',
+ push:
+ [ { token: 'keyword.other.haskell',
+ regex: '\\bwhere\\b',
+ next: 'pop' },
+ { token: 'support.class.prelude.haskell',
+ regex: '\\b(?:Monad|Functor|Eq|Ord|Read|Show|Num|(?:Frac|Ra)tional|Enum|Bounded|Real(?:Frac|Float)?|Integral|Floating)\\b' },
+ { token: 'entity.other.inherited-class.haskell',
+ regex: '[A-Z][A-Za-z_\']*' },
+ { token: 'variable.other.generic-type.haskell',
+ regex: '\\b[a-z][a-zA-Z0-9_\']*\\b' },
+ { defaultToken: 'meta.declaration.class.haskell' } ] },
+ { token: 'keyword.other.haskell',
+ regex: '\\binstance\\b',
+ push:
+ [ { token: 'keyword.other.haskell',
+ regex: '\\bwhere\\b|$',
+ next: 'pop' },
+ { include: '#type_signature' },
+ { defaultToken: 'meta.declaration.instance.haskell' } ] },
+ { token: 'keyword.other.haskell',
+ regex: 'import',
+ push:
+ [ { token: 'meta.import.haskell', regex: '$|;', next: 'pop' },
+ { token: 'keyword.other.haskell', regex: 'qualified|as|hiding' },
+ { include: '#module_name' },
+ { include: '#module_exports' },
+ { defaultToken: 'meta.import.haskell' } ] },
+ { token: [ 'keyword.other.haskell', 'meta.deriving.haskell' ],
+ regex: '(deriving)(\\s*\\()',
+ push:
+ [ { token: 'meta.deriving.haskell', regex: '\\)', next: 'pop' },
+ { token: 'entity.other.inherited-class.haskell',
+ regex: '\\b[A-Z][a-zA-Z_\']*' },
+ { defaultToken: 'meta.deriving.haskell' } ] },
+ { token: 'keyword.other.haskell',
+ regex: '\\b(?:deriving|where|data|type|case|of|let|in|newtype|default)\\b' },
+ { token: 'keyword.operator.haskell', regex: '\\binfix[lr]?\\b' },
+ { token: 'keyword.control.haskell',
+ regex: '\\b(?:do|if|then|else)\\b' },
+ { token: 'constant.numeric.float.haskell',
+ regex: '\\b(?:[0-9]+\\.[0-9]+(?:[eE][+-]?[0-9]+)?|[0-9]+[eE][+-]?[0-9]+)\\b',
+ comment: 'Floats are always decimal' },
+ { token: 'constant.numeric.haskell',
+ regex: '\\b(?:[0-9]+|0(?:[xX][0-9a-fA-F]+|[oO][0-7]+))\\b' },
+ { token:
+ [ 'meta.preprocessor.c',
+ 'punctuation.definition.preprocessor.c',
+ 'meta.preprocessor.c' ],
+ regex: '^(\\s*)(#)(\\s*\\w+)',
+ comment: 'In addition to Haskell\'s "native" syntax, GHC permits the C preprocessor to be run on a source file.' },
+ { include: '#pragma' },
+ { token: 'punctuation.definition.string.begin.haskell',
+ regex: '"',
+ push:
+ [ { token: 'punctuation.definition.string.end.haskell',
+ regex: '"',
+ next: 'pop' },
+ { token: 'constant.character.escape.haskell',
+ regex: '\\\\(?:NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\\"\'\\&])' },
+ { token: 'constant.character.escape.octal.haskell',
+ regex: '\\\\o[0-7]+|\\\\x[0-9A-Fa-f]+|\\\\[0-9]+' },
+ { token: 'constant.character.escape.control.haskell',
+ regex: '\\^[A-Z@\\[\\]\\\\\\^_]' },
+ { defaultToken: 'string.quoted.double.haskell' } ] },
+ { token:
+ [ 'punctuation.definition.string.begin.haskell',
+ 'string.quoted.single.haskell',
+ 'constant.character.escape.haskell',
+ 'constant.character.escape.octal.haskell',
+ 'constant.character.escape.hexadecimal.haskell',
+ 'constant.character.escape.control.haskell',
+ 'punctuation.definition.string.end.haskell' ],
+ regex: '(\')(?:([\\ -\\[\\]-~])|(\\\\(?:NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\\"\'\\&]))|(\\\\o[0-7]+)|(\\\\x[0-9A-Fa-f]+)|(\\^[A-Z@\\[\\]\\\\\\^_]))(\')' },
+ { token:
+ [ 'meta.function.type-declaration.haskell',
+ 'entity.name.function.haskell',
+ 'meta.function.type-declaration.haskell',
+ 'keyword.other.double-colon.haskell' ],
+ regex: '^(\\s*)([a-z_][a-zA-Z0-9_\']*|\\([|!%$+\\-.,=</>]+\\))(\\s*)(::)',
+ push:
+ [ { token: 'meta.function.type-declaration.haskell',
+ regex: '$',
+ next: 'pop' },
+ { include: '#type_signature' },
+ { defaultToken: 'meta.function.type-declaration.haskell' } ] },
+ { token: 'support.constant.haskell',
+ regex: '\\b(?:Just|Nothing|Left|Right|True|False|LT|EQ|GT|\\(\\)|\\[\\])\\b' },
+ { token: 'constant.other.haskell', regex: '\\b[A-Z]\\w*\\b' },
+ { include: '#comments' },
+ { token: 'support.function.prelude.haskell',
+ regex: '\\b(?:abs|acos|acosh|all|and|any|appendFile|applyM|asTypeOf|asin|asinh|atan|atan2|atanh|break|catch|ceiling|compare|concat|concatMap|const|cos|cosh|curry|cycle|decodeFloat|div|divMod|drop|dropWhile|elem|encodeFloat|enumFrom|enumFromThen|enumFromThenTo|enumFromTo|error|even|exp|exponent|fail|filter|flip|floatDigits|floatRadix|floatRange|floor|fmap|foldl|foldl1|foldr|foldr1|fromEnum|fromInteger|fromIntegral|fromRational|fst|gcd|getChar|getContents|getLine|head|id|init|interact|ioError|isDenormalized|isIEEE|isInfinite|isNaN|isNegativeZero|iterate|last|lcm|length|lex|lines|log|logBase|lookup|map|mapM|mapM_|max|maxBound|maximum|maybe|min|minBound|minimum|mod|negate|not|notElem|null|odd|or|otherwise|pi|pred|print|product|properFraction|putChar|putStr|putStrLn|quot|quotRem|read|readFile|readIO|readList|readLn|readParen|reads|readsPrec|realToFrac|recip|rem|repeat|replicate|return|reverse|round|scaleFloat|scanl|scanl1|scanr|scanr1|seq|sequence|sequence_|show|showChar|showL
ist|showParen|showString|shows|showsPrec|significand|signum|sin|sinh|snd|span|splitAt|sqrt|subtract|succ|sum|tail|take|takeWhile|tan|tanh|toEnum|toInteger|toRational|truncate|uncurry|undefined|unlines|until|unwords|unzip|unzip3|userError|words|writeFile|zip|zip3|zipWith|zipWith3)\\b' },
+ { include: '#infix_op' },
+ { token: 'keyword.operator.haskell',
+ regex: '[|!%$?~+:\\-.=</>\\\\]+',
+ comment: 'In case this regex seems overly general, note that Haskell permits the definition of new operators which can be nearly any string of punctuation characters, such as $%^&*.' },
+ { token: 'punctuation.separator.comma.haskell', regex: ',' } ],
+ '#block_comment':
+ [ { token: 'punctuation.definition.comment.haskell',
+ regex: '\\{-(?!#)',
+ push:
+ [ { include: '#block_comment' },
+ { token: 'punctuation.definition.comment.haskell',
+ regex: '-\\}',
+ next: 'pop' },
+ { defaultToken: 'comment.block.haskell' } ] } ],
+ '#comments':
+ [ { token: 'punctuation.definition.comment.haskell',
+ regex: '--.*',
+ push_:
+ [ { token: 'comment.line.double-dash.haskell',
+ regex: '$',
+ next: 'pop' },
+ { defaultToken: 'comment.line.double-dash.haskell' } ] },
+ { include: '#block_comment' } ],
+ '#infix_op':
+ [ { token: 'entity.name.function.infix.haskell',
+ regex: '\\([|!%$+:\\-.=</>]+\\)|\\(,+\\)' } ],
+ '#module_exports':
+ [ { token: 'meta.declaration.exports.haskell',
+ regex: '\\(',
+ push:
+ [ { token: 'meta.declaration.exports.haskell',
+ regex: '\\)',
+ next: 'pop' },
+ { token: 'entity.name.function.haskell',
+ regex: '\\b[a-z][a-zA-Z_\']*' },
+ { token: 'storage.type.haskell', regex: '\\b[A-Z][A-Za-z_\']*' },
+ { token: 'punctuation.separator.comma.haskell', regex: ',' },
+ { include: '#infix_op' },
+ { token: 'meta.other.unknown.haskell',
+ regex: '\\(.*?\\)',
+ comment: 'So named because I don\'t know what to call this.' },
+ { defaultToken: 'meta.declaration.exports.haskell' } ] } ],
+ '#module_name':
+ [ { token: 'support.other.module.haskell',
+ regex: '[A-Z][A-Za-z._\']*' } ],
+ '#pragma':
+ [ { token: 'meta.preprocessor.haskell',
+ regex: '\\{-#',
+ push:
+ [ { token: 'meta.preprocessor.haskell',
+ regex: '#-\\}',
+ next: 'pop' },
+ { token: 'keyword.other.preprocessor.haskell',
+ regex: '\\b(?:LANGUAGE|UNPACK|INLINE)\\b' },
+ { defaultToken: 'meta.preprocessor.haskell' } ] } ],
+ '#type_signature':
+ [ { token:
+ [ 'meta.class-constraint.haskell',
+ 'entity.other.inherited-class.haskell',
+ 'meta.class-constraint.haskell',
+ 'variable.other.generic-type.haskell',
+ 'meta.class-constraint.haskell',
+ 'keyword.other.big-arrow.haskell' ],
+ regex: '(\\(\\s*)([A-Z][A-Za-z]*)(\\s+)([a-z][A-Za-z_\']*)(\\)\\s*)(=>)' },
+ { include: '#pragma' },
+ { token: 'keyword.other.arrow.haskell', regex: '->' },
+ { token: 'keyword.other.big-arrow.haskell', regex: '=>' },
+ { token: 'support.type.prelude.haskell',
+ regex: '\\b(?:Int(?:eger)?|Maybe|Either|Bool|Float|Double|Char|String|Ordering|ShowS|ReadS|FilePath|IO(?:Error)?)\\b' },
+ { token: 'variable.other.generic-type.haskell',
+ regex: '\\b[a-z][a-zA-Z0-9_\']*\\b' },
+ { token: 'storage.type.haskell',
+ regex: '\\b[A-Z][a-zA-Z0-9_\']*\\b' },
+ { token: 'support.constant.unit.haskell', regex: '\\(\\)' },
+ { include: '#comments' } ] }
+
+ this.normalizeRules();
+};
+
+HaskellHighlightRules.metaData = { fileTypes: [ 'hs' ],
+ keyEquivalent: '^~H',
+ name: 'Haskell',
+ scopeName: 'source.haskell' }
+
+
+oop.inherits(HaskellHighlightRules, TextHighlightRules);
+
+exports.HaskellHighlightRules = HaskellHighlightRules;
+});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/haxe.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/haxe.js b/src/fauxton/assets/js/libs/ace/mode/haxe.js
new file mode 100644
index 0000000..138df42
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/haxe.js
@@ -0,0 +1,56 @@
+define(function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var HaxeHighlightRules = require("./haxe_highlight_rules").HaxeHighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+var Mode = function() {
+ this.HighlightRules = HaxeHighlightRules;
+
+ this.$outdent = new MatchingBraceOutdent();
+ this.$behaviour = new CstyleBehaviour();
+ this.foldingRules = new CStyleFoldMode();
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+ this.lineCommentStart = "//";
+ this.blockComment = {start: "/*", end: "*/"};
+
+ 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/haxe_highlight_rules.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/haxe_highlight_rules.js b/src/fauxton/assets/js/libs/ace/mode/haxe_highlight_rules.js
new file mode 100644
index 0000000..e995613
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/haxe_highlight_rules.js
@@ -0,0 +1,98 @@
+define(function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+
+var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var HaxeHighlightRules = function() {
+
+ var keywords = (
+ "break|case|cast|catch|class|continue|default|else|enum|extends|for|function|if|implements|import|in|inline|interface|new|override|package|private|public|return|static|super|switch|this|throw|trace|try|typedef|untyped|var|while|Array|Void|Bool|Int|UInt|Float|Dynamic|String|List|Hash|IntHash|Error|Unknown|Type|Std"
+ );
+
+ var buildinConstants = (
+ "null|true|false"
+ );
+
+ var keywordMapper = this.createKeywordMapper({
+ "variable.language": "this",
+ "keyword": keywords,
+ "constant.language": buildinConstants
+ }, "identifier");
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ },
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ regex : "\\/\\*",
+ next : "comment"
+ }, {
+ token : "string.regexp",
+ regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
+ }, {
+ token : "string", // single line
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
+ }, {
+ token : "string", // single line
+ regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
+ }, {
+ token : "constant.numeric", // hex
+ regex : "0[xX][0-9a-fA-F]+\\b"
+ }, {
+ token : "constant.numeric", // float
+ regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
+ }, {
+ token : "constant.language.boolean",
+ regex : "(?:true|false)\\b"
+ }, {
+ token : keywordMapper,
+ // TODO: Unicode escape sequences
+ // TODO: Unicode identifiers
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
+ }, {
+ token : "keyword.operator",
+ regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
+ }, {
+ token : "punctuation.operator",
+ regex : "\\?|\\:|\\,|\\;|\\."
+ }, {
+ token : "paren.lparen",
+ regex : "[[({<]"
+ }, {
+ token : "paren.rparen",
+ regex : "[\\])}>]"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }
+ ],
+ "comment" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ next : "start"
+ }, {
+ token : "comment", // comment spanning whole line
+ regex : ".+"
+ }
+ ]
+ };
+
+ this.embedRules(DocCommentHighlightRules, "doc-",
+ [ DocCommentHighlightRules.getEndRule("start") ]);
+};
+
+oop.inherits(HaxeHighlightRules, TextHighlightRules);
+
+exports.HaxeHighlightRules = HaxeHighlightRules;
+});
http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/html.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/html.js b/src/fauxton/assets/js/libs/ace/mode/html.js
new file mode 100644
index 0000000..9085400
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/html.js
@@ -0,0 +1,77 @@
+/* ***** 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 JavaScriptMode = require("./javascript").Mode;
+var CssMode = require("./css").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
+var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour;
+var HtmlFoldMode = require("./folding/html").FoldMode;
+var HtmlCompletions = require("./html_completions").HtmlCompletions;
+
+var Mode = function() {
+ this.HighlightRules = HtmlHighlightRules;
+ this.$behaviour = new HtmlBehaviour();
+ this.$completer = new HtmlCompletions();
+
+ this.createModeDelegates({
+ "js-": JavaScriptMode,
+ "css-": CssMode
+ });
+
+ this.foldingRules = new HtmlFoldMode();
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+
+ this.blockComment = {start: "<!--", end: "-->"};
+
+ this.getNextLineIndent = function(state, line, tab) {
+ return this.$getIndent(line);
+ };
+
+ this.checkOutdent = function(state, line, input) {
+ return false;
+ };
+
+ this.getCompletions = function(state, session, pos, prefix) {
+ return this.$completer.getCompletions(state, session, pos, prefix);
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/html_completions.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/html_completions.js b/src/fauxton/assets/js/libs/ace/mode/html_completions.js
new file mode 100644
index 0000000..283b713
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/html_completions.js
@@ -0,0 +1,313 @@
+/* ***** 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 TokenIterator = require("../token_iterator").TokenIterator;
+
+var commonAttributes = [
+ "accesskey",
+ "class",
+ "contenteditable",
+ "contextmenu",
+ "dir",
+ "draggable",
+ "dropzone",
+ "hidden",
+ "id",
+ "lang",
+ "spellcheck",
+ "style",
+ "tabindex",
+ "title",
+ "translate"
+];
+
+var eventAttributes = [
+ "onabort",
+ "onblur",
+ "oncancel",
+ "oncanplay",
+ "oncanplaythrough",
+ "onchange",
+ "onclick",
+ "onclose",
+ "oncontextmenu",
+ "oncuechange",
+ "ondblclick",
+ "ondrag",
+ "ondragend",
+ "ondragenter",
+ "ondragleave",
+ "ondragover",
+ "ondragstart",
+ "ondrop",
+ "ondurationchange",
+ "onemptied",
+ "onended",
+ "onerror",
+ "onfocus",
+ "oninput",
+ "oninvalid",
+ "onkeydown",
+ "onkeypress",
+ "onkeyup",
+ "onload",
+ "onloadeddata",
+ "onloadedmetadata",
+ "onloadstart",
+ "onmousedown",
+ "onmousemove",
+ "onmouseout",
+ "onmouseover",
+ "onmouseup",
+ "onmousewheel",
+ "onpause",
+ "onplay",
+ "onplaying",
+ "onprogress",
+ "onratechange",
+ "onreset",
+ "onscroll",
+ "onseeked",
+ "onseeking",
+ "onselect",
+ "onshow",
+ "onstalled",
+ "onsubmit",
+ "onsuspend",
+ "ontimeupdate",
+ "onvolumechange",
+ "onwaiting"
+];
+
+var globalAttributes = commonAttributes.concat(eventAttributes);
+
+var attributeMap = {
+ "html": ["manifest"],
+ "head": [],
+ "title": [],
+ "base": ["href", "target"],
+ "link": ["href", "hreflang", "rel", "media", "type", "sizes"],
+ "meta": ["http-equiv", "name", "content", "charset"],
+ "style": ["type", "media", "scoped"],
+ "script": ["charset", "type", "src", "defer", "async"],
+ "noscript": ["href"],
+ "body": ["onafterprint", "onbeforeprint", "onbeforeunload", "onhashchange", "onmessage", "onoffline", "onpopstate", "onredo", "onresize", "onstorage", "onundo", "onunload"],
+ "section": [],
+ "nav": [],
+ "article": ["pubdate"],
+ "aside": [],
+ "h1": [],
+ "h2": [],
+ "h3": [],
+ "h4": [],
+ "h5": [],
+ "h6": [],
+ "header": [],
+ "footer": [],
+ "address": [],
+ "main": [],
+ "p": [],
+ "hr": [],
+ "pre": [],
+ "blockquote": ["cite"],
+ "ol": ["start", "reversed"],
+ "ul": [],
+ "li": ["value"],
+ "dl": [],
+ "dt": [],
+ "dd": [],
+ "figure": [],
+ "figcaption": [],
+ "div": [],
+ "a": ["href", "target", "ping", "rel", "media", "hreflang", "type"],
+ "em": [],
+ "strong": [],
+ "small": [],
+ "s": [],
+ "cite": [],
+ "q": ["cite"],
+ "dfn": [],
+ "abbr": [],
+ "data": [],
+ "time": ["datetime"],
+ "code": [],
+ "var": [],
+ "samp": [],
+ "kbd": [],
+ "sub": [],
+ "sup": [],
+ "i": [],
+ "b": [],
+ "u": [],
+ "mark": [],
+ "ruby": [],
+ "rt": [],
+ "rp": [],
+ "bdi": [],
+ "bdo": [],
+ "span": [],
+ "br": [],
+ "wbr": [],
+ "ins": ["cite", "datetime"],
+ "del": ["cite", "datetime"],
+ "img": ["alt", "src", "height", "width", "usemap", "ismap"],
+ "iframe": ["name", "src", "height", "width", "sandbox", "seamless"],
+ "embed": ["src", "height", "width", "type"],
+ "object": ["param", "data", "type", "height" , "width", "usemap", "name", "form", "classid"],
+ "param": ["name", "value"],
+ "video": ["src", "autobuffer", "autoplay", "loop", "controls", "width", "height", "poster"],
+ "audio": ["src", "autobuffer", "autoplay", "loop", "controls"],
+ "source": ["src", "type", "media"],
+ "track": ["kind", "src", "srclang", "label", "default"],
+ "canvas": ["width", "height"],
+ "map": ["name"],
+ "area": ["shape", "coords", "href", "hreflang", "alt", "target", "media", "rel", "ping", "type"],
+ "svg": [],
+ "math": [],
+ "table": ["summary"],
+ "caption": [],
+ "colgroup": ["span"],
+ "col": ["span"],
+ "tbody": [],
+ "thead": [],
+ "tfoot": [],
+ "tr": [],
+ "td": ["headers", "rowspan", "colspan"],
+ "th": ["headers", "rowspan", "colspan", "scope"],
+ "form": ["accept-charset", "action", "autocomplete", "enctype", "method", "name", "novalidate", "target"],
+ "fieldset": ["disabled", "form", "name"],
+ "legend": [],
+ "label": ["form", "for"],
+ "input": ["type", "accept", "alt", "autocomplete", "checked", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "height", "list", "max", "maxlength", "min", "multiple", "pattern", "placeholder", "readonly", "required", "size", "src", "step", "width", "files", "value"],
+ "button": ["autofocus", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "name", "value", "type"],
+ "select": ["autofocus", "disabled", "form", "multiple", "name", "size"],
+ "datalist": [],
+ "optgroup": ["disabled", "label"],
+ "option": ["disabled", "selected", "label", "value"],
+ "textarea": ["autofocus", "disabled", "form", "maxlength", "name", "placeholder", "readonly", "required", "rows", "cols", "wrap"],
+ "keygen": ["autofocus", "challenge", "disabled", "form", "keytype", "name"],
+ "output": ["for", "form", "name"],
+ "progress": ["value", "max"],
+ "meter": ["value", "min", "max", "low", "high", "optimum"],
+ "details": ["open"],
+ "summary": [],
+ "command": ["type", "label", "icon", "disabled", "checked", "radiogroup", "command"],
+ "menu": ["type", "label"],
+ "dialog": ["open"]
+};
+
+var allElements = Object.keys(attributeMap);
+
+function hasType(token, type) {
+ var tokenTypes = token.type.split('.');
+ return type.split('.').every(function(type){
+ return (tokenTypes.indexOf(type) !== -1);
+ });
+}
+
+function findTagName(session, pos) {
+ var iterator = new TokenIterator(session, pos.row, pos.column);
+ var token = iterator.getCurrentToken();
+ if (!token || !hasType(token, 'tag') && !(hasType(token, 'text') && token.value.match('/'))){
+ do {
+ token = iterator.stepBackward();
+ } while (token && (hasType(token, 'string') || hasType(token, 'operator') || hasType(token, 'attribute-name') || hasType(token, 'text')));
+ }
+ if (token && hasType(token, 'tag-name') && !iterator.stepBackward().value.match('/'))
+ return token.value;
+}
+
+var HtmlCompletions = function() {
+
+};
+
+(function() {
+
+ this.getCompletions = function(state, session, pos, prefix) {
+ var token = session.getTokenAt(pos.row, pos.column);
+
+ if (!token)
+ return [];
+
+ // tag name
+ if (hasType(token, "tag-name") || (token.value == '<' && hasType(token, "text")))
+ return this.getTagCompletions(state, session, pos, prefix);
+
+ // tag attribute
+ if (hasType(token, 'text') || hasType(token, 'attribute-name'))
+ return this.getAttributeCompetions(state, session, pos, prefix);
+
+ return [];
+ };
+
+ this.getTagCompletions = function(state, session, pos, prefix) {
+ var elements = allElements;
+ if (prefix) {
+ elements = elements.filter(function(element){
+ return element.indexOf(prefix) === 0;
+ });
+ }
+ return elements.map(function(element){
+ return {
+ value: element,
+ meta: "tag"
+ };
+ });
+ };
+
+ this.getAttributeCompetions = function(state, session, pos, prefix) {
+ var tagName = findTagName(session, pos);
+ if (!tagName)
+ return [];
+ var attributes = globalAttributes;
+ if (tagName in attributeMap) {
+ attributes = attributes.concat(attributeMap[tagName]);
+ }
+ if (prefix) {
+ attributes = attributes.filter(function(attribute){
+ return attribute.indexOf(prefix) === 0;
+ });
+ }
+ return attributes.map(function(attribute){
+ return {
+ caption: attribute,
+ snippet: attribute + '="$0"',
+ meta: "attribute"
+ };
+ });
+ };
+
+}).call(HtmlCompletions.prototype);
+
+exports.HtmlCompletions = HtmlCompletions;
+});
http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/html_highlight_rules.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/html_highlight_rules.js b/src/fauxton/assets/js/libs/ace/mode/html_highlight_rules.js
new file mode 100644
index 0000000..ec63187
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/html_highlight_rules.js
@@ -0,0 +1,123 @@
+/* ***** 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 lang = require("../lib/lang");
+var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
+var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
+var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
+
+var tagMap = lang.createMap({
+ a : 'anchor',
+ button : 'form',
+ form : 'form',
+ img : 'image',
+ input : 'form',
+ label : 'form',
+ option : 'form',
+ script : 'script',
+ select : 'form',
+ textarea : 'form',
+ style : 'style',
+ table : 'table',
+ tbody : 'table',
+ td : 'table',
+ tfoot : 'table',
+ th : 'table',
+ tr : 'table'
+});
+
+var HtmlHighlightRules = function() {
+ XmlHighlightRules.call(this);
+
+ this.addRules({
+ attributes: [{
+ include : "space"
+ }, {
+ token : "entity.other.attribute-name",
+ regex : "[-_a-zA-Z0-9:]+"
+ }, {
+ token : "keyword.operator.separator",
+ regex : "=",
+ push : [{
+ include: "space"
+ }, {
+ token : "string",
+ regex : "[^<>='\"`\\s]+",
+ next : "pop"
+ }, {
+ token : "empty",
+ regex : "",
+ next : "pop"
+ }]
+ }, {
+ include : "string"
+ }],
+ tag: [{
+ token : function(start, tag) {
+ var group = tagMap[tag];
+ return ["meta.tag.punctuation.begin",
+ "meta.tag.name" + (group ? "." + group : "")];
+ },
+ regex : "(<)([-_a-zA-Z0-9:]+)",
+ next: "start_tag_stuff"
+ }, {
+ token : function(start, tag) {
+ var group = tagMap[tag];
+ return ["meta.tag.punctuation.begin",
+ "meta.tag.name" + (group ? "." + group : "")];
+ },
+ regex : "(</)([-_a-zA-Z0-9:]+)",
+ next: "end_tag_stuff"
+ }],
+ start_tag_stuff: [
+ {include : "attributes"},
+ {token : "meta.tag.punctuation.end", regex : "/?>", next : "start"}
+ ],
+ end_tag_stuff: [
+ {include : "space"},
+ {token : "meta.tag.punctuation.end", regex : ">", next : "start"}
+ ]
+ });
+
+ this.embedTagRules(CssHighlightRules, "css-", "style");
+ this.embedTagRules(JavaScriptHighlightRules, "js-", "script");
+
+ if (this.constructor === HtmlHighlightRules)
+ this.normalizeRules();
+};
+
+oop.inherits(HtmlHighlightRules, XmlHighlightRules);
+
+exports.HtmlHighlightRules = HtmlHighlightRules;
+});
http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/html_ruby.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/html_ruby.js b/src/fauxton/assets/js/libs/ace/mode/html_ruby.js
new file mode 100644
index 0000000..876f367
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/html_ruby.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.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+
+define(function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var Tokenizer = require("../tokenizer").Tokenizer;
+var HtmlRubyHighlightRules = require("./html_ruby_highlight_rules").HtmlRubyHighlightRules;
+var HtmlMode = require("./html").Mode;
+var JavaScriptMode = require("./javascript").Mode;
+var CssMode = require("./css").Mode;
+var RubyMode = require("./ruby").Mode;
+
+var Mode = function() {
+ HtmlMode.call(this);
+ this.HighlightRules = HtmlRubyHighlightRules;
+ this.createModeDelegates({
+ "js-": JavaScriptMode,
+ "css-": CssMode,
+ "ruby-": RubyMode
+ });
+};
+oop.inherits(Mode, HtmlMode);
+
+(function() {
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
\ No newline at end of file