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:23 UTC

[38/51] [partial] working replacement

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/lib/event.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/lib/event.js b/src/fauxton/assets/js/libs/ace/lib/event.js
new file mode 100644
index 0000000..691d001
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/lib/event.js
@@ -0,0 +1,353 @@
+/* ***** 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 keys = require("./keys");
+var useragent = require("./useragent");
+var dom = require("./dom");
+
+exports.addListener = function(elem, type, callback) {
+    if (elem.addEventListener) {
+        return elem.addEventListener(type, callback, false);
+    }
+    if (elem.attachEvent) {
+        var wrapper = function() {
+            callback.call(elem, window.event);
+        };
+        callback._wrapper = wrapper;
+        elem.attachEvent("on" + type, wrapper);
+    }
+};
+
+exports.removeListener = function(elem, type, callback) {
+    if (elem.removeEventListener) {
+        return elem.removeEventListener(type, callback, false);
+    }
+    if (elem.detachEvent) {
+        elem.detachEvent("on" + type, callback._wrapper || callback);
+    }
+};
+
+/*
+* Prevents propagation and clobbers the default action of the passed event
+*/
+exports.stopEvent = function(e) {
+    exports.stopPropagation(e);
+    exports.preventDefault(e);
+    return false;
+};
+
+exports.stopPropagation = function(e) {
+    if (e.stopPropagation)
+        e.stopPropagation();
+    else
+        e.cancelBubble = true;
+};
+
+exports.preventDefault = function(e) {
+    if (e.preventDefault)
+        e.preventDefault();
+    else
+        e.returnValue = false;
+};
+
+/*
+ * @return {Number} 0 for left button, 1 for middle button, 2 for right button
+ */
+exports.getButton = function(e) {
+    if (e.type == "dblclick")
+        return 0;
+    if (e.type == "contextmenu" || (e.ctrlKey && useragent.isMac))
+        return 2;
+
+    // DOM Event
+    if (e.preventDefault) {
+        return e.button;
+    }
+    // old IE
+    else {
+        return {1:0, 2:2, 4:1}[e.button];
+    }
+};
+
+exports.capture = function(el, eventHandler, releaseCaptureHandler) {
+    function onMouseUp(e) {
+        eventHandler && eventHandler(e);
+        releaseCaptureHandler && releaseCaptureHandler(e);
+
+        exports.removeListener(document, "mousemove", eventHandler, true);
+        exports.removeListener(document, "mouseup", onMouseUp, true);
+        exports.removeListener(document, "dragstart", onMouseUp, true);
+    }
+
+    exports.addListener(document, "mousemove", eventHandler, true);
+    exports.addListener(document, "mouseup", onMouseUp, true);
+    exports.addListener(document, "dragstart", onMouseUp, true);
+};
+
+exports.addMouseWheelListener = function(el, callback) {
+    if ("onmousewheel" in el) {
+        var factor = 8;
+        exports.addListener(el, "mousewheel", function(e) {
+            if (e.wheelDeltaX !== undefined) {
+                e.wheelX = -e.wheelDeltaX / factor;
+                e.wheelY = -e.wheelDeltaY / factor;
+            } else {
+                e.wheelX = 0;
+                e.wheelY = -e.wheelDelta / factor;
+            }
+            callback(e);
+        });
+    } else if ("onwheel" in el) {
+        exports.addListener(el, "wheel",  function(e) {
+            e.wheelX = (e.deltaX || 0) * 5;
+            e.wheelY = (e.deltaY || 0) * 5;
+            callback(e);
+        });
+    } else {
+        exports.addListener(el, "DOMMouseScroll", function(e) {
+            if (e.axis && e.axis == e.HORIZONTAL_AXIS) {
+                e.wheelX = (e.detail || 0) * 5;
+                e.wheelY = 0;
+            } else {
+                e.wheelX = 0;
+                e.wheelY = (e.detail || 0) * 5;
+            }
+            callback(e);
+        });
+    }
+};
+
+exports.addMultiMouseDownListener = function(el, timeouts, eventHandler, callbackName) {
+    var clicks = 0;
+    var startX, startY, timer;
+    var eventNames = {
+        2: "dblclick",
+        3: "tripleclick",
+        4: "quadclick"
+    };
+
+    exports.addListener(el, "mousedown", function(e) {
+        if (exports.getButton(e) != 0) {
+            clicks = 0;
+        } else if (e.detail > 1) {
+            clicks++;
+            if (clicks > 4)
+                clicks = 1;
+        } else {
+            clicks = 1;
+        }
+        if (useragent.isIE) {
+            var isNewClick = Math.abs(e.clientX - startX) > 5 || Math.abs(e.clientY - startY) > 5;
+            if (isNewClick) {
+                clicks = 1;
+            }
+            if (clicks == 1) {
+                startX = e.clientX;
+                startY = e.clientY;
+            }
+        }
+
+        eventHandler[callbackName]("mousedown", e);
+
+        if (clicks > 4)
+            clicks = 0;
+        else if (clicks > 1)
+            return eventHandler[callbackName](eventNames[clicks], e);
+    });
+
+    if (useragent.isOldIE) {
+        exports.addListener(el, "dblclick", function(e) {
+            clicks = 2;
+            if (timer)
+                clearTimeout(timer);
+            timer = setTimeout(function() {timer = null}, timeouts[clicks - 1] || 600);
+            eventHandler[callbackName]("mousedown", e);
+            eventHandler[callbackName](eventNames[clicks], e);
+        });
+    }
+};
+
+function normalizeCommandKeys(callback, e, keyCode) {
+    var hashId = 0;
+    if ((useragent.isOpera && !("KeyboardEvent" in window)) && useragent.isMac) {
+        hashId = 0 | (e.metaKey ? 1 : 0) | (e.altKey ? 2 : 0)
+            | (e.shiftKey ? 4 : 0) | (e.ctrlKey ? 8 : 0);
+    } else {
+        hashId = 0 | (e.ctrlKey ? 1 : 0) | (e.altKey ? 2 : 0)
+            | (e.shiftKey ? 4 : 0) | (e.metaKey ? 8 : 0);
+    }
+
+    if (!useragent.isMac && pressedKeys) {
+        if (pressedKeys[91] || pressedKeys[92])
+            hashId |= 8;
+        if (pressedKeys.altGr) {
+            if ((3 & hashId) != 3)
+                pressedKeys.altGr = 0
+            else
+                return;
+        }
+        if (keyCode === 18 || keyCode === 17) {
+            var location = e.location || e.keyLocation;
+            if (keyCode === 17 && location === 1) {
+                ts = e.timeStamp;
+            } else if (keyCode === 18 && hashId === 3 && location === 2) {
+                var dt = -ts;
+                ts = e.timeStamp;
+                dt += ts;
+                if (dt < 3)
+                    pressedKeys.altGr = true;
+            }
+        }
+    }
+    
+    if (keyCode in keys.MODIFIER_KEYS) {
+        switch (keys.MODIFIER_KEYS[keyCode]) {
+            case "Alt":
+                hashId = 2;
+                break;
+            case "Shift":
+                hashId = 4;
+                break;
+            case "Ctrl":
+                hashId = 1;
+                break;
+            default:
+                hashId = 8;
+                break;
+        }
+        keyCode = 0;
+    }
+
+    if (hashId & 8 && (keyCode === 91 || keyCode === 93)) {
+        keyCode = 0;
+    }
+    
+    if (!hashId && keyCode === 13) {
+        if (e.location || e.keyLocation === 3) {
+            callback(e, hashId, -keyCode)
+            if (e.defaultPrevented)
+                return;
+        }
+    }
+    
+
+    // If there is no hashId and the keyCode is not a function key, then
+    // we don't call the callback as we don't handle a command key here
+    // (it's a normal key/character input).
+    if (!hashId && !(keyCode in keys.FUNCTION_KEYS) && !(keyCode in keys.PRINTABLE_KEYS)) {
+        return false;
+    }
+    
+    
+    
+    return callback(e, hashId, keyCode);
+}
+
+var pressedKeys = null;
+var ts = 0;
+exports.addCommandKeyListener = function(el, callback) {
+    var addListener = exports.addListener;
+    if (useragent.isOldGecko || (useragent.isOpera && !("KeyboardEvent" in window))) {
+        // Old versions of Gecko aka. Firefox < 4.0 didn't repeat the keydown
+        // event if the user pressed the key for a longer time. Instead, the
+        // keydown event was fired once and later on only the keypress event.
+        // To emulate the 'right' keydown behavior, the keyCode of the initial
+        // keyDown event is stored and in the following keypress events the
+        // stores keyCode is used to emulate a keyDown event.
+        var lastKeyDownKeyCode = null;
+        addListener(el, "keydown", function(e) {
+            lastKeyDownKeyCode = e.keyCode;
+        });
+        addListener(el, "keypress", function(e) {
+            return normalizeCommandKeys(callback, e, lastKeyDownKeyCode);
+        });
+    } else {
+        var lastDefaultPrevented = null;
+
+        addListener(el, "keydown", function(e) {
+            pressedKeys[e.keyCode] = true;
+            var result = normalizeCommandKeys(callback, e, e.keyCode);
+            lastDefaultPrevented = e.defaultPrevented;
+            return result;
+        });
+
+        addListener(el, "keypress", function(e) {
+            if (lastDefaultPrevented && (e.ctrlKey || e.altKey || e.shiftKey || e.metaKey)) {
+                exports.stopEvent(e);
+                lastDefaultPrevented = null;
+            }
+        });
+
+        addListener(el, "keyup", function(e) {
+            pressedKeys[e.keyCode] = null;
+        });
+
+        if (!pressedKeys) {
+            pressedKeys = Object.create(null);
+            addListener(window, "focus", function(e) {
+                pressedKeys = Object.create(null);
+            });
+        }
+    }
+};
+
+if (window.postMessage && !useragent.isOldIE) {
+    var postMessageId = 1;
+    exports.nextTick = function(callback, win) {
+        win = win || window;
+        var messageName = "zero-timeout-message-" + postMessageId;
+        exports.addListener(win, "message", function listener(e) {
+            if (e.data == messageName) {
+                exports.stopPropagation(e);
+                exports.removeListener(win, "message", listener);
+                callback();
+            }
+        });
+        win.postMessage(messageName, "*");
+    };
+}
+
+
+exports.nextFrame = window.requestAnimationFrame ||
+    window.mozRequestAnimationFrame ||
+    window.webkitRequestAnimationFrame ||
+    window.msRequestAnimationFrame ||
+    window.oRequestAnimationFrame;
+
+if (exports.nextFrame)
+    exports.nextFrame = exports.nextFrame.bind(window);
+else
+    exports.nextFrame = function(callback) {
+        setTimeout(callback, 17);
+    };
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/lib/event_emitter.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/lib/event_emitter.js b/src/fauxton/assets/js/libs/ace/lib/event_emitter.js
new file mode 100644
index 0000000..b986014
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/lib/event_emitter.js
@@ -0,0 +1,155 @@
+/* ***** 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 EventEmitter = {};
+var stopPropagation = function() { this.propagationStopped = true; };
+var preventDefault = function() { this.defaultPrevented = true; };
+
+EventEmitter._emit =
+EventEmitter._dispatchEvent = function(eventName, e) {
+    this._eventRegistry || (this._eventRegistry = {});
+    this._defaultHandlers || (this._defaultHandlers = {});
+
+    var listeners = this._eventRegistry[eventName] || [];
+    var defaultHandler = this._defaultHandlers[eventName];
+    if (!listeners.length && !defaultHandler)
+        return;
+
+    if (typeof e != "object" || !e)
+        e = {};
+
+    if (!e.type)
+        e.type = eventName;
+    if (!e.stopPropagation)
+        e.stopPropagation = stopPropagation;
+    if (!e.preventDefault)
+        e.preventDefault = preventDefault;
+
+    listeners = listeners.slice();
+    for (var i=0; i<listeners.length; i++) {
+        listeners[i](e, this);
+        if (e.propagationStopped)
+            break;
+    }
+    
+    if (defaultHandler && !e.defaultPrevented)
+        return defaultHandler(e, this);
+};
+
+
+EventEmitter._signal = function(eventName, e) {
+    var listeners = (this._eventRegistry || {})[eventName];
+    if (!listeners)
+        return;
+    listeners = listeners.slice();
+    for (var i=0; i<listeners.length; i++)
+        listeners[i](e, this);
+};
+
+EventEmitter.once = function(eventName, callback) {
+    var _self = this;
+    callback && this.addEventListener(eventName, function newCallback() {
+        _self.removeEventListener(eventName, newCallback);
+        callback.apply(null, arguments);
+    });
+};
+
+
+EventEmitter.setDefaultHandler = function(eventName, callback) {
+    var handlers = this._defaultHandlers
+    if (!handlers)
+        handlers = this._defaultHandlers = {_disabled_: {}};
+    
+    if (handlers[eventName]) {
+        var old = handlers[eventName];
+        var disabled = handlers._disabled_[eventName];
+        if (!disabled)
+            handlers._disabled_[eventName] = disabled = [];
+        disabled.push(old);
+        var i = disabled.indexOf(callback);
+        if (i != -1) 
+            disabled.splice(i, 1);
+    }
+    handlers[eventName] = callback;
+};
+EventEmitter.removeDefaultHandler = function(eventName, callback) {
+    var handlers = this._defaultHandlers
+    if (!handlers)
+        return;
+    var disabled = handlers._disabled_[eventName];
+    
+    if (handlers[eventName] == callback) {
+        var old = handlers[eventName];
+        if (disabled)
+            this.setDefaultHandler(eventName, disabled.pop());
+    } else if (disabled) {
+        var i = disabled.indexOf(callback);
+        if (i != -1)
+            disabled.splice(i, 1);
+    }
+};
+
+EventEmitter.on =
+EventEmitter.addEventListener = function(eventName, callback, capturing) {
+    this._eventRegistry = this._eventRegistry || {};
+
+    var listeners = this._eventRegistry[eventName];
+    if (!listeners)
+        listeners = this._eventRegistry[eventName] = [];
+
+    if (listeners.indexOf(callback) == -1)
+        listeners[capturing ? "unshift" : "push"](callback);
+    return callback;
+};
+
+EventEmitter.off =
+EventEmitter.removeListener =
+EventEmitter.removeEventListener = function(eventName, callback) {
+    this._eventRegistry = this._eventRegistry || {};
+
+    var listeners = this._eventRegistry[eventName];
+    if (!listeners)
+        return;
+
+    var index = listeners.indexOf(callback);
+    if (index !== -1)
+        listeners.splice(index, 1);
+};
+
+EventEmitter.removeAllListeners = function(eventName) {
+    if (this._eventRegistry) this._eventRegistry[eventName] = [];
+};
+
+exports.EventEmitter = EventEmitter;
+
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/lib/event_emitter_test.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/lib/event_emitter_test.js b/src/fauxton/assets/js/libs/ace/lib/event_emitter_test.js
new file mode 100644
index 0000000..cc2804e
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/lib/event_emitter_test.js
@@ -0,0 +1,65 @@
+/* ***** 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 ***** */
+
+if (typeof process !== "undefined") {
+    require("amd-loader");
+}
+
+define(function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var EventEmitter = require("./event_emitter").EventEmitter;
+var assert = require("../test/assertions");
+
+var Emitter = function() {};
+
+oop.implement(Emitter.prototype, EventEmitter);
+
+module.exports = {
+    "test: dispatch event with no data" : function() {
+        var emitter = new Emitter();
+
+        var called = false;
+        emitter.addEventListener("juhu", function(e) {
+           called = true;
+           assert.equal(e.type, "juhu");
+        });
+
+        emitter._emit("juhu");
+        assert.ok(called);
+    }
+};
+
+});
+
+if (typeof module !== "undefined" && module === require.main) {
+    require("asyncjs").test.testcase(module.exports).exec()
+}

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/lib/fixoldbrowsers.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/lib/fixoldbrowsers.js b/src/fauxton/assets/js/libs/ace/lib/fixoldbrowsers.js
new file mode 100644
index 0000000..2da9b10
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/lib/fixoldbrowsers.js
@@ -0,0 +1,19 @@
+// vim:set ts=4 sts=4 sw=4 st:
+// -- kriskowal Kris Kowal Copyright (C) 2009-2010 MIT License
+// -- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal Project)
+// -- dantman Daniel Friesen Copyright(C) 2010 XXX No License Specified
+// -- fschaefer Florian Schäfer Copyright (C) 2010 MIT License
+// -- Irakli Gozalishvili Copyright (C) 2010 MIT License
+
+/*!
+    Copyright (c) 2009, 280 North Inc. http://280north.com/
+    MIT License. http://github.com/280north/narwhal/blob/master/README.md
+*/
+
+define(function(require, exports, module) {
+"use strict";
+
+require("./regexp");
+require("./es5-shim");
+
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/lib/keys.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/lib/keys.js b/src/fauxton/assets/js/libs/ace/lib/keys.js
new file mode 100644
index 0000000..42d427b
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/lib/keys.js
@@ -0,0 +1,138 @@
+/*! @license
+==========================================================================
+SproutCore -- JavaScript Application Framework
+copyright 2006-2009, Sprout Systems Inc., Apple Inc. and contributors.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+SproutCore and the SproutCore logo are trademarks of Sprout Systems, Inc.
+
+For more information about SproutCore, visit http://www.sproutcore.com
+
+
+==========================================================================
+@license */
+
+// Most of the following code is taken from SproutCore with a few changes.
+
+define(function(require, exports, module) {
+"use strict";
+
+var oop = require("./oop");
+
+/*
+ * Helper functions and hashes for key handling.
+ */
+var Keys = (function() {
+    var ret = {
+        MODIFIER_KEYS: {
+            16: 'Shift', 17: 'Ctrl', 18: 'Alt', 224: 'Meta'
+        },
+
+        KEY_MODS: {
+            "ctrl": 1, "alt": 2, "option" : 2,
+            "shift": 4, "meta": 8, "command": 8, "cmd": 8
+        },
+
+        FUNCTION_KEYS : {
+            8  : "Backspace",
+            9  : "Tab",
+            13 : "Return",
+            19 : "Pause",
+            27 : "Esc",
+            32 : "Space",
+            33 : "PageUp",
+            34 : "PageDown",
+            35 : "End",
+            36 : "Home",
+            37 : "Left",
+            38 : "Up",
+            39 : "Right",
+            40 : "Down",
+            44 : "Print",
+            45 : "Insert",
+            46 : "Delete",
+            96 : "Numpad0",
+            97 : "Numpad1",
+            98 : "Numpad2",
+            99 : "Numpad3",
+            100: "Numpad4",
+            101: "Numpad5",
+            102: "Numpad6",
+            103: "Numpad7",
+            104: "Numpad8",
+            105: "Numpad9",
+            '-13': "NumpadEnter",
+            112: "F1",
+            113: "F2",
+            114: "F3",
+            115: "F4",
+            116: "F5",
+            117: "F6",
+            118: "F7",
+            119: "F8",
+            120: "F9",
+            121: "F10",
+            122: "F11",
+            123: "F12",
+            144: "Numlock",
+            145: "Scrolllock"
+        },
+
+        PRINTABLE_KEYS: {
+           32: ' ',  48: '0',  49: '1',  50: '2',  51: '3',  52: '4', 53:  '5',
+           54: '6',  55: '7',  56: '8',  57: '9',  59: ';',  61: '=', 65:  'a',
+           66: 'b',  67: 'c',  68: 'd',  69: 'e',  70: 'f',  71: 'g', 72:  'h',
+           73: 'i',  74: 'j',  75: 'k',  76: 'l',  77: 'm',  78: 'n', 79:  'o',
+           80: 'p',  81: 'q',  82: 'r',  83: 's',  84: 't',  85: 'u', 86:  'v',
+           87: 'w',  88: 'x',  89: 'y',  90: 'z', 107: '+', 109: '-', 110: '.',
+          188: ',', 190: '.', 191: '/', 192: '`', 219: '[', 220: '\\',
+          221: ']', 222: '\''
+        }
+    };
+
+    // A reverse map of FUNCTION_KEYS
+    for (var i in ret.FUNCTION_KEYS) {
+        var name = ret.FUNCTION_KEYS[i].toLowerCase();
+        ret[name] = parseInt(i, 10);
+    }
+
+    // Add the MODIFIER_KEYS, FUNCTION_KEYS and PRINTABLE_KEYS to the KEY
+    // variables as well.
+    oop.mixin(ret, ret.MODIFIER_KEYS);
+    oop.mixin(ret, ret.PRINTABLE_KEYS);
+    oop.mixin(ret, ret.FUNCTION_KEYS);
+
+    // aliases
+    ret.enter = ret["return"];
+    ret.escape = ret.esc;
+    ret.del = ret["delete"];
+    
+    // workaround for firefox bug
+    ret[173] = '-';
+
+    return ret;
+})();
+oop.mixin(exports, Keys);
+
+exports.keyCodeToString = function(keyCode) {
+    return (Keys[keyCode] || String.fromCharCode(keyCode)).toLowerCase();
+}
+
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/lib/lang.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/lib/lang.js b/src/fauxton/assets/js/libs/ace/lib/lang.js
new file mode 100644
index 0000000..4e6ebf2
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/lib/lang.js
@@ -0,0 +1,212 @@
+/* ***** 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";
+
+exports.stringReverse = function(string) {
+    return string.split("").reverse().join("");
+};
+
+exports.stringRepeat = function (string, count) {
+    var result = '';
+    while (count > 0) {
+        if (count & 1)
+            result += string;
+
+        if (count >>= 1)
+            string += string;
+    }
+    return result;
+};
+
+var trimBeginRegexp = /^\s\s*/;
+var trimEndRegexp = /\s\s*$/;
+
+exports.stringTrimLeft = function (string) {
+    return string.replace(trimBeginRegexp, '');
+};
+
+exports.stringTrimRight = function (string) {
+    return string.replace(trimEndRegexp, '');
+};
+
+exports.copyObject = function(obj) {
+    var copy = {};
+    for (var key in obj) {
+        copy[key] = obj[key];
+    }
+    return copy;
+};
+
+exports.copyArray = function(array){
+    var copy = [];
+    for (var i=0, l=array.length; i<l; i++) {
+        if (array[i] && typeof array[i] == "object")
+            copy[i] = this.copyObject( array[i] );
+        else 
+            copy[i] = array[i];
+    }
+    return copy;
+};
+
+exports.deepCopy = function (obj) {
+    if (typeof obj != "object") {
+        return obj;
+    }
+    
+    var copy = obj.constructor();
+    for (var key in obj) {
+        if (typeof obj[key] == "object") {
+            copy[key] = this.deepCopy(obj[key]);
+        } else {
+            copy[key] = obj[key];
+        }
+    }
+    return copy;
+};
+
+exports.arrayToMap = function(arr) {
+    var map = {};
+    for (var i=0; i<arr.length; i++) {
+        map[arr[i]] = 1;
+    }
+    return map;
+
+};
+
+exports.createMap = function(props) {
+    var map = Object.create(null);
+    for (var i in props) {
+        map[i] = props[i];
+    }
+    return map;
+};
+
+/*
+ * splice out of 'array' anything that === 'value'
+ */
+exports.arrayRemove = function(array, value) {
+  for (var i = 0; i <= array.length; i++) {
+    if (value === array[i]) {
+      array.splice(i, 1);
+    }
+  }
+};
+
+exports.escapeRegExp = function(str) {
+    return str.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1');
+};
+
+exports.escapeHTML = function(str) {
+    return str.replace(/&/g, "&#38;").replace(/"/g, "&#34;").replace(/'/g, "&#39;").replace(/</g, "&#60;");
+};
+
+exports.getMatchOffsets = function(string, regExp) {
+    var matches = [];
+
+    string.replace(regExp, function(str) {
+        matches.push({
+            offset: arguments[arguments.length-2],
+            length: str.length
+        });
+    });
+
+    return matches;
+};
+
+/* deprecated */
+exports.deferredCall = function(fcn) {
+
+    var timer = null;
+    var callback = function() {
+        timer = null;
+        fcn();
+    };
+
+    var deferred = function(timeout) {
+        deferred.cancel();
+        timer = setTimeout(callback, timeout || 0);
+        return deferred;
+    };
+
+    deferred.schedule = deferred;
+
+    deferred.call = function() {
+        this.cancel();
+        fcn();
+        return deferred;
+    };
+
+    deferred.cancel = function() {
+        clearTimeout(timer);
+        timer = null;
+        return deferred;
+    };
+
+    return deferred;
+};
+
+
+exports.delayedCall = function(fcn, defaultTimeout) {
+    var timer = null;
+    var callback = function() {
+        timer = null;
+        fcn();
+    };
+
+    var _self = function(timeout) {
+        timer && clearTimeout(timer);
+        timer = setTimeout(callback, timeout || defaultTimeout);
+    };
+
+    _self.delay = _self;
+    _self.schedule = function(timeout) {
+        if (timer == null)
+            timer = setTimeout(callback, timeout || 0);
+    };
+
+    _self.call = function() {
+        this.cancel();
+        fcn();
+    };
+
+    _self.cancel = function() {
+        timer && clearTimeout(timer);
+        timer = null;
+    };
+
+    _self.isPending = function() {
+        return timer;
+    };
+
+    return _self;
+};
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/lib/net.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/lib/net.js b/src/fauxton/assets/js/libs/ace/lib/net.js
new file mode 100644
index 0000000..3869da4
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/lib/net.js
@@ -0,0 +1,41 @@
+/*
+ * based on code from:
+ *
+ * @license RequireJS text 0.25.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+define(function(require, exports, module) {
+"use strict";
+var dom = require("./dom");
+
+exports.get = function (url, callback) {
+    var xhr = new XMLHttpRequest();
+    xhr.open('GET', url, true);
+    xhr.onreadystatechange = function () {
+        //Do not explicitly handle errors, those should be
+        //visible via console output in the browser.
+        if (xhr.readyState === 4) {
+            callback(xhr.responseText);
+        }
+    };
+    xhr.send(null);
+};
+
+exports.loadScript = function(path, callback) {
+    var head = dom.getDocumentHead();
+    var s = document.createElement('script');
+
+    s.src = path;
+    head.appendChild(s);
+
+    s.onload = s.onreadystatechange = function(_, isAbort) {
+        if (isAbort || !s.readyState || s.readyState == "loaded" || s.readyState == "complete") {
+            s = s.onload = s.onreadystatechange = null;
+            if (!isAbort)
+                callback();
+        }
+    };
+};
+
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/lib/oop.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/lib/oop.js b/src/fauxton/assets/js/libs/ace/lib/oop.js
new file mode 100644
index 0000000..f3dbb1d
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/lib/oop.js
@@ -0,0 +1,55 @@
+/* ***** 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";
+
+exports.inherits = (function() {
+    var tempCtor = function() {};
+    return function(ctor, superCtor) {
+        tempCtor.prototype = superCtor.prototype;
+        ctor.super_ = superCtor.prototype;
+        ctor.prototype = new tempCtor();
+        ctor.prototype.constructor = ctor;
+    };
+}());
+
+exports.mixin = function(obj, mixin) {
+    for (var key in mixin) {
+        obj[key] = mixin[key];
+    }
+    return obj;
+};
+
+exports.implement = function(proto, mixin) {
+    exports.mixin(proto, mixin);
+};
+
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/lib/regexp.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/lib/regexp.js b/src/fauxton/assets/js/libs/ace/lib/regexp.js
new file mode 100644
index 0000000..369f74f
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/lib/regexp.js
@@ -0,0 +1,113 @@
+/*
+ *  Based on code from:
+ *
+ * XRegExp 1.5.0
+ * (c) 2007-2010 Steven Levithan
+ * MIT License
+ * <http://xregexp.com>
+ * Provides an augmented, extensible, cross-browser implementation of regular expressions,
+ * including support for additional syntax, flags, and methods
+ */
+ 
+define(function(require, exports, module) {
+"use strict";
+
+    //---------------------------------
+    //  Private variables
+    //---------------------------------
+
+    var real = {
+            exec: RegExp.prototype.exec,
+            test: RegExp.prototype.test,
+            match: String.prototype.match,
+            replace: String.prototype.replace,
+            split: String.prototype.split
+        },
+        compliantExecNpcg = real.exec.call(/()??/, "")[1] === undefined, // check `exec` handling of nonparticipating capturing groups
+        compliantLastIndexIncrement = function () {
+            var x = /^/g;
+            real.test.call(x, "");
+            return !x.lastIndex;
+        }();
+
+    if (compliantLastIndexIncrement && compliantExecNpcg)
+        return;
+
+    //---------------------------------
+    //  Overriden native methods
+    //---------------------------------
+
+    // Adds named capture support (with backreferences returned as `result.name`), and fixes two
+    // cross-browser issues per ES3:
+    // - Captured values for nonparticipating capturing groups should be returned as `undefined`,
+    //   rather than the empty string.
+    // - `lastIndex` should not be incremented after zero-length matches.
+    RegExp.prototype.exec = function (str) {
+        var match = real.exec.apply(this, arguments),
+            name, r2;
+        if ( typeof(str) == 'string' && match) {
+            // Fix browsers whose `exec` methods don't consistently return `undefined` for
+            // nonparticipating capturing groups
+            if (!compliantExecNpcg && match.length > 1 && indexOf(match, "") > -1) {
+                r2 = RegExp(this.source, real.replace.call(getNativeFlags(this), "g", ""));
+                // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed
+                // matching due to characters outside the match
+                real.replace.call(str.slice(match.index), r2, function () {
+                    for (var i = 1; i < arguments.length - 2; i++) {
+                        if (arguments[i] === undefined)
+                            match[i] = undefined;
+                    }
+                });
+            }
+            // Attach named capture properties
+            if (this._xregexp && this._xregexp.captureNames) {
+                for (var i = 1; i < match.length; i++) {
+                    name = this._xregexp.captureNames[i - 1];
+                    if (name)
+                       match[name] = match[i];
+                }
+            }
+            // Fix browsers that increment `lastIndex` after zero-length matches
+            if (!compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index))
+                this.lastIndex--;
+        }
+        return match;
+    };
+
+    // Don't override `test` if it won't change anything
+    if (!compliantLastIndexIncrement) {
+        // Fix browser bug in native method
+        RegExp.prototype.test = function (str) {
+            // Use the native `exec` to skip some processing overhead, even though the overriden
+            // `exec` would take care of the `lastIndex` fix
+            var match = real.exec.call(this, str);
+            // Fix browsers that increment `lastIndex` after zero-length matches
+            if (match && this.global && !match[0].length && (this.lastIndex > match.index))
+                this.lastIndex--;
+            return !!match;
+        };
+    }
+
+    //---------------------------------
+    //  Private helper functions
+    //---------------------------------
+
+    function getNativeFlags (regex) {
+        return (regex.global     ? "g" : "") +
+               (regex.ignoreCase ? "i" : "") +
+               (regex.multiline  ? "m" : "") +
+               (regex.extended   ? "x" : "") + // Proposed for ES4; included in AS3
+               (regex.sticky     ? "y" : "");
+    }
+
+    function indexOf (array, item, from) {
+        if (Array.prototype.indexOf) // Use the native array method if available
+            return array.indexOf(item, from);
+        for (var i = from || 0; i < array.length; i++) {
+            if (array[i] === item)
+                return i;
+        }
+        return -1;
+    }
+
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/lib/useragent.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/lib/useragent.js b/src/fauxton/assets/js/libs/ace/lib/useragent.js
new file mode 100644
index 0000000..b6989a8
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/lib/useragent.js
@@ -0,0 +1,103 @@
+/* ***** 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";
+
+/*
+ * I hate doing this, but we need some way to determine if the user is on a Mac
+ * The reason is that users have different expectations of their key combinations.
+ *
+ * Take copy as an example, Mac people expect to use CMD or APPLE + C
+ * Windows folks expect to use CTRL + C
+ */
+exports.OS = {
+    LINUX: "LINUX",
+    MAC: "MAC",
+    WINDOWS: "WINDOWS"
+};
+
+/*
+ * Return an exports.OS constant
+ */
+exports.getOS = function() {
+    if (exports.isMac) {
+        return exports.OS.MAC;
+    } else if (exports.isLinux) {
+        return exports.OS.LINUX;
+    } else {
+        return exports.OS.WINDOWS;
+    }
+};
+
+// this can be called in non browser environments (e.g. from ace/requirejs/text)
+if (typeof navigator != "object")
+    return;
+
+var os = (navigator.platform.match(/mac|win|linux/i) || ["other"])[0].toLowerCase();
+var ua = navigator.userAgent;
+
+// Is the user using a browser that identifies itself as Windows
+exports.isWin = (os == "win");
+
+// Is the user using a browser that identifies itself as Mac OS
+exports.isMac = (os == "mac");
+
+// Is the user using a browser that identifies itself as Linux
+exports.isLinux = (os == "linux");
+
+// Windows Store JavaScript apps (aka Metro apps written in HTML5 and JavaScript) do not use the "Microsoft Internet Explorer" string in their user agent, but "MSAppHost" instead.
+exports.isIE = 
+    (navigator.appName == "Microsoft Internet Explorer" || navigator.appName.indexOf("MSAppHost") >= 0)
+    && parseFloat(navigator.userAgent.match(/MSIE ([0-9]+[\.0-9]+)/)[1]);
+    
+exports.isOldIE = exports.isIE && exports.isIE < 9;
+
+// Is this Firefox or related?
+exports.isGecko = exports.isMozilla = window.controllers && window.navigator.product === "Gecko";
+
+// oldGecko == rev < 2.0 
+exports.isOldGecko = exports.isGecko && parseInt((navigator.userAgent.match(/rv\:(\d+)/)||[])[1], 10) < 4;
+
+// Is this Opera 
+exports.isOpera = window.opera && Object.prototype.toString.call(window.opera) == "[object Opera]";
+
+// Is the user using a browser that identifies itself as WebKit 
+exports.isWebKit = parseFloat(ua.split("WebKit/")[1]) || undefined;
+
+exports.isChrome = parseFloat(ua.split(" Chrome/")[1]) || undefined;
+
+exports.isAIR = ua.indexOf("AdobeAIR") >= 0;
+
+exports.isIPad = ua.indexOf("iPad") >= 0;
+
+exports.isTouchPad = ua.indexOf("TouchPad") >= 0;
+
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/_test/Readme.md
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/_test/Readme.md b/src/fauxton/assets/js/libs/ace/mode/_test/Readme.md
new file mode 100644
index 0000000..c2871c0
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/_test/Readme.md
@@ -0,0 +1,9 @@
+`tokens_<modeName>.json` files keep information about correct tokens and tokenizer states for all modes supported by ace.
+They are generated from `text_<modeName>.txt` or `demo/kitchen-sink/doc/*` with
+
+```sh
+node highlight_rules_test.js -gen
+```
+
+command.
+

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/_test/highlight_rules_test.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/_test/highlight_rules_test.js b/src/fauxton/assets/js/libs/ace/mode/_test/highlight_rules_test.js
new file mode 100644
index 0000000..be6656d
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/_test/highlight_rules_test.js
@@ -0,0 +1,152 @@
+var fs = require("fs");
+if (!fs.existsSync)
+    fs.existsSync = require("path").existsSync;
+
+require("amd-loader");
+
+var cwd = __dirname + "/";
+
+function generateTestData() {
+    var root = Array(5).join("../") + "/demo/kitchen-sink/docs";
+    var docs = fs.readdirSync(cwd + root);
+    var specialDocs = fs.readdirSync(cwd);
+    var modes = fs.readdirSync(cwd + "../").filter(function(x){
+        return !/(_highlight_rules|behaviour|worker)\.js$/.test(x) && /\.js$/.test(x);
+    }).map(function(x) {
+        return x.replace(/\.js$/, "");
+    });
+
+    console.log("Docs:", docs);
+    console.log("Modes:", modes);
+
+    docs.forEach(function(docName) {
+        var p = docName.toLowerCase().split(".");
+        if (!p[1])
+            return;
+        var modeName;
+        if (modes.indexOf(p[0]) != -1)
+            modeName = p[0];
+        else if (modes.indexOf(p[1]) != -1)
+            modeName = p[1];
+        else
+            modeName = {"txt": "text", cpp: "c_cpp"}[p[1]];
+
+        var filePath = "text_" + modeName + ".txt";
+        if (specialDocs.indexOf(filePath) == -1) {
+            filePath = root + "/" + docName;
+        }
+
+        var text = fs.readFileSync(cwd + filePath, "utf8");
+        try {
+            var Mode = require("../" + modeName).Mode;
+        } catch(e) {
+            console.warn("Can't load mode :" + modeName, p, e);
+            return;
+        }
+        var tokenizer = new Mode().getTokenizer();
+
+        var state = "start";
+        var data = text.split(/\n|\r|\r\n/).map(function(line) {
+            var data = tokenizer.getLineTokens(line, state);
+            var tmp = [];
+            tmp.push(JSON.stringify(data.state));
+            data.tokens.forEach(function(x) {
+                tmp.push(JSON.stringify([x.type, x.value]));
+            });
+            state = data.state;
+            return tmp.join(",\n  ");
+        });
+        
+        jsonStr = "[[\n   " + data.join("\n],[\n   ") + "\n]]";
+        fs.writeFileSync(cwd + "tokens_" + modeName + ".json", jsonStr, "utf8");
+    });
+}
+
+function test(startAt) {
+    var modes = fs.readdirSync(cwd).map(function(x) {
+        return (x.match(/tokens_(.*).json/) || {})[1];
+    }).filter(function(x){return !!x});
+
+    for (var i = Math.max(0, startAt||0); i < modes.length; i++)
+        testMode(modes[i], i);
+
+    console.log("\u001b[32m" + "all ok" + "\u001b[0m");
+}
+function testMode(modeName, i) {
+    console.log(padNumber(i+1, 3) + ") testing: \u001b[33m" + modeName + "\u001b[0m");
+
+    var text = fs.readFileSync(cwd + "tokens_" + modeName + ".json", "utf8");
+    var data = JSON.parse(text);
+    var Mode = require("../" + modeName).Mode;
+    var tokenizer = new Mode().getTokenizer();
+
+    var state = "start";
+    data.forEach(function(lineData) {
+        lineData.values = [];
+        lineData.types = [];
+        lineData.state = lineData.shift();
+        lineData.forEach(function(x) {
+            lineData.types.push(x[0]);
+            lineData.values.push(x[1]);
+        });
+
+        var line = lineData.values.join("");
+
+        var tokens = tokenizer.getLineTokens(line, state);
+        var values = tokens.tokens.map(function(x) {return x.value;});
+        var types = tokens.tokens.map(function(x) {return x.type;});
+
+        var success = true;
+        var err = testEqual([
+            lineData.state, tokens.state,
+            lineData.types, types,
+            lineData.values, values]);
+        
+        if (err) {
+            console.log(line)
+            throw "error";
+        }
+
+        state = lineData.state;
+    });
+}
+function testEqual(a) {
+    var err;
+    if (a[0] + "" !== a[1] + "") {
+        console.log(a[0],a[1]);
+        err = 1;
+    }
+
+    if ( a[2] + "" !== a[3] + "" || a[4] + "" !== a[5] + "") {
+        arrayDiff(a[2],a[3]);
+        arrayDiff(a[4],a[5]);
+        err = 1;
+    }
+    return err;
+}
+function arrayDiff(a1, a2) {
+    var l = Math.max(a1.length, a2.length);
+    var out = [];
+    for (var i = 0; i < l; i++) {
+        out.push("\n", padNumber(i+1, 3), ") ");
+        if (a1[i] !== a2[i])
+            out.push("\u001b[31m", a1[i], "\u001b[0m != \u001b[32m", a2[i], "\u001b[0m");
+        else
+            out.push(a1[i]);
+    }
+    console.log(out.join(""));
+}
+function padNumber(num, digits) {
+    return ("      " + num).slice(-digits);
+}
+
+// cli
+var arg = process.argv[2];
+if (!arg)
+    test()
+else if (/--?g(en)?/.test(arg))
+    generateTestData(process.argv.splice(3));
+else if (/\d+/.test(arg))
+    test(parseInt(process.argv[2],10) || 0);
+else
+    testMode(arg, -1)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/_test/package.json
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/_test/package.json b/src/fauxton/assets/js/libs/ace/mode/_test/package.json
new file mode 100644
index 0000000..3fdc706
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/_test/package.json
@@ -0,0 +1,8 @@
+{
+    "name": "ace-mode-creator",
+    "version": "0.1.0",
+    "dependencies": {
+        "connect": "",
+        "socket.io": ""
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/_test/text_asciidoc.txt
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/_test/text_asciidoc.txt b/src/fauxton/assets/js/libs/ace/mode/_test/text_asciidoc.txt
new file mode 100644
index 0000000..af7eaec
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/_test/text_asciidoc.txt
@@ -0,0 +1,111 @@
+------------------------------------
+-----------------------------------
+_ita_lic_, *bo*ld*, +mo+no+, normal. 
+``double quoted'', `single quoted'.
+  normal, ^super^, ~sub~.
+
+''''
+Escaped:
+\_italic_, +++_italic_+++,
+t\__e__st, +++t__e__st+++,
++++<b>bold</b>+++, $$<b>normal</b>$$
+\&#182; &#182;
+\`not single quoted'
+\`\`not double quoted''
+
+
+[fffff]
++++++++++++++++++++++++++++++++++++++
+(C) {ss} ss
++++++++++++++++++++++++++++++++++++++
+
+.............
+callout <1>
+..............
+
+> 1
+1> 2
+<2> 3
+
+Escaped:
+\_italic_,
+t\__e__st, o__
+
+.optional title
+.............
+callout <1>
+..............
+
+
+:macro: dddd
+
+.lists
+. 1
+.. 2
+... d
+..... big
++
+continue +
+next line
+xi) no ++la+tin++
+
+xi) la++tin++
+2. num__ber__  [red]#red#
+--
+  5. f <<x6,ssss>> {macro}
+--
+image::path[beauty] ->--<= -- replacements
+
+ image::s
+sssss
+sss 
+sssss
+
+
+== 1
+  heading
+=== not a heading
+====================================
+
+==================================
+====4 
+NOTE: above
+
+NOTE: above
+
+[[x6]]
+WARNING: 
+
+[options[]]
+---------------------------
+literal
+---------------------------
+
+
+= Tables
+|====================================
+| _italic_ |  *bold* | text | (R)
+
+|====================================
+
+
+[more, options]
+///////////
+comment
+///////////
+// one line comment
+
+
+
+[red]#red text# [yellow-background]#on yellow#
+[big]#large# [red yellow-background big]*all bold*
+
+	
+https://site text <ma...@i.am> callto:ace http://ace.ajaxorg.com[awesome]
+  .still normal text
+.break out thoug should not
+---------------------------
+///////////////////////////
+---------------------------
+
+

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/_test/text_coffee.txt
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/_test/text_coffee.txt b/src/fauxton/assets/js/libs/ace/mode/_test/text_coffee.txt
new file mode 100644
index 0000000..094e61b
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/_test/text_coffee.txt
@@ -0,0 +1,56 @@
+#test: tokenize keyword
+    for (i 1..2)
+#test: tokenize regexp
+/"[a]/
+#test: tokenize functions
+foo = ({args}) ->
+    foo = ({a1, a2}) ->
+    foo = ({@a1, a2}) ->
+    foo : ({args}) ->
+    foo = ({args}) ->
+    foo = ({0abc}) ->
+    foo = ({/abc}) =>
+    foo = ({abc/}) ->
+    foo = ({#abc}) ->
+    foo = ({abc#}) ->
+    foo = ({)abc}) ->
+    foo = ({abc)}) ->
+    foo = ({a{bc}) ->
+    foo = ({}) ->
+    foo = ({ }) ->
+    foo : ({}) ->
+    foo = (args) ->
+    foo = (arg1, arg2) ->
+    foo = (arg1 = 1, arg2 = 'name') ->
+    foo = (@arg1 = /abc/, arg2 = 'name') ->
+    #test: tokenize function: invalid case:
+    foo=(/args) ->
+    foo = () ->
+    foo = ( ) ->
+    foo : ( ) ->
+    window.foo = (args) ->
+    foo = ->
+    foo = ->
+    foo : ->
+    #test: tokenize callback function
+    foo bar: 1, (args) ->
+    foo = (1, 2 (x) ->
+#test: tokenize class
+class Foo
+class Foo extends Bar
+#test: tokenize illegal name property
+foo.static.function
+#!test tokenize string with interpolation
+a = "#{ 22 / 7 + {x: "#{a + b}"} + 2}"
+"""heredoc
+   """
+do ->
+    ###
+    herecomment
+    ###
+    re = /regex/imgy.test ///
+        heregex  # comment
+    ///imgy
+    this isnt: `just 
+       JavaScript`
+    undefined

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/_test/text_curly.txt
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/_test/text_curly.txt b/src/fauxton/assets/js/libs/ace/mode/_test/text_curly.txt
new file mode 100644
index 0000000..1be54b5
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/_test/text_curly.txt
@@ -0,0 +1,9 @@
+tokenize Curly template{{test}}
+tokenize embedded script
+<script a='a'>var</script>'123'
+tokenize multiline attribute value with double quotes
+<a href="abc{{xyz}}
+def">
+tokenize multiline attribute value with single quotes
+<a href='abc
+def\"'>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/_test/text_html.txt
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/_test/text_html.txt b/src/fauxton/assets/js/libs/ace/mode/_test/text_html.txt
new file mode 100644
index 0000000..64a32cb
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/_test/text_html.txt
@@ -0,0 +1,8 @@
+<html>
+<script a='a'>var</script>'123'
+<a href="abc
+  def">
+<a href='abc
+def\'>
+
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/_test/text_javascript.txt
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/_test/text_javascript.txt b/src/fauxton/assets/js/libs/ace/mode/_test/text_javascript.txt
new file mode 100644
index 0000000..6e18079
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/_test/text_javascript.txt
@@ -0,0 +1,86 @@
+//test: tokenize 'standard' functions
+string.charCodeAt(23); document.getElementById('test'); console.log('Here it is');";
+test: /**tokenize doc*/ comment
+/**tokenize doc comment with @tag {}*/
+//test: tokenize parens
+    var line = "[{( )}]";
+//test tokenize arithmetic expression which looks like a regexp
+a/b/c
+a/=b/c
+//test tokenize reg exps
+a=/b/g
+a+/b/g
+a = 1 + /2 + 1/b
+a=/a/ / /a/
+case /a/.test(c)
+//test tokenize multi-line comment containing a single line comment
+noRegex
+/* foo // bar */
+canBeRegex;
+/* foo // bar */
+// test tokenize identifier with umlauts
+fu?e
+// test // is not a regexp
+{ // 123
+//test skipping escaped chars
+'Meh\\nNeh'
+console.log('\\u1232Feh'
+"test multiline\
+ strings"
+a='
+b="\
+still a string
+ 
+ 
+function foo(items, nada) {
+    for (var i=0; i<items.length; i++) {
+        alert(items[i] + "juhu\n");
+    }	// Real Tab.
+}
+
+regexp = /p|p/ // ends here
+
+r = /d{1,2}?f{e}++r*?\d+?[]r[^r-o\f\f[\f]?r{7}+r\{7}+rr--rr$^(?:d|s)(?=a|)(?!y)[]|$?|^*/ o
+a=/a/ jk = / / / / /
+ /************************************/
+/** total mess, tricky to highlight**/
+
+function () {
+	/**
+	 * docComment
+	 **/
+	r = /u\t*/
+	g = 1.00E^1, y = 1.2 + .2 + 052 + 0x25
+	t = ['d', '']
+}
+function () {
+	/* eee */
+}
+
+"s\
+s\u7824sss\u1"
+
+'\
+string'
+
+'
+string'
+
+"trailing space\   
+"         "    /not a regexp/g
+
+/**
+ *doc
+ */
+
+a = {
+	'a': b,
+	'g': function(t)
+	gta:function(a,b)
+}
+
+
+foo.protoype.d = function(a, b,
+                          c, d)
+foo.d =function(a,     b)
+foo.d =function(a,  /*****/ d"string"   

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/_test/text_livescript.txt
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/_test/text_livescript.txt b/src/fauxton/assets/js/libs/ace/mode/_test/text_livescript.txt
new file mode 100644
index 0000000..308ec1d
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/_test/text_livescript.txt
@@ -0,0 +1 @@
+# comment

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/_test/text_lucene.txt
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/_test/text_lucene.txt b/src/fauxton/assets/js/libs/ace/mode/_test/text_lucene.txt
new file mode 100644
index 0000000..c71f268
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/_test/text_lucene.txt
@@ -0,0 +1,16 @@
+test: recognises AND as keyword
+test: recognises OR as keyword
+test: recognises NOT as keyword
+test: recognises "hello this is dog" as string
+test: recognises -"hello this is dog" as negation with string
+test: recognises ~100 as text with proximity
+test: recognises "hello this is dog"~100 as string with proximity
+test: recognises raw:"hello this is dog" as keyword
+test: recognises raw:foo as"keyword'
+test: recognises "(" as opening parenthesis
+test: recognises ")" as closing parenthesis
+test: recognises foo* as text with asterisk
+test: recognises foo? as text with interro
+test: recognises single word as text
+ foo
+ 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/_test/text_markdown.txt
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/_test/text_markdown.txt b/src/fauxton/assets/js/libs/ace/mode/_test/text_markdown.txt
new file mode 100644
index 0000000..0450c82
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/_test/text_markdown.txt
@@ -0,0 +1,22 @@
+test: header 1 
+#f
+test: header 2
+## foo
+test: header ends with ' #'
+# # # 
+test: header ends with '#'
+#foo# 
+test: 6+ #s is not a valid header
+####### foo
+test: # followed be only space is not a valid header
+# 
+test: only space between #s is not a valid header
+#  #
+
+# test links  [Cloud9 IDE](http://www.c9.io/) #
+* [demo](http://ajaxorg.github.com/ace/) [+](escape(\) ) [+](a "title") [+](a "space" )
+* usually *work* fine (_em_)
+in lists
+
+in plain text <b>http://ace.ajaxorg.com<b>
+

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/_test/text_ruby.txt
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/_test/text_ruby.txt b/src/fauxton/assets/js/libs/ace/mode/_test/text_ruby.txt
new file mode 100644
index 0000000..1343a27
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/_test/text_ruby.txt
@@ -0,0 +1,34 @@
+ #test: symbol tokenizer
+  [:@thing, :$thing, :_thing, :thing, :Thing, :thing1, :thing_a,
+              :THING, :thing!, :thing=, :thing?, :t?,
+              :, :@, :$, :1, :1thing, :th?ing, :thi=ng, :1thing,
+            :th!ing, :thing#
+    ]
+
+ #test: namespaces aren't symbols" : function() {
+   Namespaced::Class
+ #test: hex tokenizer 
+    0x9a, 0XA1, 0x9_a, 0x, 0x_9a, 0x9a_,
+ #test: float tokenizer
+    [1, +1, -1, 12_345, 0.000_1,
+    _, 3_1, 1_2, 1_.0, 0._1];
+ 
+{:id => 34, :key => "value"}
+
+=begin
+=end
+
+=begin x
+=end-
+=end   x
+
+    herDocs = [<<'FOO', <<BAR, <<-BAZ, <<-`EXEC`] #comment
+  FOO #{literal}
+FOO
+  BAR #{fact(10)}
+BAR
+  BAZ indented
+    BAZ
+        echo hi
+    EXEC
+puts herDocs
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/_test/text_xml.txt
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/_test/text_xml.txt b/src/fauxton/assets/js/libs/ace/mode/_test/text_xml.txt
new file mode 100644
index 0000000..01f7b8a
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/_test/text_xml.txt
@@ -0,0 +1,7 @@
+<Juhu>//Juhu Kinners</Kinners>
+test: two tags in the same lines should be in separate tokens"
+<Juhu><Kinners>
+test: multiline attributes"
+<copy set="{
+}" undo="{
+}"/>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/_test/tokens_abap.json
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/_test/tokens_abap.json b/src/fauxton/assets/js/libs/ace/mode/_test/tokens_abap.json
new file mode 100644
index 0000000..95f2f81
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/_test/tokens_abap.json
@@ -0,0 +1,189 @@
+[[
+   "start",
+  ["doc.comment","***************************************"]
+],[
+   "start",
+  ["doc.comment","** Program: EXAMPLE                  **"]
+],[
+   "start",
+  ["doc.comment","** Author: Joe Byte, 07-Jul-2007     **"]
+],[
+   "start",
+  ["doc.comment","***************************************"]
+],[
+   "start",
+  ["text"," "]
+],[
+   "start",
+  ["keyword","REPORT"],
+  ["text"," BOOKINGS"],
+  ["keyword.operator","."]
+],[
+   "start",
+  ["text"," "]
+],[
+   "start",
+  ["doc.comment","* Read flight bookings from the database"]
+],[
+   "start",
+  ["keyword","SELECT"],
+  ["keyword.operator"," * "],
+  ["keyword","FROM"],
+  ["text"," FLIGHTINFO"]
+],[
+   "start",
+  ["text","  "],
+  ["keyword","WHERE"],
+  ["text"," "],
+  ["keyword","CLASS"],
+  ["keyword.operator"," = "],
+  ["string","'Y'"],
+  ["text","       "],
+  ["comment","\"Y = economy"]
+],[
+   "start",
+  ["text","  "],
+  ["keyword","OR"],
+  ["text","    "],
+  ["keyword","CLASS"],
+  ["keyword.operator"," = "],
+  ["string","'C'"],
+  ["keyword.operator","."],
+  ["text","      "],
+  ["comment","\"C = business"]
+],[
+   "start",
+  ["paren.lparen","("],
+  ["invalid","..."],
+  ["paren.rparen",")"]
+],[
+   "start"
+],[
+   "start",
+  ["keyword","REPORT"],
+  ["text"," TEST"],
+  ["keyword.operator","."]
+],[
+   "start",
+  ["keyword","WRITE"],
+  ["text"," "],
+  ["string","'Hello World'"],
+  ["keyword.operator","."]
+],[
+   "start"
+],[
+   "start",
+  ["text","USERPROMPT"],
+  ["keyword.operator"," = "],
+  ["string","'Please double-click on a line in the output list '"],
+  ["text"," "],
+  ["keyword.operator","&"]
+],[
+   "start",
+  ["text","             "],
+  ["string","'to see the complete details of the transaction.'"],
+  ["keyword.operator","."]
+],[
+   "start"
+],[
+   "start"
+],[
+   "start",
+  ["keyword","DATA"],
+  ["text"," LAST_EOM    "],
+  ["keyword","TYPE"],
+  ["text"," "],
+  ["support.type","D"],
+  ["keyword.operator","."],
+  ["text","  "],
+  ["comment","\"last end-of-month date"]
+],[
+   "start",
+  ["text"," "]
+],[
+   "start",
+  ["doc.comment","* Start from today's date"]
+],[
+   "start",
+  ["text","  LAST_EOM"],
+  ["keyword.operator"," = "],
+  ["variable.parameter","SY"],
+  ["keyword.operator","-"],
+  ["text","DATUM"],
+  ["keyword.operator","."]
+],[
+   "start",
+  ["doc.comment","* Set characters 6 and 7 (0-relative) of the YYYYMMDD string to \"01\","]
+],[
+   "start",
+  ["doc.comment","* giving the first day of the current month"]
+],[
+   "start",
+  ["text","  LAST_EOM"],
+  ["constant.numeric","+6"],
+  ["paren.lparen","("],
+  ["constant.numeric","2"],
+  ["paren.rparen",")"],
+  ["keyword.operator"," = "],
+  ["string","'01'"],
+  ["keyword.operator","."]
+],[
+   "start",
+  ["doc.comment","* Subtract one day"]
+],[
+   "start",
+  ["text","  LAST_EOM"],
+  ["keyword.operator"," = "],
+  ["text","LAST_EOM"],
+  ["keyword.operator"," - "],
+  ["constant.numeric","1"],
+  ["keyword.operator","."]
+],[
+   "start",
+  ["text"," "]
+],[
+   "start",
+  ["text","  "],
+  ["keyword","WRITE"],
+  ["keyword.operator",":"],
+  ["text"," "],
+  ["string","'Last day of previous month was'"],
+  ["keyword.operator",","],
+  ["text"," LAST_EOM"],
+  ["keyword.operator","."]
+],[
+   "start",
+  ["text","  "]
+],[
+   "start",
+  ["keyword","DATA"],
+  ["text"," "],
+  ["keyword.operator",":"],
+  ["text"," "],
+  ["keyword","BEGIN OF"],
+  ["text"," I_VBRK "],
+  ["keyword","OCCURS"],
+  ["text"," "],
+  ["constant.numeric","0"],
+  ["keyword.operator",","]
+],[
+   "start",
+  ["text","         VBELN "],
+  ["keyword","LIKE"],
+  ["text"," "],
+  ["variable.parameter","VBRK-VBELN"],
+  ["keyword.operator",","]
+],[
+   "start",
+  ["text","         ZUONR "],
+  ["keyword","LIKE"],
+  ["text"," "],
+  ["variable.parameter","VBRK-ZUONR"],
+  ["keyword.operator",","]
+],[
+   "start",
+  ["text","       "],
+  ["keyword","END OF"],
+  ["text"," I_VBRK"],
+  ["keyword.operator","."]
+]]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/_test/tokens_actionscript.json
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/_test/tokens_actionscript.json b/src/fauxton/assets/js/libs/ace/mode/_test/tokens_actionscript.json
new file mode 100644
index 0000000..e3fad38
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/_test/tokens_actionscript.json
@@ -0,0 +1,263 @@
+[[
+   "start",
+  ["text","package code"]
+],[
+   "start",
+  ["text","{"]
+],[
+   "punctuation.definition.comment.actionscript.2",
+  ["text","    "],
+  ["punctuation.definition.comment.actionscript.2","/*"],
+  ["comment.block.actionscript.2","****************************************"]
+],[
+   "punctuation.definition.comment.actionscript.2",
+  ["comment.block.actionscript.2","\t * based on textmate actionscript bundle"]
+],[
+   "start",
+  ["comment.block.actionscript.2","\t ***************************************"],
+  ["punctuation.definition.comment.actionscript.2","*/"]
+],[
+   "start",
+  ["text","\t "]
+],[
+   "start",
+  ["text","\t"],
+  ["keyword.control.actionscript.2","import"],
+  ["text"," fl.events.SliderEvent;"]
+],[
+   "start",
+  ["text","\t"]
+],[
+   "start",
+  ["text","\t"],
+  ["keyword.control.actionscript.2","public"],
+  ["text"," "],
+  ["storage.type.class.actionscript.2","class"],
+  ["meta.class.actionscript.2"," "],
+  ["entity.name.type.class.actionscript.2","Foo"],
+  ["meta.class.actionscript.2"," "],
+  ["storage.modifier.extends.actionscript.2","extends"],
+  ["meta.class.actionscript.2"," "],
+  ["entity.other.inherited-class.actionscript.2","MovieClip"]
+],[
+   "start",
+  ["text","\t{"]
+],[
+   "start",
+  ["text","\t\t"],
+  ["punctuation.definition.comment.actionscript.2","//*************************"]
+],[
+   "start",
+  ["text","\t\t"],
+  ["punctuation.definition.comment.actionscript.2","// Properties:"]
+],[
+   "start",
+  ["text","\t\t"]
+],[
+   "start",
+  ["text","\t\t"],
+  ["keyword.control.actionscript.2","public"],
+  ["text"," "],
+  ["keyword.control.actionscript.2","var"],
+  ["text"," activeSwatch"],
+  ["keyword.operator.symbolic.actionscript.2",":"],
+  ["support.class.actionscript.2","MovieClip"],
+  ["text",";"]
+],[
+   "start",
+  ["text","\t\t"]
+],[
+   "start",
+  ["text","\t\t"],
+  ["punctuation.definition.comment.actionscript.2","// Color offsets"]
+],[
+   "start",
+  ["text","\t\t"],
+  ["keyword.control.actionscript.2","public"],
+  ["text"," "],
+  ["keyword.control.actionscript.2","var"],
+  ["text"," c1"],
+  ["keyword.operator.symbolic.actionscript.2",":"],
+  ["storage.type.actionscript.2","Number"],
+  ["text"," "],
+  ["keyword.operator.symbolic.actionscript.2","="],
+  ["text"," "],
+  ["constant.numeric.actionscript.2","0"],
+  ["text",";\t"],
+  ["punctuation.definition.comment.actionscript.2","// R"]
+],[
+   "start",
+  ["text","\t\t"]
+],[
+   "start",
+  ["text","\t\t"],
+  ["punctuation.definition.comment.actionscript.2","//*************************"]
+],[
+   "start",
+  ["text","\t\t"],
+  ["punctuation.definition.comment.actionscript.2","// Constructor:"]
+],[
+   "start",
+  ["text","\t\t"]
+],[
+   "start",
+  ["text","\t\t"],
+  ["keyword.control.actionscript.2","public"],
+  ["text"," "],
+  ["storage.type.function.actionscript.2","function"],
+  ["meta.function.actionscript.2"," "],
+  ["entity.name.function.actionscript.2","Foo"],
+  ["punctuation.definition.parameters.begin.actionscript.2","("],
+  ["punctuation.definition.parameters.end.actionscript.2",")"]
+],[
+   "start",
+  ["text","\t\t{"]
+],[
+   "start",
+  ["text","\t\t\t"],
+  ["punctuation.definition.comment.actionscript.2","// Respond to mouse events"]
+],[
+   "start",
+  ["text","\t\t\tswatch1_btn."],
+  ["support.function.actionscript.2","addEventListener"],
+  ["text","(MouseEvent.CLICK,swatchHandler,"],
+  ["constant.language.actionscript.2","false"],
+  ["text",","],
+  ["constant.numeric.actionscript.2","0"],
+  ["text",","],
+  ["constant.language.actionscript.2","false"],
+  ["text",");"]
+],[
+   "start",
+  ["text","\t\t\tpreviewBox_btn."],
+  ["support.function.actionscript.2","addEventListener"],
+  ["text","(MouseEvent.MOUSE_DOWN,dragPressHandler);"]
+],[
+   "start",
+  ["text","\t\t\t"]
+],[
+   "start",
+  ["text","\t\t\t"],
+  ["punctuation.definition.comment.actionscript.2","// Respond to drag events"]
+],[
+   "start",
+  ["text","\t\t\tred_slider."],
+  ["support.function.actionscript.2","addEventListener"],
+  ["text","(SliderEvent.THUMB_DRAG,sliderHandler);"]
+],[
+   "start",
+  ["text","\t\t\t"]
+],[
+   "start",
+  ["text","\t\t\t"],
+  ["punctuation.definition.comment.actionscript.2","// Draw a frame later"]
+],[
+   "start",
+  ["text","\t\t\t"],
+  ["support.function.actionscript.2","addEventListener"],
+  ["text","(Event.ENTER_FRAME,"],
+  ["support.function.actionscript.2","draw"],
+  ["text",");"]
+],[
+   "start",
+  ["text","\t\t}"]
+],[
+   "start",
+  ["text","        "]
+],[
+   "start",
+  ["text","\t\tprotected "],
+  ["storage.type.function.actionscript.2","function"],
+  ["meta.function.actionscript.2"," "],
+  ["entity.name.function.actionscript.2","clickHandler"],
+  ["punctuation.definition.parameters.begin.actionscript.2","("],
+  ["variable.parameter.function.actionscript.2","event:MouseEvent"],
+  ["punctuation.definition.parameters.end.actionscript.2",")"],
+  ["keyword.operator.symbolic.actionscript.2",":"],
+  ["support.function.actionscript.2","void"]
+],[
+   "start",
+  ["text","\t\t{"]
+],[
+   "start",
+  ["text","\t\t\tcar.transform.colorTransform "],
+  ["keyword.operator.symbolic.actionscript.2","="],
+  ["text"," "],
+  ["keyword.control.actionscript.2","new"],
+  ["text"," ColorTransform("],
+  ["constant.numeric.actionscript.2","0"],
+  ["text",","],
+  ["constant.numeric.actionscript.2","0"],
+  ["text",","],
+  ["constant.numeric.actionscript.2","0"],
+  ["text",","],
+  ["constant.numeric.actionscript.2","1"],
+  ["text",",c1,c2,c3);"]
+],[
+   "start",
+  ["text","\t\t}"]
+],[
+   "start",
+  ["text","\t\t"]
+],[
+   "start",
+  ["text","\t\tprotected "],
+  ["storage.type.function.actionscript.2","function"],
+  ["meta.function.actionscript.2"," "],
+  ["entity.name.function.actionscript.2","changeRGBHandler"],
+  ["punctuation.definition.parameters.begin.actionscript.2","("],
+  ["variable.parameter.function.actionscript.2","event:Event"],
+  ["punctuation.definition.parameters.end.actionscript.2",")"],
+  ["keyword.operator.symbolic.actionscript.2",":"],
+  ["support.function.actionscript.2","void"]
+],[
+   "start",
+  ["text","\t\t{"]
+],[
+   "start",
+  ["text","\t\t\tc1 "],
+  ["keyword.operator.symbolic.actionscript.2","="],
+  ["text"," "],
+  ["storage.type.actionscript.2","Number"],
+  ["text","(c1_txt."],
+  ["support.function.actionscript.2","text"],
+  ["text",");"]
+],[
+   "start",
+  ["text","            "]
+],[
+   "start",
+  ["text","\t\t\t"],
+  ["keyword.control.actionscript.2","if"],
+  ["text","("],
+  ["keyword.operator.symbolic.actionscript.2","!"],
+  ["text","(c1>"],
+  ["keyword.operator.symbolic.actionscript.2","="],
+  ["constant.numeric.actionscript.2","0"],
+  ["text",")){"]
+],[
+   "start",
+  ["text","\t\t\t\tc1 "],
+  ["keyword.operator.symbolic.actionscript.2","="],
+  ["text"," "],
+  ["constant.numeric.actionscript.2","0"],
+  ["text",";"]
+],[
+   "start",
+  ["text","\t\t\t}\t\t\t"]
+],[
+   "start",
+  ["text","\t\t\t"]
+],[
+   "start",
+  ["text","\t\t\tupdateSliders();"]
+],[
+   "start",
+  ["text","\t\t}"]
+],[
+   "start",
+  ["text","\t}"]
+],[
+   "start",
+  ["text","}"]
+]]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/_test/tokens_asciidoc.json
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/_test/tokens_asciidoc.json b/src/fauxton/assets/js/libs/ace/mode/_test/tokens_asciidoc.json
new file mode 100644
index 0000000..f54c355
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/_test/tokens_asciidoc.json
@@ -0,0 +1,422 @@
+[[
+   "literalBlock",
+  ["support.function","------------------------------------"]
+],[
+   "dissallowDelimitedBlock",
+  ["support.function","-----------------------------------"]
+],[
+   "text",
+  ["string.italic","_ita_lic_"],
+  ["text",", "],
+  ["keyword.bold","*bo*ld*"],
+  ["text",", "],
+  ["support.function","+mo+no+"],
+  ["text",", normal. "]
+],[
+   "text",
+  ["keyword","``"],
+  ["text","double quoted"],
+  ["keyword","''"],
+  ["text",", `single quoted'."]
+],[
+   "text",
+  ["text","  normal, ^super^, "],
+  ["keyword","~sub~"],
+  ["text","."]
+],[
+   "start"
+],[
+   "text",
+  ["text","''''"]
+],[
+   "text",
+  ["text","Escaped:"]
+],[
+   "text",
+  ["constant.language.escape","\\_"],
+  ["text","italic_, "],
+  ["support.function","+++"],
+  ["text","_italic_"],
+  ["support.function","+++"],
+  ["text",","]
+],[
+   "smallPassthrough",
+  ["text","t"],
+  ["constant.language.escape","\\_"],
+  ["text","_e"],
+  ["string.italic","__st, +++t__"],
+  ["text","e__st"],
+  ["support.function","+++"],
+  ["text",","]
+],[
+   "smallPassthrough",
+  ["support.function","+++"],
+  ["text","<b>bold</b>"],
+  ["support.function","+++"],
+  ["text",", $$<"],
+  ["support.function","b"],
+  ["text",">"],
+  ["support.function","normal"],
+  ["text","</"],
+  ["support.function","b"],
+  ["text",">$$"]
+],[
+   "smallPassthrough",
+  ["text","\\&#"],
+  ["support.function","182"],
+  ["text","; &#"],
+  ["support.function","182"],
+  ["text",";"]
+],[
+   "smallPassthrough",
+  ["text","\\`"],
+  ["support.function","not"],
+  ["text"," "],
+  ["support.function","single"],
+  ["text"," "],
+  ["support.function","quoted"],
+  ["text","'"]
+],[
+   "smallPassthrough",
+  ["text","\\`\\`"],
+  ["support.function","not"],
+  ["text"," "],
+  ["support.function","double"],
+  ["text"," "],
+  ["support.function","quoted"],
+  ["text","''"]
+],[
+   "dissallowDelimitedBlock"
+],[
+   "text"
+],[
+   "start",
+  ["string.regexp","[fffff]"]
+],[
+   "passthroughBlock",
+  ["string","+++++++++++++++++++++++++++++++++++++"]
+],[
+   "passthroughBlock",
+  ["support.function","(C) "],
+  ["constant.character","{ss}"],
+  ["support.function"," ss"]
+],[
+   "dissallowDelimitedBlock",
+  ["support.function","+++++++++++++++++++++++++++++++++++++"]
+],[
+   "text"
+],[
+   "listingBlock",
+  ["support.function","............."]
+],[
+   "listingBlock",
+  ["support.function","callout "],
+  ["constant.numeric","<1>"]
+],[
+   "dissallowDelimitedBlock",
+  ["support.function",".............."]
+],[
+   "text"
+],[
+   "text",
+  ["text","> 1"]
+],[
+   "text",
+  ["text","1> 2"]
+],[
+   "text",
+  ["text","<2> 3"]
+],[
+   "start"
+],[
+   "text",
+  ["text","Escaped:"]
+],[
+   "text",
+  ["constant.language.escape","\\_"],
+  ["text","italic_,"]
+],[
+   "text",
+  ["text","t"],
+  ["constant.language.escape","\\_"],
+  ["text","_e"],
+  ["string.italic","__st, o__"]
+],[
+   "start"
+],[
+   "start",
+  ["constant.numeric",".optional title"]
+],[
+   "listingBlock",
+  ["support.function","............."]
+],[
+   "listingBlock",
+  ["support.function","callout "],
+  ["constant.numeric","<1>"]
+],[
+   "dissallowDelimitedBlock",
+  ["support.function",".............."]
+],[
+   "text"
+],[
+   "start"
+],[
+   "text",
+  ["keyword",":macro:"],
+  ["text"," dddd"]
+],[
+   "start"
+],[
+   "start",
+  ["constant.numeric",".lists"]
+],[
+   "listText",
+  ["keyword",". "],
+  ["text","1"]
+],[
+   "listText",
+  ["keyword",".. "],
+  ["text","2"]
+],[
+   "listText",
+  ["keyword","... "],
+  ["text","d"]
+],[
+   "listText",
+  ["keyword","..... "],
+  ["text","big"]
+],[
+   "start",
+  ["keyword","+"]
+],[
+   "text",
+  ["text","continue"],
+  ["keyword"," +"]
+],[
+   "text",
+  ["text","next line"]
+],[
+   "text",
+  ["text","xi) no "],
+  ["support.function","++la+tin++"]
+],[
+   "start"
+],[
+   "listText",
+  ["keyword","xi) "],
+  ["text","la"],
+  ["support.function","++tin++"]
+],[
+   "listText",
+  ["keyword","2. "],
+  ["text","num"],
+  ["string.italic","__ber__"],
+  ["text","  [red]"],
+  ["keyword","#"],
+  ["text","red"],
+  ["keyword","#"]
+],[
+   "start",
+  ["keyword","--"]
+],[
+   "listText",
+  ["keyword","  5. "],
+  ["text","f "],
+  ["keyword","<<x6,"],
+  ["string","ssss"],
+  ["keyword",">>"],
+  ["text"," "],
+  ["constant.character","{macro}"]
+],[
+   "start",
+  ["keyword","--"]
+],[
+   "text",
+  ["markup.list.macro","image::"],
+  ["keyword","path"],
+  ["string","[beauty]"],
+  ["text"," "],
+  ["constant.language.escape","->"],
+  ["text","--"],
+  ["constant.language.escape","<= --"],
+  ["text"," replacements"]
+],[
+   "start"
+],[
+   "indentedBlock",
+  ["support.function"," image::s"]
+],[
+   "indentedBlock",
+  ["support.function","sssss"]
+],[
+   "indentedBlock",
+  ["support.function","sss "]
+],[
+   "indentedBlock",
+  ["support.function","sssss"]
+],[
+   "start"
+],[
+   "start"
+],[
+   "start",
+  ["markup.heading","== 1"]
+],[
+   "indentedBlock",
+  ["support.function","  heading"]
+],[
+   "start",
+  ["markup.heading","=== not a heading"]
+],[
+   "start",
+  ["keyword","===================================="]
+],[
+   "start"
+],[
+   "start",
+  ["keyword","=================================="]
+],[
+   "text",
+  ["text","====4 "]
+],[
+   "text",
+  ["text","NOTE: above"]
+],[
+   "start"
+],[
+   "text",
+  ["keyword","NOTE:"],
+  ["text"," above"]
+],[
+   "start"
+],[
+   "start",
+  ["string.regexp","[[x6]]"]
+],[
+   "text",
+  ["keyword","WARNING:"],
+  ["text"," "]
+],[
+   "start"
+],[
+   "start",
+  ["string.regexp","[options[]]"]
+],[
+   "literalBlock",
+  ["support.function","---------------------------"]
+],[
+   "literalBlock",
+  ["support.function","literal"]
+],[
+   "dissallowDelimitedBlock",
+  ["support.function","---------------------------"]
+],[
+   "text"
+],[
+   "start"
+],[
+   "start",
+  ["markup.heading","= Tables"]
+],[
+   "tableBlock",
+  ["doc.comment","|===================================="]
+],[
+   "tableBlock",
+  ["doc.comment","|"],
+  ["text"," "],
+  ["string.italic","_italic_"],
+  ["text"," "],
+  ["doc.comment","|"],
+  ["text","  "],
+  ["keyword.bold","*bold*"],
+  ["text"," "],
+  ["doc.comment","|"],
+  ["text"," text "],
+  ["doc.comment","|"],
+  ["text"," "],
+  ["constant.language.escape","(R)"]
+],[
+   "tableBlock"
+],[
+   "dissallowDelimitedBlock",
+  ["doc.comment","|===================================="]
+],[
+   "text"
+],[
+   "start"
+],[
+   "start",
+  ["string.regexp","[more, options]"]
+],[
+   "commentBlock",
+  ["doc.comment","///////////"]
+],[
+   "commentBlock",
+  ["doc.comment","comment"]
+],[
+   "dissallowDelimitedBlock",
+  ["doc.comment","///////////"]
+],[
+   "text",
+  ["comment","// one line comment"]
+],[
+   "start"
+],[
+   "start"
+],[
+   "start"
+],[
+   "text",
+  ["text","[red]"],
+  ["keyword","#"],
+  ["text","red text"],
+  ["keyword","#"],
+  ["text"," [yellow-background]"],
+  ["keyword","#"],
+  ["text","on yellow"],
+  ["keyword","#"]
+],[
+   "text",
+  ["text","[big]"],
+  ["keyword","#"],
+  ["text","large"],
+  ["keyword","#"],
+  ["text"," [red yellow-background big]"],
+  ["keyword.bold","*all bold*"]
+],[
+   "start"
+],[
+   "start",
+  ["text","\t"]
+],[
+   "text",
+  ["markup.underline.list","https://site"],
+  ["text"," text <"],
+  ["markup.underline.list","mail@i.am"],
+  ["text","> "],
+  ["markup.underline.list","callto:ace"],
+  ["text"," "],
+  ["link","http://ace.ajaxorg.com"],
+  ["variable.language","[awesome]"]
+],[
+   "text",
+  ["text","  .still normal text"]
+],[
+   "start",
+  ["constant.numeric",".break out thoug should not"]
+],[
+   "literalBlock",
+  ["support.function","---------------------------"]
+],[
+   "literalBlock",
+  ["support.function","///////////////////////////"]
+],[
+   "dissallowDelimitedBlock",
+  ["support.function","---------------------------"]
+],[
+   "text"
+],[
+   "start"
+],[
+   "start"
+]]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9abd128c/src/fauxton/assets/js/libs/ace/mode/_test/tokens_assembly_x86.json
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/ace/mode/_test/tokens_assembly_x86.json b/src/fauxton/assets/js/libs/ace/mode/_test/tokens_assembly_x86.json
new file mode 100644
index 0000000..5da0470
--- /dev/null
+++ b/src/fauxton/assets/js/libs/ace/mode/_test/tokens_assembly_x86.json
@@ -0,0 +1,114 @@
+[[
+   "start",
+  ["support.function.directive.assembly","section"],
+  ["text","\t.text"]
+],[
+   "start",
+  ["text","    "],
+  ["support.function.directive.assembly","global"],
+  ["text"," "],
+  ["entity.name.function.assembly","main"],
+  ["text","         "],
+  ["comment.assembly",";must be declared for using gcc"]
+],[
+   "start"
+],[
+   "start",
+  ["entity.name.function.assembly","main:"],
+  ["text","\t                "],
+  ["comment.assembly",";tell linker entry point"]
+],[
+   "start"
+],[
+   "start",
+  ["text","\t"],
+  ["keyword.control.assembly","mov"],
+  ["text","\t"],
+  ["variable.parameter.register.assembly","edx"],
+  ["text",", len\t    "],
+  ["comment.assembly",";message length"]
+],[
+   "start",
+  ["text","\t"],
+  ["keyword.control.assembly","mov"],
+  ["text","\t"],
+  ["variable.parameter.register.assembly","ecx"],
+  ["text",", msg\t    "],
+  ["comment.assembly",";message to write"]
+],[
+   "start",
+  ["text","\t"],
+  ["keyword.control.assembly","mov"],
+  ["text","\t"],
+  ["variable.parameter.register.assembly","ebx"],
+  ["text",", "],
+  ["constant.character.decimal.assembly","1"],
+  ["text","\t        "],
+  ["comment.assembly",";file descriptor (stdout)"]
+],[
+   "start",
+  ["text","\t"],
+  ["keyword.control.assembly","mov"],
+  ["text","\t"],
+  ["variable.parameter.register.assembly","eax"],
+  ["text",", "],
+  ["constant.character.decimal.assembly","4"],
+  ["text","\t        "],
+  ["comment.assembly",";system call number (sys_write)"]
+],[
+   "start",
+  ["text","\t"],
+  ["keyword.control.assembly","int"],
+  ["text","\t"],
+  ["constant.character.hexadecimal.assembly","0x80"],
+  ["text","\t        "],
+  ["comment.assembly",";call kernel"]
+],[
+   "start"
+],[
+   "start",
+  ["text","\t"],
+  ["keyword.control.assembly","mov"],
+  ["text","\t"],
+  ["variable.parameter.register.assembly","eax"],
+  ["text",", "],
+  ["constant.character.decimal.assembly","1"],
+  ["text","\t        "],
+  ["comment.assembly",";system call number (sys_exit)"]
+],[
+   "start",
+  ["text","\t"],
+  ["keyword.control.assembly","int"],
+  ["text","\t"],
+  ["constant.character.hexadecimal.assembly","0x80"],
+  ["text","\t        "],
+  ["comment.assembly",";call kernel"]
+],[
+   "start"
+],[
+   "start",
+  ["support.function.directive.assembly","section"],
+  ["text","\t.data"]
+],[
+   "start"
+],[
+   "start",
+  ["entity.name.function.assembly","msg"],
+  ["text","\t"],
+  ["support.function.directive.assembly","db"],
+  ["text","\t"],
+  ["string.assembly","'Hello, world!'"],
+  ["text",","],
+  ["constant.character.hexadecimal.assembly","0xa"],
+  ["text","\t"],
+  ["comment.assembly",";our dear string"]
+],[
+   "start",
+  ["entity.name.function.assembly","len"],
+  ["text","\t"],
+  ["support.function.directive.assembly","equ"],
+  ["text","\t$ - msg\t\t\t"],
+  ["comment.assembly",";length of our dear string"]
+],[
+   "start"
+]]
\ No newline at end of file