From 0a08e30685ec382cee671fb1d8a92a1a63b0e1d5 Mon Sep 17 00:00:00 2001 From: nightwing Date: Tue, 20 Dec 2011 17:56:34 +0400 Subject: [PATCH] update ace++ --- chrome/content/ace++/consoleMode.js | 70 + chrome/content/ace++/fbeditor.html | 2 +- chrome/content/ace++/imageViewer.js | 2 + chrome/content/ace++/res/ace-uncompressed.js | 11765 ---------------- .../content/ace++/res/ace/keybinding-emacs.js | 332 +- .../content/ace++/res/ace/keybinding-vim.js | 1247 +- chrome/content/ace++/res/ace/mode-c_cpp.js | 235 +- chrome/content/ace++/res/ace/mode-coffee.js | 291 +- chrome/content/ace++/res/ace/mode-html.js | 1716 ++- chrome/content/ace++/res/ace/mode-json.js | 97 +- chrome/content/ace++/res/ace/mode-xml.js | 95 +- chrome/content/ace++/res/ace/theme-clouds.js | 116 +- .../ace++/res/ace/theme-clouds_midnight.js | 117 +- chrome/content/ace++/res/ace/theme-cobalt.js | 131 +- .../ace++/res/ace/theme-crimson_editor.js | 164 +- chrome/content/ace++/res/ace/theme-dawn.js | 134 +- chrome/content/ace++/res/ace/theme-eclipse.js | 109 +- .../ace++/res/ace/theme-idle_fingers.js | 123 +- .../content/ace++/res/ace/theme-kr_theme.js | 126 +- .../content/ace++/res/ace/theme-merbivore.js | 126 +- .../ace++/res/ace/theme-merbivore_soft.js | 132 +- .../ace++/res/ace/theme-mono_industrial.js | 126 +- chrome/content/ace++/res/ace/theme-monokai.js | 122 +- .../ace++/res/ace/theme-pastel_on_dark.js | 144 +- .../ace++/res/ace/theme-solarized_dark.js | 121 +- .../ace++/res/ace/theme-solarized_light.js | 120 +- .../content/ace++/res/ace/theme-tomorrow.js | 142 +- .../ace++/res/ace/theme-tomorrow_night.js | 142 +- .../res/ace/theme-tomorrow_night_blue.js | 142 +- .../res/ace/theme-tomorrow_night_bright.js | 142 +- .../res/ace/theme-tomorrow_night_eighties.js | 138 +- .../content/ace++/res/ace/theme-twilight.js | 144 +- .../ace++/res/ace/theme-vibrant_ink.js | 127 +- chrome/content/ace++/scrollbar.js | 212 - chrome/content/ace++/startup.js | 207 +- chrome/content/ace++/styles.css | 31 +- chrome/content/resource.js | 2 +- 37 files changed, 6958 insertions(+), 12234 deletions(-) delete mode 100644 chrome/content/ace++/res/ace-uncompressed.js diff --git a/chrome/content/ace++/consoleMode.js b/chrome/content/ace++/consoleMode.js index b419ef0..02027bf 100644 --- a/chrome/content/ace++/consoleMode.js +++ b/chrome/content/ace++/consoleMode.js @@ -6,6 +6,73 @@ var TextMode = require("ace/mode/text").Mode; var Range = require("ace/range").Range; var jsMode = require("ace/mode/javascript").Mode +var foldMode = new (require("ace/mode/folding/cstyle").FoldMode); +foldMode.foldingStartMarker = /(^#>>)|(\{|\[)[^\}\]]*$|^\s*(\/\*)/; +foldMode.getFoldWidgetRange = function(session, foldStyle, row) { + var line = session.getLine(row); + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) { + var cell = session.$mode.getCellBounds(row) + var start = {row: row, column: session.$mode.dl}; + var end = {row: cell.bodyEnd, column: session.getLine(cell.bodyEnd).length}; + var placeholder = session.getLine(cell.headerStart).slice(0,10) + "====================="; + range = Range.fromPoints(start, end) + range.placeholder = placeholder + return range + } + + if (match[3]) { + var range = session.getCommentFoldRange(row, i + match[0].length); + range.end.column -= 2; + return range; + } + + var start = {row: row, column: i+1}; + var end = session.$findClosingBracket(match[2], start); + if (!end) + return; + + var fw = session.foldWidgets[end.row]; + if (fw == null) + fw = this.getFoldWidget(session, end.row); + + if (fw == "start") { + end.row --; + end.column = session.getLine(end.row).length; + } + return Range.fromPoints(start, end); + } + + if (foldStyle !== "markbeginend") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[2]) { + var range = session.getCommentFoldRange(row, i); + range.end.column -= 2; + return range; + } + + var end = {row: row, column: i}; + var start = session.$findOpeningBracket(match[1], end); + + if (!start) + return; + + start.column++; + end.column--; + + return Range.fromPoints(start, end); + } +}; + + modes = { js: new jsMode, get coffee() { @@ -25,6 +92,8 @@ modes = { } jsMode = modes.js + + var tk = {} var delimiter = '#>>' var dl = delimiter.length @@ -83,6 +152,7 @@ tk.getLineTokens = function(line, startState) { var Mode = function() { this.$tokenizer = tk; + this.foldingRules = foldMode }; oop.inherits(Mode, TextMode); diff --git a/chrome/content/ace++/fbeditor.html b/chrome/content/ace++/fbeditor.html index 5821171..2ea9502 100644 --- a/chrome/content/ace++/fbeditor.html +++ b/chrome/content/ace++/fbeditor.html @@ -149,7 +149,7 @@ } onLaunch = callback || true; // "ace/mode/javascript", "ace/mode/css", are loaded with html // "ace-uncompressed" for debugging - var rootDeps = ["fbace/scrollbar", "fbace/startup", "res/ace-uncompressed", "ace/mode/xml", "ace/mode/html"]; + var rootDeps = ["fbace/startup", "res/ace/ace-uncompressed", "ace/mode/xml", "ace/mode/html"]; if (!options) options = { softtabs: true, diff --git a/chrome/content/ace++/imageViewer.js b/chrome/content/ace++/imageViewer.js index fd1f261..0297518 100644 --- a/chrome/content/ace++/imageViewer.js +++ b/chrome/content/ace++/imageViewer.js @@ -20,6 +20,8 @@ exports.showImage = function(data) { // this.buttons.style.display = ''; this.iframe.setAttribute('src', 'view-source:' + data.href); + this.iframe.className="" + this.iframe.parentNode.appendChild(this.iframe) this.isOpen = true; }; diff --git a/chrome/content/ace++/res/ace-uncompressed.js b/chrome/content/ace++/res/ace-uncompressed.js deleted file mode 100644 index f9dc27c..0000000 --- a/chrome/content/ace++/res/ace-uncompressed.js +++ /dev/null @@ -1,11765 +0,0 @@ -// 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 Schafer 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("ace/lib/fixoldbrowsers",[], function(require, exports, module) { - -require("ace/lib/regexp"); -require("ace/lib/es5-shim"); - -}); - -define("ace/editor",[], function(require, exports, module) { - -require("ace/lib/fixoldbrowsers"); - -var oop = require("ace/lib/oop"); -var event = require("ace/lib/event"); -var lang = require("ace/lib/lang"); -var useragent = require("ace/lib/useragent"); -var TextInput = require("ace/keyboard/textinput").TextInput; -var MouseHandler = require("ace/mouse/mouse_handler").MouseHandler; -//var TouchHandler = require("ace/touch_handler").TouchHandler; -var KeyBinding = require("ace/keyboard/keybinding").KeyBinding; -var EditSession = require("ace/edit_session").EditSession; -var Search = require("ace/search").Search; -var Range = require("ace/range").Range; -var EventEmitter = require("ace/lib/event_emitter").EventEmitter; -var CommandManager = require("ace/commands/command_manager").CommandManager; -var defaultCommands = require("ace/commands/default_commands").commands; - -var Editor = function(renderer, session) { - var container = renderer.getContainerElement(); - this.container = container; - this.renderer = renderer; - - this.textInput = new TextInput(renderer.getTextAreaContainer(), this); - this.keyBinding = new KeyBinding(this); - - // TODO detect touch event support - if (useragent.isIPad) { - //this.$mouseHandler = new TouchHandler(this); - } else { - this.$mouseHandler = new MouseHandler(this); - } - - this.$blockScrolling = 0; - this.$search = new Search().set({ - wrap: true - }); - - this.commands = new CommandManager(defaultCommands); - this.setSession(session || new EditSession("")); -}; - -(function(){ - - oop.implement(this, EventEmitter); - - this.$forwardEvents = { - gutterclick: 1, - gutterdblclick: 1 - }; - - this.$originalAddEventListener = this.addEventListener; - this.$originalRemoveEventListener = this.removeEventListener; - - this.addEventListener = function(eventName, callback) { - if (this.$forwardEvents[eventName]) { - return this.renderer.addEventListener(eventName, callback); - } else { - return this.$originalAddEventListener(eventName, callback); - } - }; - - this.removeEventListener = function(eventName, callback) { - if (this.$forwardEvents[eventName]) { - return this.renderer.removeEventListener(eventName, callback); - } else { - return this.$originalRemoveEventListener(eventName, callback); - } - }; - - this.setKeyboardHandler = function(keyboardHandler) { - this.keyBinding.setKeyboardHandler(keyboardHandler); - }; - - this.getKeyboardHandler = function() { - return this.keyBinding.getKeyboardHandler(); - }; - - this.setSession = function(session) { - if (this.session == session) - return; - - if (this.session) { - var oldSession = this.session; - this.session.removeEventListener("change", this.$onDocumentChange); - this.session.removeEventListener("changeMode", this.$onChangeMode); - this.session.removeEventListener("tokenizerUpdate", this.$onTokenizerUpdate); - this.session.removeEventListener("changeTabSize", this.$onChangeTabSize); - this.session.removeEventListener("changeWrapLimit", this.$onChangeWrapLimit); - this.session.removeEventListener("changeWrapMode", this.$onChangeWrapMode); - this.session.removeEventListener("onChangeFold", this.$onChangeFold); - this.session.removeEventListener("changeFrontMarker", this.$onChangeFrontMarker); - this.session.removeEventListener("changeBackMarker", this.$onChangeBackMarker); - this.session.removeEventListener("changeBreakpoint", this.$onChangeBreakpoint); - this.session.removeEventListener("changeAnnotation", this.$onChangeAnnotation); - this.session.removeEventListener("changeOverwrite", this.$onCursorChange); - - var selection = this.session.getSelection(); - selection.removeEventListener("changeCursor", this.$onCursorChange); - selection.removeEventListener("changeSelection", this.$onSelectionChange); - - this.session.setScrollTopRow(this.renderer.getScrollTopRow()); - } - - this.session = session; - - this.$onDocumentChange = this.onDocumentChange.bind(this); - session.addEventListener("change", this.$onDocumentChange); - this.renderer.setSession(session); - - this.$onChangeMode = this.onChangeMode.bind(this); - session.addEventListener("changeMode", this.$onChangeMode); - - this.$onTokenizerUpdate = this.onTokenizerUpdate.bind(this); - session.addEventListener("tokenizerUpdate", this.$onTokenizerUpdate); - - this.$onChangeTabSize = this.renderer.updateText.bind(this.renderer); - session.addEventListener("changeTabSize", this.$onChangeTabSize); - - this.$onChangeWrapLimit = this.onChangeWrapLimit.bind(this); - session.addEventListener("changeWrapLimit", this.$onChangeWrapLimit); - - this.$onChangeWrapMode = this.onChangeWrapMode.bind(this); - session.addEventListener("changeWrapMode", this.$onChangeWrapMode); - - this.$onChangeFold = this.onChangeFold.bind(this); - session.addEventListener("changeFold", this.$onChangeFold); - - this.$onChangeFrontMarker = this.onChangeFrontMarker.bind(this); - this.session.addEventListener("changeFrontMarker", this.$onChangeFrontMarker); - - this.$onChangeBackMarker = this.onChangeBackMarker.bind(this); - this.session.addEventListener("changeBackMarker", this.$onChangeBackMarker); - - this.$onChangeBreakpoint = this.onChangeBreakpoint.bind(this); - this.session.addEventListener("changeBreakpoint", this.$onChangeBreakpoint); - - this.$onChangeAnnotation = this.onChangeAnnotation.bind(this); - this.session.addEventListener("changeAnnotation", this.$onChangeAnnotation); - - this.$onCursorChange = this.onCursorChange.bind(this); - this.session.addEventListener("changeOverwrite", this.$onCursorChange); - - this.selection = session.getSelection(); - this.selection.addEventListener("changeCursor", this.$onCursorChange); - - this.$onSelectionChange = this.onSelectionChange.bind(this); - this.selection.addEventListener("changeSelection", this.$onSelectionChange); - - this.onChangeMode(); - - this.onCursorChange(); - this.onSelectionChange(); - this.onChangeFrontMarker(); - this.onChangeBackMarker(); - this.onChangeBreakpoint(); - this.onChangeAnnotation(); - this.session.getUseWrapMode() && this.renderer.adjustWrapLimit(); - this.renderer.scrollToRow(session.getScrollTopRow()); - this.renderer.updateFull(); - - this._dispatchEvent("changeSession", { - session: session, - oldSession: oldSession - }); - }; - - this.getSession = function() { - return this.session; - }; - - this.getSelection = function() { - return this.selection; - }; - - this.resize = function() { - this.renderer.onResize(); - }; - - this.setTheme = function(theme) { - this.renderer.setTheme(theme); - }; - - this.getTheme = function() { - return this.renderer.getTheme(); - }; - - this.setStyle = function(style) { - this.renderer.setStyle(style); - }; - - this.unsetStyle = function(style) { - this.renderer.unsetStyle(style); - }; - - this.setFontSize = function(size) { - this.container.style.fontSize = size; - }; - - this.$highlightBrackets = function() { - if (this.session.$bracketHighlight) { - this.session.removeMarker(this.session.$bracketHighlight); - this.session.$bracketHighlight = null; - } - - if (this.$highlightPending) { - return; - } - - // perform highlight async to not block the browser during navigation - var self = this; - this.$highlightPending = true; - setTimeout(function() { - self.$highlightPending = false; - - var pos = self.session.findMatchingBracket(self.getCursorPosition()); - if (pos) { - var range = new Range(pos.row, pos.column, pos.row, pos.column+1); - self.session.$bracketHighlight = self.session.addMarker(range, "ace_bracket", "text"); - } - }, 10); - }; - - this.focus = function() { - // Safari needs the timeout - // iOS and Firefox need it called immediately - // to be on the save side we do both - var _self = this; - setTimeout(function() { - _self.textInput.focus(); - }); - this.textInput.focus(); - }; - - this.isFocused = function() { - return this.textInput.isFocused(); - }; - - this.blur = function() { - this.textInput.blur(); - }; - - this.onFocus = function() { - this.renderer.showCursor(); - this.renderer.visualizeFocus(); - this._dispatchEvent("focus"); - }; - - this.onBlur = function() { - this.renderer.hideCursor(); - this.renderer.visualizeBlur(); - this._dispatchEvent("blur"); - }; - - this.onDocumentChange = function(e) { - var delta = e.data; - var range = delta.range; - - if (range.start.row == range.end.row && delta.action != "insertLines" && delta.action != "removeLines") - var lastRow = range.end.row; - else - lastRow = Infinity; - this.renderer.updateLines(range.start.row, lastRow); - - this._dispatchEvent("change", e); - - // update cursor because tab characters can influence the cursor position - this.renderer.updateCursor(); - }; - - this.onTokenizerUpdate = function(e) { - var rows = e.data; - this.renderer.updateLines(rows.first, rows.last); - }; - - this.onCursorChange = function(e) { - this.renderer.updateCursor(); - - if (!this.$blockScrolling) { - this.renderer.scrollCursorIntoView(); - } - - // move text input over the cursor - // this is required for iOS and IME - this.renderer.moveTextAreaToCursor(this.textInput.getElement()); - - this.$highlightBrackets(); - this.$updateHighlightActiveLine(); - }; - - this.$updateHighlightActiveLine = function() { - var session = this.getSession(); - - if (session.$highlightLineMarker) { - session.removeMarker(session.$highlightLineMarker); - } - session.$highlightLineMarker = null; - - if (this.getHighlightActiveLine() && (this.getSelectionStyle() != "line" || !this.selection.isMultiLine())) { - var cursor = this.getCursorPosition(), - foldLine = this.session.getFoldLine(cursor.row); - var range; - if (foldLine) { - range = new Range(foldLine.start.row, 0, foldLine.end.row + 1, 0); - } else { - range = new Range(cursor.row, 0, cursor.row+1, 0); - } - session.$highlightLineMarker = session.addMarker(range, "ace_active_line", "background"); - } - }; - - this.onSelectionChange = function(e) { - var session = this.getSession(); - - if (session.$selectionMarker) { - session.removeMarker(session.$selectionMarker); - } - session.$selectionMarker = null; - - if (!this.selection.isEmpty()) { - var range = this.selection.getRange(); - var style = this.getSelectionStyle(); - session.$selectionMarker = session.addMarker(range, "ace_selection", style); - } else { - this.$updateHighlightActiveLine(); - } - - if (this.$highlightSelectedWord) - this.session.getMode().highlightSelection(this); - }; - - this.onChangeFrontMarker = function() { - this.renderer.updateFrontMarkers(); - }; - - this.onChangeBackMarker = function() { - this.renderer.updateBackMarkers(); - }; - - this.onChangeBreakpoint = function() { - this.renderer.setBreakpoints(this.session.getBreakpoints()); - }; - - this.onChangeAnnotation = function() { - this.renderer.setAnnotations(this.session.getAnnotations()); - }; - - this.onChangeMode = function() { - this.renderer.updateText(); - }; - - this.onChangeWrapLimit = function() { - this.renderer.updateFull(); - }; - - this.onChangeWrapMode = function() { - this.renderer.onResize(true); - }; - - this.onChangeFold = function() { - // Update the active line marker as due to folding changes the current - // line range on the screen might have changed. - this.$updateHighlightActiveLine(); - // TODO: This might be too much updating. Okay for now. - this.renderer.updateFull(); - }; - - this.getCopyText = function() { - var text = ""; - if (!this.selection.isEmpty()) - text = this.session.getTextRange(this.getSelectionRange()); - - this._emit("copy", text); - return text; - }; - - this.onCut = function() { - if (this.$readOnly) - return; - - var range = this.getSelectionRange(); - this._emit("cut", range); - - if (!this.selection.isEmpty()) { - this.session.remove(range); - this.clearSelection(); - } - }; - - this.insert = function(text) { - if (this.$readOnly) - return; - - var session = this.session; - var mode = session.getMode(); - - var cursor = this.getCursorPosition(); - - if (this.getBehavioursEnabled()) { - // Get a transform if the current mode wants one. - var transform = mode.transformAction(session.getState(cursor.row), 'insertion', this, session, text); - if (transform) - text = transform.text; - } - - text = text.replace("\t", this.session.getTabString()); - - // remove selected text - if (!this.selection.isEmpty()) { - var cursor = this.session.remove(this.getSelectionRange()); - this.clearSelection(); - } - else if (this.session.getOverwrite()) { - var range = new Range.fromPoints(cursor, cursor); - range.end.column += text.length; - this.session.remove(range); - } - - this.clearSelection(); - - var start = cursor.column; - var lineState = session.getState(cursor.row); - var shouldOutdent = mode.checkOutdent(lineState, session.getLine(cursor.row), text); - var line = session.getLine(cursor.row); - var lineIndent = mode.getNextLineIndent(lineState, line.slice(0, cursor.column), session.getTabString()); - var end = session.insert(cursor, text); - - if (transform && transform.selection) { - if (transform.selection.length == 2) { // Transform relative to the current column - this.selection.setSelectionRange( - new Range(cursor.row, start + transform.selection[0], - cursor.row, start + transform.selection[1])); - } else { // Transform relative to the current row. - this.selection.setSelectionRange( - new Range(cursor.row + transform.selection[0], - transform.selection[1], - cursor.row + transform.selection[2], - transform.selection[3])); - } - } - - var lineState = session.getState(cursor.row); - - // TODO disabled multiline auto indent - // possibly doing the indent before inserting the text - // if (cursor.row !== end.row) { - if (session.getDocument().isNewLine(text)) { - this.moveCursorTo(cursor.row+1, 0); - - var size = session.getTabSize(); - var minIndent = Number.MAX_VALUE; - - for (var row = cursor.row + 1; row <= end.row; ++row) { - var indent = 0; - - line = session.getLine(row); - for (var i = 0; i < line.length; ++i) - if (line.charAt(i) == '\t') - indent += size; - else if (line.charAt(i) == ' ') - indent += 1; - else - break; - if (/[^\s]/.test(line)) - minIndent = Math.min(indent, minIndent); - } - - for (var row = cursor.row + 1; row <= end.row; ++row) { - var outdent = minIndent; - - line = session.getLine(row); - for (var i = 0; i < line.length && outdent > 0; ++i) - if (line.charAt(i) == '\t') - outdent -= size; - else if (line.charAt(i) == ' ') - outdent -= 1; - session.remove(new Range(row, 0, row, i)); - } - session.indentRows(cursor.row + 1, end.row, lineIndent); - } - if (shouldOutdent) - mode.autoOutdent(lineState, session, cursor.row); - }; - - this.onTextInput = function(text, notPasted) { - if (!notPasted) - this._emit("paste", text); - - // In case the text was not pasted and we got only one character, then - // handel it as a command key stroke. - if (notPasted && text.length == 1) { - // Note: The `null` as `keyCode` is important here, as there are - // some checks in the code for `keyCode == 0` meaning the text comes - // from the keyBinding.onTextInput code path. - var handled = this.keyBinding.onCommandKey({}, 0, null, text); - - // Check if the text was handled. If not, then handled it as "normal" - // text and insert it to the editor directly. This shouldn't be done - // using the this.keyBinding.onTextInput(text) function, as it would - // make the `text` get sent to the keyboardHandler twice, which might - // turn out to be a bad thing in case there is a custome keyboard - // handler like the StateHandler. - if (handled===false) { - this.insert(text); - } - } else { - this.keyBinding.onTextInput(text); - } - }; - - this.onCommandKey = function(e, hashId, keyCode) { - this.keyBinding.onCommandKey(e, hashId, keyCode); - }; - - this.setOverwrite = function(overwrite) { - this.session.setOverwrite(overwrite); - }; - - this.getOverwrite = function() { - return this.session.getOverwrite(); - }; - - this.toggleOverwrite = function() { - this.session.toggleOverwrite(); - }; - - this.setScrollSpeed = function(speed) { - this.$mouseHandler.setScrollSpeed(speed); - }; - - this.getScrollSpeed = function() { - return this.$mouseHandler.getScrollSpeed() - }; - - this.$selectionStyle = "line"; - this.setSelectionStyle = function(style) { - if (this.$selectionStyle == style) return; - - this.$selectionStyle = style; - this.onSelectionChange(); - this._dispatchEvent("changeSelectionStyle", {data: style}); - }; - - this.getSelectionStyle = function() { - return this.$selectionStyle; - }; - - this.$highlightActiveLine = true; - this.setHighlightActiveLine = function(shouldHighlight) { - if (this.$highlightActiveLine == shouldHighlight) return; - - this.$highlightActiveLine = shouldHighlight; - this.$updateHighlightActiveLine(); - }; - - this.getHighlightActiveLine = function() { - return this.$highlightActiveLine; - }; - - this.$highlightSelectedWord = true; - this.setHighlightSelectedWord = function(shouldHighlight) { - if (this.$highlightSelectedWord == shouldHighlight) - return; - - this.$highlightSelectedWord = shouldHighlight; - if (shouldHighlight) - this.session.getMode().highlightSelection(this); - else - this.session.getMode().clearSelectionHighlight(this); - }; - - this.getHighlightSelectedWord = function() { - return this.$highlightSelectedWord; - }; - - this.setShowInvisibles = function(showInvisibles) { - if (this.getShowInvisibles() == showInvisibles) - return; - - this.renderer.setShowInvisibles(showInvisibles); - }; - - this.getShowInvisibles = function() { - return this.renderer.getShowInvisibles(); - }; - - this.setShowPrintMargin = function(showPrintMargin) { - this.renderer.setShowPrintMargin(showPrintMargin); - }; - - this.getShowPrintMargin = function() { - return this.renderer.getShowPrintMargin(); - }; - - this.setPrintMarginColumn = function(showPrintMargin) { - this.renderer.setPrintMarginColumn(showPrintMargin); - }; - - this.getPrintMarginColumn = function() { - return this.renderer.getPrintMarginColumn(); - }; - - this.$readOnly = false; - this.setReadOnly = function(readOnly) { - this.$readOnly = readOnly; - }; - - this.getReadOnly = function() { - return this.$readOnly; - }; - - this.$modeBehaviours = true; - this.setBehavioursEnabled = function (enabled) { - this.$modeBehaviours = enabled; - }; - - this.getBehavioursEnabled = function () { - return this.$modeBehaviours; - }; - - this.remove = function(dir) { - if (this.$readOnly) - return; - - if (this.selection.isEmpty()){ - if(dir == "left") - this.selection.selectLeft(); - else - this.selection.selectRight(); - } - - var range = this.getSelectionRange(); - if (this.getBehavioursEnabled()) { - var session = this.session; - var state = session.getState(range.start.row); - var new_range = session.getMode().transformAction(state, 'deletion', this, session, range); - if (new_range) - range = new_range; - } - - this.session.remove(range); - this.clearSelection(); - }; - - this.removeWordRight = function() { - if (this.$readOnly) - return; - - if (this.selection.isEmpty()) - this.selection.selectWordRight(); - - this.session.remove(this.getSelectionRange()); - this.clearSelection(); - }; - - this.removeWordLeft = function() { - if (this.$readOnly) - return; - - if (this.selection.isEmpty()) - this.selection.selectWordLeft(); - - this.session.remove(this.getSelectionRange()); - this.clearSelection(); - }; - - this.removeToLineStart = function() { - if (this.$readOnly) - return; - - if (this.selection.isEmpty()) - this.selection.selectLineStart(); - - this.session.remove(this.getSelectionRange()); - this.clearSelection(); - }; - - this.removeToLineEnd = function() { - if (this.$readOnly) - return; - - if (this.selection.isEmpty()) - this.selection.selectLineEnd(); - - var range = this.getSelectionRange(); - if (range.start.column == range.end.column && range.start.row == range.end.row) { - range.end.column = 0; - range.end.row++; - } - - this.session.remove(range); - this.clearSelection(); - }; - - this.splitLine = function() { - if (this.$readOnly) - return; - - if (!this.selection.isEmpty()) { - this.session.remove(this.getSelectionRange()); - this.clearSelection(); - } - - var cursor = this.getCursorPosition(); - this.insert("\n"); - this.moveCursorToPosition(cursor); - }; - - this.transposeLetters = function() { - if (this.$readOnly) - return; - - if (!this.selection.isEmpty()) { - return; - } - - var cursor = this.getCursorPosition(); - var column = cursor.column; - if (column === 0) - return; - - var line = this.session.getLine(cursor.row); - var swap, range; - if (column < line.length) { - swap = line.charAt(column) + line.charAt(column-1); - range = new Range(cursor.row, column-1, cursor.row, column+1); - } - else { - swap = line.charAt(column-1) + line.charAt(column-2); - range = new Range(cursor.row, column-2, cursor.row, column); - } - this.session.replace(range, swap); - }; - - this.indent = function() { - if (this.$readOnly) - return; - - var session = this.session; - var range = this.getSelectionRange(); - - if (range.start.row < range.end.row || range.start.column < range.end.column) { - var rows = this.$getSelectedRows(); - session.indentRows(rows.first, rows.last, "\t"); - } else { - var indentString; - - if (this.session.getUseSoftTabs()) { - var size = session.getTabSize(), - position = this.getCursorPosition(), - column = session.documentToScreenColumn(position.row, position.column), - count = (size - column % size); - - indentString = lang.stringRepeat(" ", count); - } else - indentString = "\t"; - return this.onTextInput(indentString, true); - } - }; - - this.blockOutdent = function() { - if (this.$readOnly) - return; - - var selection = this.session.getSelection(); - this.session.outdentRows(selection.getRange()); - }; - - this.toggleCommentLines = function() { - if (this.$readOnly) - return; - - var state = this.session.getState(this.getCursorPosition().row); - var rows = this.$getSelectedRows(); - this.session.getMode().toggleCommentLines(state, this.session, rows.first, rows.last); - }; - - this.removeLines = function() { - if (this.$readOnly) - return; - - var rows = this.$getSelectedRows(); - var range; - if (rows.first == 0 || rows.last+1 < this.session.getLength()) - range = new Range(rows.first, 0, rows.last+1, 0); - else - range = new Range( - rows.first-1, this.session.getLine(rows.first-1).length, - rows.last, this.session.getLine(rows.last).length - ); - this.session.remove(range); - this.clearSelection(); - }; - - this.moveLinesDown = function() { - if (this.$readOnly) - return; - - this.$moveLines(function(firstRow, lastRow) { - return this.session.moveLinesDown(firstRow, lastRow); - }); - }; - - this.moveLinesUp = function() { - if (this.$readOnly) - return; - - this.$moveLines(function(firstRow, lastRow) { - return this.session.moveLinesUp(firstRow, lastRow); - }); - }; - - this.moveText = function(range, toPosition) { - if (this.$readOnly) - return null; - - return this.session.moveText(range, toPosition); - }; - - this.copyLinesUp = function() { - if (this.$readOnly) - return; - - this.$moveLines(function(firstRow, lastRow) { - this.session.duplicateLines(firstRow, lastRow); - return 0; - }); - }; - - this.copyLinesDown = function() { - if (this.$readOnly) - return; - - this.$moveLines(function(firstRow, lastRow) { - return this.session.duplicateLines(firstRow, lastRow); - }); - }; - - - this.$moveLines = function(mover) { - var rows = this.$getSelectedRows(); - var selection = this.selection; - if (!selection.isMultiLine()) { - var range = selection.getRange(); - var reverse = selection.isBackwards(); - } - - var linesMoved = mover.call(this, rows.first, rows.last); - - if (range) { - range.start.row += linesMoved; - range.end.row += linesMoved; - selection.setSelectionRange(range, reverse); - } else { - selection.setSelectionAnchor(rows.last+linesMoved+1, 0); - selection.$moveSelection(function() { - selection.moveCursorTo(rows.first+linesMoved, 0); - }); - } - }; - - this.$getSelectedRows = function() { - var range = this.getSelectionRange().collapseRows(); - - return { - first: range.start.row, - last: range.end.row - }; - }; - - this.onCompositionStart = function(text) { - this.renderer.showComposition(this.getCursorPosition()); - }; - - this.onCompositionUpdate = function(text) { - this.renderer.setCompositionText(text); - }; - - this.onCompositionEnd = function() { - this.renderer.hideComposition(); - }; - - this.getFirstVisibleRow = function() { - return this.renderer.getFirstVisibleRow(); - }; - - this.getLastVisibleRow = function() { - return this.renderer.getLastVisibleRow(); - }; - - this.isRowVisible = function(row) { - return (row >= this.getFirstVisibleRow() && row <= this.getLastVisibleRow()); - }; - - this.$getVisibleRowCount = function() { - return this.renderer.getScrollBottomRow() - this.renderer.getScrollTopRow() + 1; - }; - - this.$getPageDownRow = function() { - return this.renderer.getScrollBottomRow(); - }; - - this.$getPageUpRow = function() { - var firstRow = this.renderer.getScrollTopRow(); - var lastRow = this.renderer.getScrollBottomRow(); - - return firstRow - (lastRow - firstRow); - }; - - this.selectPageDown = function() { - var row = this.$getPageDownRow() + Math.floor(this.$getVisibleRowCount() / 2); - - this.scrollPageDown(); - - var selection = this.getSelection(); - var leadScreenPos = this.session.documentToScreenPosition(selection.getSelectionLead()); - var dest = this.session.screenToDocumentPosition(row, leadScreenPos.column); - selection.selectTo(dest.row, dest.column); - }; - - this.selectPageUp = function() { - var visibleRows = this.renderer.getScrollTopRow() - this.renderer.getScrollBottomRow(); - var row = this.$getPageUpRow() + Math.round(visibleRows / 2); - - this.scrollPageUp(); - - var selection = this.getSelection(); - var leadScreenPos = this.session.documentToScreenPosition(selection.getSelectionLead()); - var dest = this.session.screenToDocumentPosition(row, leadScreenPos.column); - selection.selectTo(dest.row, dest.column); - }; - - this.gotoPageDown = function() { - var row = this.$getPageDownRow(); - var column = this.getCursorPositionScreen().column; - - this.scrollToRow(row); - this.getSelection().moveCursorToScreen(row, column); - }; - - this.gotoPageUp = function() { - var row = this.$getPageUpRow(); - var column = this.getCursorPositionScreen().column; - - this.scrollToRow(row); - this.getSelection().moveCursorToScreen(row, column); - }; - - this.scrollPageDown = function() { - this.scrollToRow(this.$getPageDownRow()); - }; - - this.scrollPageUp = function() { - this.renderer.scrollToRow(this.$getPageUpRow()); - }; - - this.scrollToRow = function(row) { - this.renderer.scrollToRow(row); - }; - - this.scrollToLine = function(line, center) { - this.renderer.scrollToLine(line, center); - }; - - this.centerSelection = function() { - var range = this.getSelectionRange(); - var line = Math.floor(range.start.row + (range.end.row - range.start.row) / 2); - this.renderer.scrollToLine(line, true); - }; - - this.getCursorPosition = function() { - return this.selection.getCursor(); - }; - - this.getCursorPositionScreen = function() { - return this.session.documentToScreenPosition(this.getCursorPosition()); - }; - - this.getSelectionRange = function() { - return this.selection.getRange(); - }; - - - this.selectAll = function() { - this.$blockScrolling += 1; - this.selection.selectAll(); - this.$blockScrolling -= 1; - }; - - this.clearSelection = function() { - this.selection.clearSelection(); - }; - - this.moveCursorTo = function(row, column) { - this.selection.moveCursorTo(row, column); - }; - - this.moveCursorToPosition = function(pos) { - this.selection.moveCursorToPosition(pos); - }; - - - this.gotoLine = function(lineNumber, column) { - this.selection.clearSelection(); - - this.$blockScrolling += 1; - this.moveCursorTo(lineNumber-1, column || 0); - this.$blockScrolling -= 1; - - if (!this.isRowVisible(this.getCursorPosition().row)) { - this.scrollToLine(lineNumber, true); - } - }; - - this.navigateTo = function(row, column) { - this.clearSelection(); - this.moveCursorTo(row, column); - }; - - this.navigateUp = function(times) { - this.selection.clearSelection(); - times = times || 1; - this.selection.moveCursorBy(-times, 0); - }; - - this.navigateDown = function(times) { - this.selection.clearSelection(); - times = times || 1; - this.selection.moveCursorBy(times, 0); - }; - - this.navigateLeft = function(times) { - if (!this.selection.isEmpty()) { - var selectionStart = this.getSelectionRange().start; - this.moveCursorToPosition(selectionStart); - } - else { - times = times || 1; - while (times--) { - this.selection.moveCursorLeft(); - } - } - this.clearSelection(); - }; - - this.navigateRight = function(times) { - if (!this.selection.isEmpty()) { - var selectionEnd = this.getSelectionRange().end; - this.moveCursorToPosition(selectionEnd); - } - else { - times = times || 1; - while (times--) { - this.selection.moveCursorRight(); - } - } - this.clearSelection(); - }; - - this.navigateLineStart = function() { - this.selection.moveCursorLineStart(); - this.clearSelection(); - }; - - this.navigateLineEnd = function() { - this.selection.moveCursorLineEnd(); - this.clearSelection(); - }; - - this.navigateFileEnd = function() { - this.selection.moveCursorFileEnd(); - this.clearSelection(); - }; - - this.navigateFileStart = function() { - this.selection.moveCursorFileStart(); - this.clearSelection(); - }; - - this.navigateWordRight = function() { - this.selection.moveCursorWordRight(); - this.clearSelection(); - }; - - this.navigateWordLeft = function() { - this.selection.moveCursorWordLeft(); - this.clearSelection(); - }; - - this.replace = function(replacement, options) { - if (options) - this.$search.set(options); - - var range = this.$search.find(this.session); - if (!range) - return; - - this.$tryReplace(range, replacement); - if (range !== null) - this.selection.setSelectionRange(range); - }; - - this.replaceAll = function(replacement, options) { - if (options) { - this.$search.set(options); - } - - var ranges = this.$search.findAll(this.session); - if (!ranges.length) - return; - - var selection = this.getSelectionRange(); - this.clearSelection(); - this.selection.moveCursorTo(0, 0); - - this.$blockScrolling += 1; - for (var i = ranges.length - 1; i >= 0; --i) - this.$tryReplace(ranges[i], replacement); - - this.selection.setSelectionRange(selection); - this.$blockScrolling -= 1; - }; - - this.$tryReplace = function(range, replacement) { - var input = this.session.getTextRange(range); - replacement = this.$search.replace(input, replacement); - if (replacement !== null) { - range.end = this.session.replace(range, replacement); - return range; - } else { - return null; - } - }; - - this.getLastSearchOptions = function() { - return this.$search.getOptions(); - }; - - this.find = function(needle, options) { - this.clearSelection(); - options = options || {}; - options.needle = needle; - this.$search.set(options); - this.$find(); - }; - - this.findNext = function(options) { - options = options || {}; - if (typeof options.backwards == "undefined") - options.backwards = false; - this.$search.set(options); - this.$find(); - }; - - this.findPrevious = function(options) { - options = options || {}; - if (typeof options.backwards == "undefined") - options.backwards = true; - this.$search.set(options); - this.$find(); - }; - - this.$find = function(backwards) { - if (!this.selection.isEmpty()) { - this.$search.set({needle: this.session.getTextRange(this.getSelectionRange())}); - } - - if (typeof backwards != "undefined") - this.$search.set({backwards: backwards}); - - var range = this.$search.find(this.session); - if (range) { - this.gotoLine(range.end.row+1, range.end.column); - this.selection.setSelectionRange(range); - } - }; - - this.undo = function() { - this.session.getUndoManager().undo(); - }; - - this.redo = function() { - this.session.getUndoManager().redo(); - }; - - this.destroy = function() { - this.renderer.destroy(); - }; - -}).call(Editor.prototype); - - -exports.Editor = Editor; -}); - - -define("ace/virtual_renderer",[], function(require, exports, module) { - -var oop = require("ace/lib/oop"); -var dom = require("ace/lib/dom"); -var event = require("ace/lib/event"); -var useragent = require("ace/lib/useragent"); -var GutterLayer = require("ace/layer/gutter").Gutter; -var MarkerLayer = require("ace/layer/marker").Marker; -var TextLayer = require("ace/layer/text").Text; -var CursorLayer = require("ace/layer/cursor").Cursor; -var ScrollBar = require("ace/scrollbar").ScrollBar; -var RenderLoop = require("ace/renderloop").RenderLoop; -var EventEmitter = require("ace/lib/event_emitter").EventEmitter; -var editorCss = require("ace/css/editor.css"); - -var VirtualRenderer = function(container, theme) { - this.container = container; - - // Imports CSS once per DOM document ('ace_editor' serves as an identifier). - dom.importCssString(editorCss, "ace_editor", container.ownerDocument); - dom.addCssClass(this.container, "ace_editor"); - - this.setTheme(theme); - - this.$gutter = dom.createElement("div"); - this.$gutter.className = "ace_gutter"; - this.container.appendChild(this.$gutter); - - this.scroller = dom.createElement("div"); - this.scroller.className = "ace_scroller"; - this.container.appendChild(this.scroller); - - this.content = dom.createElement("div"); - this.content.className = "ace_content"; - this.scroller.appendChild(this.content); - - this.$gutterLayer = new GutterLayer(this.$gutter); - this.$markerBack = new MarkerLayer(this.content); - - var textLayer = this.$textLayer = new TextLayer(this.content); - this.canvas = textLayer.element; - - this.$markerFront = new MarkerLayer(this.content); - - this.characterWidth = textLayer.getCharacterWidth(); - this.lineHeight = textLayer.getLineHeight(); - - this.$cursorLayer = new CursorLayer(this.content); - this.$cursorPadding = 8; - - // Indicates whether the horizontal scrollbar is visible - this.$horizScroll = true; - this.$horizScrollAlwaysVisible = true; - - this.scrollBar = new ScrollBar(container); - this.scrollBar.addEventListener("scroll", this.onScroll.bind(this)); - - this.scrollTop = 0; - - this.cursorPos = { - row : 0, - column : 0 - }; - - var _self = this; - this.$textLayer.addEventListener("changeCharaterSize", function() { - _self.characterWidth = textLayer.getCharacterWidth(); - _self.lineHeight = textLayer.getLineHeight(); - _self.$updatePrintMargin(); - _self.onResize(true); - - _self.$loop.schedule(_self.CHANGE_FULL); - }); - event.addListener(this.$gutter, "click", this.$onGutterClick.bind(this)); - event.addListener(this.$gutter, "dblclick", this.$onGutterClick.bind(this)); - - this.$size = { - width: 0, - height: 0, - scrollerHeight: 0, - scrollerWidth: 0 - }; - - this.layerConfig = { - width : 1, - padding : 0, - firstRow : 0, - firstRowScreen: 0, - lastRow : 0, - lineHeight : 1, - characterWidth : 1, - minHeight : 1, - maxHeight : 1, - offset : 0, - height : 1 - }; - - this.$loop = new RenderLoop( - this.$renderChanges.bind(this), - this.container.ownerDocument.defaultView - ); - this.$loop.schedule(this.CHANGE_FULL); - - this.setPadding(4); - this.$updatePrintMargin(); -}; - -(function() { - this.showGutter = true; - - this.CHANGE_CURSOR = 1; - this.CHANGE_MARKER = 2; - this.CHANGE_GUTTER = 4; - this.CHANGE_SCROLL = 8; - this.CHANGE_LINES = 16; - this.CHANGE_TEXT = 32; - this.CHANGE_SIZE = 64; - this.CHANGE_MARKER_BACK = 128; - this.CHANGE_MARKER_FRONT = 256; - this.CHANGE_FULL = 512; - - oop.implement(this, EventEmitter); - - this.setSession = function(session) { - this.session = session; - this.$cursorLayer.setSession(session); - this.$markerBack.setSession(session); - this.$markerFront.setSession(session); - this.$gutterLayer.setSession(session); - this.$textLayer.setSession(session); - this.$loop.schedule(this.CHANGE_FULL); - }; - - /** - * Triggers partial update of the text layer - */ - this.updateLines = function(firstRow, lastRow) { - if (lastRow === undefined) - lastRow = Infinity; - - if (!this.$changedLines) { - this.$changedLines = { - firstRow: firstRow, - lastRow: lastRow - }; - } - else { - if (this.$changedLines.firstRow > firstRow) - this.$changedLines.firstRow = firstRow; - - if (this.$changedLines.lastRow < lastRow) - this.$changedLines.lastRow = lastRow; - } - - this.$loop.schedule(this.CHANGE_LINES); - }; - - /** - * Triggers full update of the text layer - */ - this.updateText = function() { - this.$loop.schedule(this.CHANGE_TEXT); - }; - - /** - * Triggers a full update of all layers - */ - this.updateFull = function() { - this.$loop.schedule(this.CHANGE_FULL); - }; - - this.updateFontSize = function() { - this.$textLayer.checkForSizeChanges(); - }; - - /** - * Triggers resize of the editor - */ - this.onResize = function(force) { - var changes = this.CHANGE_SIZE; - var size = this.$size; - - var height = dom.getInnerHeight(this.container); - if (force || size.height != height) { - size.height = height; - - this.scroller.style.height = height + "px"; - size.scrollerHeight = this.scroller.clientHeight; - this.scrollBar.setHeight(size.scrollerHeight); - - if (this.session) { - this.scrollToY(this.getScrollTop()); - changes = changes | this.CHANGE_FULL; - } - } - - var width = dom.getInnerWidth(this.container); - if (force || size.width != width) { - size.width = width; - - var gutterWidth = this.showGutter ? this.$gutter.offsetWidth : 0; - this.scroller.style.left = gutterWidth + "px"; - size.scrollerWidth = Math.max(0, width - gutterWidth - this.scrollBar.getWidth()) - this.scroller.style.width = size.scrollerWidth + "px"; - - if (this.session.getUseWrapMode() && this.adjustWrapLimit() || force) - changes = changes | this.CHANGE_FULL; - } - - this.$loop.schedule(changes); - }; - - this.adjustWrapLimit = function(){ - var availableWidth = this.$size.scrollerWidth - this.$padding * 2; - var limit = Math.floor(availableWidth / this.characterWidth) - 1; - return this.session.adjustWrapLimit(limit); - }; - - this.$onGutterClick = function(e) { - var pageX = event.getDocumentX(e); - var pageY = event.getDocumentY(e); - - this._dispatchEvent("gutter" + e.type, { - row: this.screenToTextCoordinates(pageX, pageY).row, - htmlEvent: e - }); - }; - - this.setShowInvisibles = function(showInvisibles) { - if (this.$textLayer.setShowInvisibles(showInvisibles)) - this.$loop.schedule(this.CHANGE_TEXT); - }; - - this.getShowInvisibles = function() { - return this.$textLayer.showInvisibles; - }; - - this.$showPrintMargin = true; - this.setShowPrintMargin = function(showPrintMargin) { - this.$showPrintMargin = showPrintMargin; - this.$updatePrintMargin(); - }; - - this.getShowPrintMargin = function() { - return this.$showPrintMargin; - }; - - this.$printMarginColumn = 80; - this.setPrintMarginColumn = function(showPrintMargin) { - this.$printMarginColumn = showPrintMargin; - this.$updatePrintMargin(); - }; - - this.getPrintMarginColumn = function() { - return this.$printMarginColumn; - }; - - this.getShowGutter = function(){ - return this.showGutter; - }; - - this.setShowGutter = function(show){ - if(this.showGutter === show) - return; - this.$gutter.style.display = show ? "block" : "none"; - this.showGutter = show; - this.onResize(true); - }; - - this.$updatePrintMargin = function() { - var containerEl; - - if (!this.$showPrintMargin && !this.$printMarginEl) - return; - - if (!this.$printMarginEl) { - containerEl = dom.createElement("div"); - containerEl.className = "ace_print_margin_layer"; - this.$printMarginEl = dom.createElement("div"); - this.$printMarginEl.className = "ace_print_margin"; - containerEl.appendChild(this.$printMarginEl); - this.content.insertBefore(containerEl, this.$textLayer.element); - } - - var style = this.$printMarginEl.style; - style.left = ((this.characterWidth * this.$printMarginColumn) + this.$padding * 2) + "px"; - style.visibility = this.$showPrintMargin ? "visible" : "hidden"; - }; - - this.getContainerElement = function() { - return this.container; - }; - - this.getMouseEventTarget = function() { - return this.content; - }; - - this.getTextAreaContainer = function() { - return this.container; - }; - - this.moveTextAreaToCursor = function(textarea) { - // in IE the native cursor always shines through - // this persists in IE9 - if (useragent.isIE) - return; - - var pos = this.$cursorLayer.getPixelPosition(); - if (!pos) - return; - - var bounds = this.content.getBoundingClientRect(); - var offset = this.layerConfig.offset; - - textarea.style.left = (bounds.left + pos.left + this.$padding) + "px"; - textarea.style.top = (bounds.top + pos.top - this.scrollTop + offset) + "px"; - }; - - this.getFirstVisibleRow = function() { - return this.layerConfig.firstRow; - }; - - this.getFirstFullyVisibleRow = function() { - return this.layerConfig.firstRow + (this.layerConfig.offset === 0 ? 0 : 1); - }; - - this.getLastFullyVisibleRow = function() { - var flint = Math.floor((this.layerConfig.height + this.layerConfig.offset) / this.layerConfig.lineHeight); - return this.layerConfig.firstRow - 1 + flint; - }; - - this.getLastVisibleRow = function() { - return this.layerConfig.lastRow; - }; - - this.$padding = null; - this.setPadding = function(padding) { - this.$padding = padding; - this.$textLayer.setPadding(padding); - this.$cursorLayer.setPadding(padding); - this.$markerFront.setPadding(padding); - this.$markerBack.setPadding(padding); - this.$loop.schedule(this.CHANGE_FULL); - this.$updatePrintMargin(); - }; - - this.getHScrollBarAlwaysVisible = function() { - return this.$horizScrollAlwaysVisible; - }; - - this.setHScrollBarAlwaysVisible = function(alwaysVisible) { - if (this.$horizScrollAlwaysVisible != alwaysVisible) { - this.$horizScrollAlwaysVisible = alwaysVisible; - if (!this.$horizScrollAlwaysVisible || !this.$horizScroll) - this.$loop.schedule(this.CHANGE_SCROLL); - } - }; - - this.onScroll = function(e) { - this.scrollToY(e.data); - }; - - this.$updateScrollBar = function() { - this.scrollBar.setInnerHeight(this.layerConfig.maxHeight); - this.scrollBar.setScrollTop(this.scrollTop); - }; - - this.$renderChanges = function(changes) { - if (!changes || !this.session) - return; - - // text, scrolling and resize changes can cause the view port size to change - if (changes & this.CHANGE_FULL || - changes & this.CHANGE_SIZE || - changes & this.CHANGE_TEXT || - changes & this.CHANGE_LINES || - changes & this.CHANGE_SCROLL - ) - this.$computeLayerConfig(); - - // full - if (changes & this.CHANGE_FULL) { - this.$textLayer.update(this.layerConfig); - if (this.showGutter) - this.$gutterLayer.update(this.layerConfig); - this.$markerBack.update(this.layerConfig); - this.$markerFront.update(this.layerConfig); - this.$cursorLayer.update(this.layerConfig); - this.$updateScrollBar(); - return; - } - - // scrolling - if (changes & this.CHANGE_SCROLL) { - if (changes & this.CHANGE_TEXT || changes & this.CHANGE_LINES) - this.$textLayer.update(this.layerConfig); - else - this.$textLayer.scrollLines(this.layerConfig); - - if (this.showGutter) - this.$gutterLayer.update(this.layerConfig); - this.$markerBack.update(this.layerConfig); - this.$markerFront.update(this.layerConfig); - this.$cursorLayer.update(this.layerConfig); - this.$updateScrollBar(); - return; - } - - if (changes & this.CHANGE_TEXT) { - this.$textLayer.update(this.layerConfig); - if (this.showGutter) - this.$gutterLayer.update(this.layerConfig); - } - else if (changes & this.CHANGE_LINES) { - this.$updateLines(); - this.$updateScrollBar(); - if (this.showGutter) - this.$gutterLayer.update(this.layerConfig); - } else if (changes & this.CHANGE_GUTTER) { - if (this.showGutter) - this.$gutterLayer.update(this.layerConfig); - } - - if (changes & this.CHANGE_CURSOR) - this.$cursorLayer.update(this.layerConfig); - - if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_FRONT)) { - this.$markerFront.update(this.layerConfig); - } - - if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_BACK)) { - this.$markerBack.update(this.layerConfig); - } - - if (changes & this.CHANGE_SIZE) - this.$updateScrollBar(); - }; - - this.$computeLayerConfig = function() { - var session = this.session; - - var offset = this.scrollTop % this.lineHeight; - var minHeight = this.$size.scrollerHeight + this.lineHeight; - - var longestLine = this.$getLongestLine(); - var widthChanged = this.layerConfig.width != longestLine; - - var horizScroll = this.$horizScrollAlwaysVisible || this.$size.scrollerWidth - longestLine < 0; - var horizScrollChanged = this.$horizScroll !== horizScroll; - this.$horizScroll = horizScroll; - if (horizScrollChanged) - this.scroller.style.overflowX = horizScroll ? "scroll" : "hidden"; - - var maxHeight = this.session.getScreenLength() * this.lineHeight; - this.scrollTop = Math.max(0, Math.min(this.scrollTop, maxHeight - this.$size.scrollerHeight)); - - var lineCount = Math.ceil(minHeight / this.lineHeight) - 1; - var firstRow = Math.max(0, Math.round((this.scrollTop - offset) / this.lineHeight)); - var lastRow = firstRow + lineCount; - - // Map lines on the screen to lines in the document. - var firstRowScreen, firstRowHeight; - var lineHeight = { lineHeight: this.lineHeight }; - firstRow = session.screenToDocumentRow(firstRow, 0); - - // Check if firstRow is inside of a foldLine. If true, then use the first - // row of the foldLine. - var foldLine = session.getFoldLine(firstRow); - if (foldLine) { - firstRow = foldLine.start.row; - } - - firstRowScreen = session.documentToScreenRow(firstRow, 0); - firstRowHeight = session.getRowHeight(lineHeight, firstRow); - - lastRow = Math.min(session.screenToDocumentRow(lastRow, 0), session.getLength() - 1); - minHeight = this.$size.scrollerHeight + session.getRowHeight(lineHeight, lastRow)+ - firstRowHeight; - - offset = this.scrollTop - firstRowScreen * this.lineHeight; - - this.layerConfig = { - width : longestLine, - padding : this.$padding, - firstRow : firstRow, - firstRowScreen: firstRowScreen, - lastRow : lastRow, - lineHeight : this.lineHeight, - characterWidth : this.characterWidth, - minHeight : minHeight, - maxHeight : maxHeight, - offset : offset, - height : this.$size.scrollerHeight - }; - - // For debugging. - // console.log(JSON.stringify(this.layerConfig)); - - this.$gutterLayer.element.style.marginTop = (-offset) + "px"; - this.content.style.marginTop = (-offset) + "px"; - this.content.style.width = longestLine + "px"; - this.content.style.height = minHeight + "px"; - - // scroller.scrollWidth was smaller than scrollLeft we needed - if (this.$desiredScrollLeft) { - this.scrollToX(this.$desiredScrollLeft); - this.$desiredScrollLeft = 0; - } - - // Horizontal scrollbar visibility may have changed, which changes - // the client height of the scroller - if (horizScrollChanged) - this.onResize(true); - }; - - this.$updateLines = function() { - var firstRow = this.$changedLines.firstRow; - var lastRow = this.$changedLines.lastRow; - this.$changedLines = null; - - var layerConfig = this.layerConfig; - - // if the update changes the width of the document do a full redraw - if (layerConfig.width != this.$getLongestLine()) - return this.$textLayer.update(layerConfig); - - if (firstRow > layerConfig.lastRow + 1) { return; } - if (lastRow < layerConfig.firstRow) { return; } - - // if the last row is unknown -> redraw everything - if (lastRow === Infinity) { - if (this.showGutter) - this.$gutterLayer.update(layerConfig); - this.$textLayer.update(layerConfig); - return; - } - - // else update only the changed rows - this.$textLayer.updateLines(layerConfig, firstRow, lastRow); - }; - - this.$getLongestLine = function() { - var charCount = this.session.getScreenWidth() + 1; - if (this.$textLayer.showInvisibles) - charCount += 1; - - return Math.max(this.$size.scrollerWidth, Math.round(charCount * this.characterWidth)); - }; - - this.updateFrontMarkers = function() { - this.$markerFront.setMarkers(this.session.getMarkers(true)); - this.$loop.schedule(this.CHANGE_MARKER_FRONT); - }; - - this.updateBackMarkers = function() { - this.$markerBack.setMarkers(this.session.getMarkers()); - this.$loop.schedule(this.CHANGE_MARKER_BACK); - }; - - this.addGutterDecoration = function(row, className){ - this.$gutterLayer.addGutterDecoration(row, className); - this.$loop.schedule(this.CHANGE_GUTTER); - }; - - this.removeGutterDecoration = function(row, className){ - this.$gutterLayer.removeGutterDecoration(row, className); - this.$loop.schedule(this.CHANGE_GUTTER); - }; - - this.setBreakpoints = function(rows) { - this.$gutterLayer.setBreakpoints(rows); - this.$loop.schedule(this.CHANGE_GUTTER); - }; - - this.setAnnotations = function(annotations) { - this.$gutterLayer.setAnnotations(annotations); - this.$loop.schedule(this.CHANGE_GUTTER); - }; - - this.updateCursor = function() { - this.$loop.schedule(this.CHANGE_CURSOR); - }; - - this.hideCursor = function() { - this.$cursorLayer.hideCursor(); - }; - - this.showCursor = function() { - this.$cursorLayer.showCursor(); - }; - - this.scrollCursorIntoView = function() { - // the editor is not visible - if (this.$size.scrollerHeight === 0) - return; - - var pos = this.$cursorLayer.getPixelPosition(); - - var left = pos.left; - var top = pos.top; - - if (this.scrollTop > top) { - this.scrollToY(top); - } - - if (this.scrollTop + this.$size.scrollerHeight < top + this.lineHeight) { - this.scrollToY(top + this.lineHeight - this.$size.scrollerHeight); - } - - var scrollLeft = this.scroller.scrollLeft; - - if (scrollLeft > left) { - this.scrollToX(left); - } - - if (scrollLeft + this.$size.scrollerWidth < left + this.characterWidth) { - if (left > this.layerConfig.width) - this.$desiredScrollLeft = left + 2 * this.characterWidth; - else - this.scrollToX(Math.round(left + this.characterWidth - this.$size.scrollerWidth)); - } - }; - - this.getScrollTop = function() { - return this.scrollTop; - }; - - this.getScrollLeft = function() { - return this.scroller.scrollLeft; - }; - - this.getScrollTopRow = function() { - return this.scrollTop / this.lineHeight; - }; - - this.getScrollBottomRow = function() { - return Math.max(0, Math.floor((this.scrollTop + this.$size.scrollerHeight) / this.lineHeight) - 1); - }; - - this.scrollToRow = function(row) { - this.scrollToY(row * this.lineHeight); - }; - - this.scrollToLine = function(line, center) { - var lineHeight = { lineHeight: this.lineHeight }; - var offset = 0; - for (var l = 1; l < line; l++) { - offset += this.session.getRowHeight(lineHeight, l-1); - } - - if (center) { - offset -= this.$size.scrollerHeight / 2; - } - this.scrollToY(offset); - }; - - this.scrollToY = function(scrollTop) { - // after calling scrollBar.setScrollTop - // scrollbar sends us event with same scrollTop. ignore it - scrollTop = Math.max(0, scrollTop); - if (this.scrollTop !== scrollTop) { - this.$loop.schedule(this.CHANGE_SCROLL); - this.scrollTop = scrollTop; - } - }; - - this.scrollToX = function(scrollLeft) { - if (scrollLeft <= this.$padding) - scrollLeft = 0; - - this.scroller.scrollLeft = scrollLeft; - }; - - this.scrollBy = function(deltaX, deltaY) { - deltaY && this.scrollToY(this.scrollTop + deltaY); - deltaX && this.scrollToX(this.scroller.scrollLeft + deltaX); - }; - - this.isScrollableBy = function(deltaX, deltaY) { - if (deltaY < 0 && this.scrollTop > 0) - return true; - if (deltaY > 0 && this.scrollTop + this.$size.scrollerHeight < this.layerConfig.maxHeight) - return true; - // todo: handle horizontal scrolling - }; - - this.screenToTextCoordinates = function(pageX, pageY) { - var canvasPos = this.scroller.getBoundingClientRect(); - - var col = Math.round((pageX + this.scroller.scrollLeft - canvasPos.left - this.$padding - dom.getPageScrollLeft()) - / this.characterWidth); - var row = Math.floor((pageY + this.scrollTop - canvasPos.top - dom.getPageScrollTop()) - / this.lineHeight); - - return this.session.screenToDocumentPosition(row, Math.max(col, 0)); - }; - - this.textToScreenCoordinates = function(row, column) { - var canvasPos = this.scroller.getBoundingClientRect(); - var pos = this.session.documentToScreenPosition(row, column); - - var x = this.$padding + Math.round(pos.column * this.characterWidth); - var y = pos.row * this.lineHeight; - - return { - pageX: canvasPos.left + x - this.getScrollLeft(), - pageY: canvasPos.top + y - this.getScrollTop() - }; - }; - - this.visualizeFocus = function() { - dom.addCssClass(this.container, "ace_focus"); - }; - - this.visualizeBlur = function() { - dom.removeCssClass(this.container, "ace_focus"); - }; - - this.showComposition = function(position) { - if (!this.$composition) { - this.$composition = dom.createElement("div"); - this.$composition.className = "ace_composition"; - this.content.appendChild(this.$composition); - } - - this.$composition.innerHTML = " "; - - var pos = this.$cursorLayer.getPixelPosition(); - var style = this.$composition.style; - style.top = pos.top + "px"; - style.left = (pos.left + this.$padding) + "px"; - style.height = this.lineHeight + "px"; - - this.hideCursor(); - }; - - this.setCompositionText = function(text) { - dom.setInnerText(this.$composition, text); - }; - - this.hideComposition = function() { - this.showCursor(); - - if (!this.$composition) - return; - - var style = this.$composition.style; - style.top = "-10000px"; - style.left = "-10000px"; - }; - - this.setTheme = function(theme) { - var _self = this; - - this.$themeValue = theme; - if (!theme || typeof theme == "string") { - theme = theme || "ace/theme/textmate"; - require([theme], function(theme) { - afterLoad(theme); - }); - } else { - afterLoad(theme); - } - - function afterLoad(theme) { - dom.importCssString( - theme.cssText, - theme.cssClass, - _self.container.ownerDocument - ); - - if (_self.$theme) - dom.removeCssClass(_self.container, _self.$theme); - - _self.$theme = theme ? theme.cssClass : null; - - if (_self.$theme) - dom.addCssClass(_self.container, _self.$theme); - - // force re-measure of the gutter width - if (_self.$size) { - _self.$size.width = 0; - _self.onResize(); - } - } - }; - - this.getTheme = function() { - return this.$themeValue; - }; - - // Methods allows to add / remove CSS classnames to the editor element. - // This feature can be used by plug-ins to provide a visual indication of - // a certain mode that editor is in. - - this.setStyle = function setStyle(style) { - dom.addCssClass(this.container, style); - }; - - this.unsetStyle = function unsetStyle(style) { - dom.removeCssClass(this.container, style); - }; - - this.destroy = function() { - this.$textLayer.destroy(); - this.$cursorLayer.destroy(); - }; - -}).call(VirtualRenderer.prototype); - -exports.VirtualRenderer = VirtualRenderer; -}); - - -define("ace/undomanager",[], function(require, exports, module) { - -var UndoManager = function() { - this.reset(); -}; - -(function() { - - this.execute = function(options) { - var deltas = options.args[0]; - this.$doc = options.args[1]; - this.$undoStack.push(deltas); - this.$redoStack = []; - }; - - this.undo = function(dontSelect) { - var deltas = this.$undoStack.pop(); - var undoSelectionRange = null; - if (deltas) { - undoSelectionRange = - this.$doc.undoChanges(deltas, dontSelect); - this.$redoStack.push(deltas); - } - return undoSelectionRange; - }; - - this.redo = function(dontSelect) { - var deltas = this.$redoStack.pop(); - var redoSelectionRange = null; - if (deltas) { - redoSelectionRange = - this.$doc.redoChanges(deltas, dontSelect); - this.$undoStack.push(deltas); - } - return redoSelectionRange; - }; - - this.reset = function() { - this.$undoStack = []; - this.$redoStack = []; - }; - - this.hasUndo = function() { - return this.$undoStack.length > 0; - }; - - this.hasRedo = function() { - return this.$redoStack.length > 0; - }; - -}).call(UndoManager.prototype); - -exports.UndoManager = UndoManager; -}); - - -define("ace/theme/textmate",[], function(require, exports, module) { - - -exports.cssClass = "ace-tm"; -exports.cssText = ".ace-tm .ace_editor {\ - border: 2px solid rgb(159, 159, 159);\ -}\ -\ -.ace-tm .ace_editor.ace_focus {\ - border: 2px solid #327fbd;\ -}\ -\ -.ace-tm .ace_gutter {\ - width: 50px;\ - background: #e8e8e8;\ - color: #333;\ - overflow : hidden;\ -}\ -\ -.ace-tm .ace_gutter-layer {\ - width: 100%;\ - text-align: right;\ -}\ -\ -.ace-tm .ace_gutter-layer .ace_gutter-cell {\ - padding-right: 6px;\ -}\ -\ -.ace-tm .ace_print_margin {\ - width: 1px;\ - background: #e8e8e8;\ -}\ -\ -.ace-tm .ace_text-layer {\ - cursor: text;\ -}\ -\ -.ace-tm .ace_cursor {\ - border-left: 2px solid black;\ -}\ -\ -.ace-tm .ace_cursor.ace_overwrite {\ - border-left: 0px;\ - border-bottom: 1px solid black;\ -}\ - \ -.ace-tm .ace_line .ace_invisible {\ - color: rgb(191, 191, 191);\ -}\ -\ -.ace-tm .ace_line .ace_keyword {\ - color: blue;\ -}\ -\ -.ace-tm .ace_line .ace_constant.ace_buildin {\ - color: rgb(88, 72, 246);\ -}\ -\ -.ace-tm .ace_line .ace_constant.ace_language {\ - color: rgb(88, 92, 246);\ -}\ -\ -.ace-tm .ace_line .ace_constant.ace_library {\ - color: rgb(6, 150, 14);\ -}\ -\ -.ace-tm .ace_line .ace_invalid {\ - background-color: rgb(153, 0, 0);\ - color: white;\ -}\ -\ -.ace-tm .ace_line .ace_fold {\ - border-radius: 3px;\ -}\ -\ -.ace-tm .ace_line .ace_support.ace_function {\ - color: rgb(60, 76, 114);\ -}\ -\ -.ace-tm .ace_line .ace_support.ace_constant {\ - color: rgb(6, 150, 14);\ -}\ -\ -.ace-tm .ace_line .ace_support.ace_type,\ -.ace-tm .ace_line .ace_support.ace_class {\ - color: rgb(109, 121, 222);\ -}\ -\ -.ace-tm .ace_line .ace_keyword.ace_operator {\ - color: rgb(104, 118, 135);\ -}\ -\ -.ace-tm .ace_line .ace_string {\ - color: rgb(3, 106, 7);\ -}\ -\ -.ace-tm .ace_line .ace_comment {\ - color: rgb(76, 136, 107);\ -}\ -\ -.ace-tm .ace_line .ace_comment.ace_doc {\ - color: rgb(0, 102, 255);\ -}\ -\ -.ace-tm .ace_line .ace_comment.ace_doc.ace_tag {\ - color: rgb(128, 159, 191);\ -}\ -\ -.ace-tm .ace_line .ace_constant.ace_numeric {\ - color: rgb(0, 0, 205);\ -}\ -\ -.ace-tm .ace_line .ace_variable {\ - color: rgb(49, 132, 149);\ -}\ -\ -.ace-tm .ace_line .ace_xml_pe {\ - color: rgb(104, 104, 91);\ -}\ -\ -.ace-tm .ace_entity.ace_name.ace_function {\ - color: #0000A2;\ -}\ -\ -.ace-tm .ace_markup.ace_markupine {\ - text-decoration:underline;\ -}\ -\ -.ace-tm .ace_markup.ace_heading {\ - color: rgb(12, 7, 255);\ -}\ -\ -.ace-tm .ace_markup.ace_list {\ - color:rgb(185, 6, 144);\ -}\ -\ -.ace-tm .ace_marker-layer .ace_selection {\ - background: rgb(216, 218, 220);\ -}\ -.ace-tm.ace_focus .ace_marker-layer .ace_selection {\ - background: rgb(181, 213, 255);\ -}\ -\ -.ace-tm .ace_marker-layer .ace_step {\ - background: rgb(252, 255, 0);\ -}\ -\ -.ace-tm .ace_marker-layer .ace_stack {\ - background: rgb(164, 229, 101);\ -}\ -\ -.ace-tm .ace_marker-layer .ace_bracket {\ - margin: -1px 0 0 -1px;\ - border: 1px solid rgb(192, 192, 192);\ -}\ -\ -.ace-tm .ace_marker-layer .ace_active_line {\ - background-color: #e8e8e8\ -}\ -.ace-tm.ace_focus .ace_marker-layer .ace_active_line {\ - background: rgb(232, 242, 254);\ -}\ -\ -.ace-tm .ace_marker-layer .ace_selected_word {\ - background: rgb(250, 250, 255);\ - border: 1px solid rgb(200, 200, 250);\ -}\ -\ -.ace-tm .ace_meta.ace_tag {\ - color:rgb(28, 2, 255);\ -}\ -\ -.ace-tm .ace_string.ace_regex {\ - color: rgb(255, 0, 0)\ -}"; - -}); -define("ace/lib/regexp",[], function(require, exports, module) { - -// Based on code from: -// -// XRegExp 1.5.0 -// (c) 2007-2010 Steven Levithan -// MIT License -// -// Provides an augmented, extensible, cross-browser implementation of regular expressions, -// including support for additional syntax, flags, and methods - - //--------------------------------- - // 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; - }(); - - //--------------------------------- - // 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 (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; - }; - -});// vim: ts=4 sts=4 sw=4 expandtab -// -- kriskowal Kris Kowal Copyright (C) 2009-2011 MIT License -// -- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal Project) -// -- dantman Daniel Friesen Copyright (C) 2010 XXX TODO License or CLA -// -- fschaefer Florian Schafer Copyright (C) 2010 MIT License -// -- Gozala Irakli Gozalishvili Copyright (C) 2010 MIT License -// -- kitcambridge Kit Cambridge Copyright (C) 2011 MIT License -// -- kossnocorp Sasha Koss XXX TODO License or CLA -// -- bryanforbes Bryan Forbes XXX TODO License or CLA -// -- killdream Quildreen Motta Copyright (C) 2011 MIT Licence -// -- michaelficarra Michael Ficarra Copyright (C) 2011 3-clause BSD License -// -- sharkbrainguy Gerard Paapu Copyright (C) 2011 MIT License -// -- bbqsrc Brendan Molloy (C) 2011 Creative Commons Zero (public domain) -// -- iwyg XXX TODO License or CLA -// -- DomenicDenicola Domenic Denicola Copyright (C) 2011 MIT License -// -- xavierm02 Montillet Xavier XXX TODO License or CLA -// -- Raynos Raynos XXX TODO License or CLA -// -- samsonjs Sami Samhuri Copyright (C) 2010 MIT License -// -- rwldrn Rick Waldron Copyright (C) 2011 MIT License -// -- lexer Alexey Zakharov XXX TODO License or CLA - -/*! - Copyright (c) 2009, 280 North Inc. http://280north.com/ - MIT License. http://github.com/280north/narwhal/blob/master/README.md -*/ - -define("ace/lib/es5-shim",[], function(require, exports, module) { - -/** - * Brings an environment as close to ECMAScript 5 compliance - * as is possible with the facilities of erstwhile engines. - * - * Annotated ES5: http://es5.github.com/ (specific links below) - * ES5 Spec: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf - * - * @module - */ - -/*whatsupdoc*/ - -// -// Function -// ======== -// - -// ES-5 15.3.4.5 -// http://es5.github.com/#x15.3.4.5 - -if (!Function.prototype.bind) { - Function.prototype.bind = function bind(that) { // .length is 1 - // 1. Let Target be the this value. - var target = this; - // 2. If IsCallable(Target) is false, throw a TypeError exception. - if (typeof target != "function") - throw new TypeError(); // TODO message - // 3. Let A be a new (possibly empty) internal list of all of the - // argument values provided after thisArg (arg1, arg2 etc), in order. - // XXX slicedArgs will stand in for "A" if used - var args = slice.call(arguments, 1); // for normal call - // 4. Let F be a new native ECMAScript object. - // 11. Set the [[Prototype]] internal property of F to the standard - // built-in Function prototype object as specified in 15.3.3.1. - // 12. Set the [[Call]] internal property of F as described in - // 15.3.4.5.1. - // 13. Set the [[Construct]] internal property of F as described in - // 15.3.4.5.2. - // 14. Set the [[HasInstance]] internal property of F as described in - // 15.3.4.5.3. - var bound = function () { - - if (this instanceof bound) { - // 15.3.4.5.2 [[Construct]] - // When the [[Construct]] internal method of a function object, - // F that was created using the bind function is called with a - // list of arguments ExtraArgs, the following steps are taken: - // 1. Let target be the value of F's [[TargetFunction]] - // internal property. - // 2. If target has no [[Construct]] internal method, a - // TypeError exception is thrown. - // 3. Let boundArgs be the value of F's [[BoundArgs]] internal - // property. - // 4. Let args be a new list containing the same values as the - // list boundArgs in the same order followed by the same - // values as the list ExtraArgs in the same order. - // 5. Return the result of calling the [[Construct]] internal - // method of target providing args as the arguments. - - var F = function(){}; - F.prototype = target.prototype; - var self = new F; - - var result = target.apply( - self, - args.concat(slice.call(arguments)) - ); - if (result !== null && Object(result) === result) - return result; - return self; - - } else { - // 15.3.4.5.1 [[Call]] - // When the [[Call]] internal method of a function object, F, - // which was created using the bind function is called with a - // this value and a list of arguments ExtraArgs, the following - // steps are taken: - // 1. Let boundArgs be the value of F's [[BoundArgs]] internal - // property. - // 2. Let boundThis be the value of F's [[BoundThis]] internal - // property. - // 3. Let target be the value of F's [[TargetFunction]] internal - // property. - // 4. Let args be a new list containing the same values as the - // list boundArgs in the same order followed by the same - // values as the list ExtraArgs in the same order. - // 5. Return the result of calling the [[Call]] internal method - // of target providing boundThis as the this value and - // providing args as the arguments. - - // equiv: target.call(this, ...boundArgs, ...args) - return target.apply( - that, - args.concat(slice.call(arguments)) - ); - - } - - }; - // XXX bound.length is never writable, so don't even try - // - // 15. If the [[Class]] internal property of Target is "Function", then - // a. Let L be the length property of Target minus the length of A. - // b. Set the length own property of F to either 0 or L, whichever is - // larger. - // 16. Else set the length own property of F to 0. - // 17. Set the attributes of the length own property of F to the values - // specified in 15.3.5.1. - - // TODO - // 18. Set the [[Extensible]] internal property of F to true. - - // TODO - // 19. Let thrower be the [[ThrowTypeError]] function Object (13.2.3). - // 20. Call the [[DefineOwnProperty]] internal method of F with - // arguments "caller", PropertyDescriptor {[[Get]]: thrower, [[Set]]: - // thrower, [[Enumerable]]: false, [[Configurable]]: false}, and - // false. - // 21. Call the [[DefineOwnProperty]] internal method of F with - // arguments "arguments", PropertyDescriptor {[[Get]]: thrower, - // [[Set]]: thrower, [[Enumerable]]: false, [[Configurable]]: false}, - // and false. - - // TODO - // NOTE Function objects created using Function.prototype.bind do not - // have a prototype property or the [[Code]], [[FormalParameters]], and - // [[Scope]] internal properties. - // XXX can't delete prototype in pure-js. - - // 22. Return F. - return bound; - }; -} - -// Shortcut to an often accessed properties, in order to avoid multiple -// dereference that costs universally. -// _Please note: Shortcuts are defined after `Function.prototype.bind` as we -// us it in defining shortcuts. -var call = Function.prototype.call; -var prototypeOfArray = Array.prototype; -var prototypeOfObject = Object.prototype; -var slice = prototypeOfArray.slice; -var toString = call.bind(prototypeOfObject.toString); -var owns = call.bind(prototypeOfObject.hasOwnProperty); - -// If JS engine supports accessors creating shortcuts. -var defineGetter; -var defineSetter; -var lookupGetter; -var lookupSetter; -var supportsAccessors; -if ((supportsAccessors = owns(prototypeOfObject, "__defineGetter__"))) { - defineGetter = call.bind(prototypeOfObject.__defineGetter__); - defineSetter = call.bind(prototypeOfObject.__defineSetter__); - lookupGetter = call.bind(prototypeOfObject.__lookupGetter__); - lookupSetter = call.bind(prototypeOfObject.__lookupSetter__); -} - -// -// Array -// ===== -// - -// ES5 15.4.3.2 -// http://es5.github.com/#x15.4.3.2 -// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray -if (!Array.isArray) { - Array.isArray = function isArray(obj) { - return toString(obj) == "[object Array]"; - }; -} - -// The IsCallable() check in the Array functions -// has been replaced with a strict check on the -// internal class of the object to trap cases where -// the provided function was actually a regular -// expression literal, which in V8 and -// JavaScriptCore is a typeof "function". Only in -// V8 are regular expression literals permitted as -// reduce parameters, so it is desirable in the -// general case for the shim to match the more -// strict and common behavior of rejecting regular -// expressions. - -// ES5 15.4.4.18 -// http://es5.github.com/#x15.4.4.18 -// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/forEach -if (!Array.prototype.forEach) { - Array.prototype.forEach = function forEach(fun /*, thisp*/) { - var self = toObject(this), - thisp = arguments[1], - i = 0, - length = self.length >>> 0; - - // If no callback function or if callback is not a callable function - if (toString(fun) != "[object Function]") { - throw new TypeError(); // TODO message - } - - while (i < length) { - if (i in self) { - // Invoke the callback function with call, passing arguments: - // context, property value, property key, thisArg object context - fun.call(thisp, self[i], i, self); - } - i++; - } - }; -} - -// ES5 15.4.4.19 -// http://es5.github.com/#x15.4.4.19 -// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/map -if (!Array.prototype.map) { - Array.prototype.map = function map(fun /*, thisp*/) { - var self = toObject(this), - length = self.length >>> 0, - result = Array(length), - thisp = arguments[1]; - - // If no callback function or if callback is not a callable function - if (toString(fun) != "[object Function]") { - throw new TypeError(); // TODO message - } - - for (var i = 0; i < length; i++) { - if (i in self) - result[i] = fun.call(thisp, self[i], i, self); - } - return result; - }; -} - -// ES5 15.4.4.20 -// http://es5.github.com/#x15.4.4.20 -// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/filter -if (!Array.prototype.filter) { - Array.prototype.filter = function filter(fun /*, thisp */) { - var self = toObject(this), - length = self.length >>> 0, - result = [], - thisp = arguments[1]; - - // If no callback function or if callback is not a callable function - if (toString(fun) != "[object Function]") { - throw new TypeError(); // TODO message - } - - for (var i = 0; i < length; i++) { - if (i in self && fun.call(thisp, self[i], i, self)) - result.push(self[i]); - } - return result; - }; -} - -// ES5 15.4.4.16 -// http://es5.github.com/#x15.4.4.16 -// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/every -if (!Array.prototype.every) { - Array.prototype.every = function every(fun /*, thisp */) { - var self = toObject(this), - length = self.length >>> 0, - thisp = arguments[1]; - - // If no callback function or if callback is not a callable function - if (toString(fun) != "[object Function]") { - throw new TypeError(); // TODO message - } - - for (var i = 0; i < length; i++) { - if (i in self && !fun.call(thisp, self[i], i, self)) - return false; - } - return true; - }; -} - -// ES5 15.4.4.17 -// http://es5.github.com/#x15.4.4.17 -// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some -if (!Array.prototype.some) { - Array.prototype.some = function some(fun /*, thisp */) { - var self = toObject(this), - length = self.length >>> 0, - thisp = arguments[1]; - - // If no callback function or if callback is not a callable function - if (toString(fun) != "[object Function]") { - throw new TypeError(); // TODO message - } - - for (var i = 0; i < length; i++) { - if (i in self && fun.call(thisp, self[i], i, self)) - return true; - } - return false; - }; -} - -// ES5 15.4.4.21 -// http://es5.github.com/#x15.4.4.21 -// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduce -if (!Array.prototype.reduce) { - Array.prototype.reduce = function reduce(fun /*, initial*/) { - var self = toObject(this), - length = self.length >>> 0; - - // If no callback function or if callback is not a callable function - if (toString(fun) != "[object Function]") { - throw new TypeError(); // TODO message - } - - // no value to return if no initial value and an empty array - if (!length && arguments.length == 1) - throw new TypeError(); // TODO message - - var i = 0; - var result; - if (arguments.length >= 2) { - result = arguments[1]; - } else { - do { - if (i in self) { - result = self[i++]; - break; - } - - // if array contains no values, no initial value to return - if (++i >= length) - throw new TypeError(); // TODO message - } while (true); - } - - for (; i < length; i++) { - if (i in self) - result = fun.call(void 0, result, self[i], i, self); - } - - return result; - }; -} - -// ES5 15.4.4.22 -// http://es5.github.com/#x15.4.4.22 -// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduceRight -if (!Array.prototype.reduceRight) { - Array.prototype.reduceRight = function reduceRight(fun /*, initial*/) { - var self = toObject(this), - length = self.length >>> 0; - - // If no callback function or if callback is not a callable function - if (toString(fun) != "[object Function]") { - throw new TypeError(); // TODO message - } - - // no value to return if no initial value, empty array - if (!length && arguments.length == 1) - throw new TypeError(); // TODO message - - var result, i = length - 1; - if (arguments.length >= 2) { - result = arguments[1]; - } else { - do { - if (i in self) { - result = self[i--]; - break; - } - - // if array contains no values, no initial value to return - if (--i < 0) - throw new TypeError(); // TODO message - } while (true); - } - - do { - if (i in this) - result = fun.call(void 0, result, self[i], i, self); - } while (i--); - - return result; - }; -} - -// ES5 15.4.4.14 -// http://es5.github.com/#x15.4.4.14 -// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf -if (!Array.prototype.indexOf) { - Array.prototype.indexOf = function indexOf(sought /*, fromIndex */ ) { - var self = toObject(this), - length = self.length >>> 0; - - if (!length) - return -1; - - var i = 0; - if (arguments.length > 1) - i = toInteger(arguments[1]); - - // handle negative indices - i = i >= 0 ? i : Math.max(0, length + i); - for (; i < length; i++) { - if (i in self && self[i] === sought) { - return i; - } - } - return -1; - }; -} - -// ES5 15.4.4.15 -// http://es5.github.com/#x15.4.4.15 -// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/lastIndexOf -if (!Array.prototype.lastIndexOf) { - Array.prototype.lastIndexOf = function lastIndexOf(sought /*, fromIndex */) { - var self = toObject(this), - length = self.length >>> 0; - - if (!length) - return -1; - var i = length - 1; - if (arguments.length > 1) - i = Math.min(i, toInteger(arguments[1])); - // handle negative indices - i = i >= 0 ? i : length - Math.abs(i); - for (; i >= 0; i--) { - if (i in self && sought === self[i]) - return i; - } - return -1; - }; -} - -// -// Object -// ====== -// - -// ES5 15.2.3.2 -// http://es5.github.com/#x15.2.3.2 -if (!Object.getPrototypeOf) { - // https://github.com/kriskowal/es5-shim/issues#issue/2 - // http://ejohn.org/blog/objectgetprototypeof/ - // recommended by fschaefer on github - Object.getPrototypeOf = function getPrototypeOf(object) { - return object.__proto__ || ( - object.constructor ? - object.constructor.prototype : - prototypeOfObject - ); - }; -} - -// ES5 15.2.3.3 -// http://es5.github.com/#x15.2.3.3 -if (!Object.getOwnPropertyDescriptor) { - var ERR_NON_OBJECT = "Object.getOwnPropertyDescriptor called on a " + - "non-object: "; - Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) { - if ((typeof object != "object" && typeof object != "function") || object === null) - throw new TypeError(ERR_NON_OBJECT + object); - // If object does not owns property return undefined immediately. - if (!owns(object, property)) - return; - - var descriptor, getter, setter; - - // If object has a property then it's for sure both `enumerable` and - // `configurable`. - descriptor = { enumerable: true, configurable: true }; - - // If JS engine supports accessor properties then property may be a - // getter or setter. - if (supportsAccessors) { - // Unfortunately `__lookupGetter__` will return a getter even - // if object has own non getter property along with a same named - // inherited getter. To avoid misbehavior we temporary remove - // `__proto__` so that `__lookupGetter__` will return getter only - // if it's owned by an object. - var prototype = object.__proto__; - object.__proto__ = prototypeOfObject; - - var getter = lookupGetter(object, property); - var setter = lookupSetter(object, property); - - // Once we have getter and setter we can put values back. - object.__proto__ = prototype; - - if (getter || setter) { - if (getter) descriptor.get = getter; - if (setter) descriptor.set = setter; - - // If it was accessor property we're done and return here - // in order to avoid adding `value` to the descriptor. - return descriptor; - } - } - - // If we got this far we know that object has an own property that is - // not an accessor so we set it as a value and return descriptor. - descriptor.value = object[property]; - return descriptor; - }; -} - -// ES5 15.2.3.4 -// http://es5.github.com/#x15.2.3.4 -if (!Object.getOwnPropertyNames) { - Object.getOwnPropertyNames = function getOwnPropertyNames(object) { - return Object.keys(object); - }; -} - -// ES5 15.2.3.5 -// http://es5.github.com/#x15.2.3.5 -if (!Object.create) { - Object.create = function create(prototype, properties) { - var object; - if (prototype === null) { - object = { "__proto__": null }; - } else { - if (typeof prototype != "object") - throw new TypeError("typeof prototype["+(typeof prototype)+"] != 'object'"); - var Type = function () {}; - Type.prototype = prototype; - object = new Type(); - // IE has no built-in implementation of `Object.getPrototypeOf` - // neither `__proto__`, but this manually setting `__proto__` will - // guarantee that `Object.getPrototypeOf` will work as expected with - // objects created using `Object.create` - object.__proto__ = prototype; - } - if (properties !== void 0) - Object.defineProperties(object, properties); - return object; - }; -} - -// ES5 15.2.3.6 -// http://es5.github.com/#x15.2.3.6 - -// Patch for WebKit and IE8 standard mode -// Designed by hax -// related issue: https://github.com/kriskowal/es5-shim/issues#issue/5 -// IE8 Reference: -// http://msdn.microsoft.com/en-us/library/dd282900.aspx -// http://msdn.microsoft.com/en-us/library/dd229916.aspx -// WebKit Bugs: -// https://bugs.webkit.org/show_bug.cgi?id=36423 - -function doesDefinePropertyWork(object) { - try { - Object.defineProperty(object, "sentinel", {}); - return "sentinel" in object; - } catch (exception) { - // returns falsy - } -} - -// check whether defineProperty works if it's given. Otherwise, -// shim partially. -if (Object.defineProperty) { - var definePropertyWorksOnObject = doesDefinePropertyWork({}); - var definePropertyWorksOnDom = typeof document == "undefined" || - doesDefinePropertyWork(document.createElement("div")); - if (!definePropertyWorksOnObject || !definePropertyWorksOnDom) { - var definePropertyFallback = Object.defineProperty; - } -} - -if (!Object.defineProperty || definePropertyFallback) { - var ERR_NON_OBJECT_DESCRIPTOR = "Property description must be an object: "; - var ERR_NON_OBJECT_TARGET = "Object.defineProperty called on non-object: " - var ERR_ACCESSORS_NOT_SUPPORTED = "getters & setters can not be defined " + - "on this javascript engine"; - - Object.defineProperty = function defineProperty(object, property, descriptor) { - if ((typeof object != "object" && typeof object != "function") || object === null) - throw new TypeError(ERR_NON_OBJECT_TARGET + object); - if ((typeof descriptor != "object" && typeof descriptor != "function") || descriptor === null) - throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor); - - // make a valiant attempt to use the real defineProperty - // for I8's DOM elements. - if (definePropertyFallback) { - try { - return definePropertyFallback.call(Object, object, property, descriptor); - } catch (exception) { - // try the shim if the real one doesn't work - } - } - - // If it's a data property. - if (owns(descriptor, "value")) { - // fail silently if "writable", "enumerable", or "configurable" - // are requested but not supported - /* - // alternate approach: - if ( // can't implement these features; allow false but not true - !(owns(descriptor, "writable") ? descriptor.writable : true) || - !(owns(descriptor, "enumerable") ? descriptor.enumerable : true) || - !(owns(descriptor, "configurable") ? descriptor.configurable : true) - ) - throw new RangeError( - "This implementation of Object.defineProperty does not " + - "support configurable, enumerable, or writable." - ); - */ - - if (supportsAccessors && (lookupGetter(object, property) || - lookupSetter(object, property))) - { - // As accessors are supported only on engines implementing - // `__proto__` we can safely override `__proto__` while defining - // a property to make sure that we don't hit an inherited - // accessor. - var prototype = object.__proto__; - object.__proto__ = prototypeOfObject; - // Deleting a property anyway since getter / setter may be - // defined on object itself. - delete object[property]; - object[property] = descriptor.value; - // Setting original `__proto__` back now. - object.__proto__ = prototype; - } else { - object[property] = descriptor.value; - } - } else { - if (!supportsAccessors) - throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED); - // If we got that far then getters and setters can be defined !! - if (owns(descriptor, "get")) - defineGetter(object, property, descriptor.get); - if (owns(descriptor, "set")) - defineSetter(object, property, descriptor.set); - } - - return object; - }; -} - -// ES5 15.2.3.7 -// http://es5.github.com/#x15.2.3.7 -if (!Object.defineProperties) { - Object.defineProperties = function defineProperties(object, properties) { - for (var property in properties) { - if (owns(properties, property)) - Object.defineProperty(object, property, properties[property]); - } - return object; - }; -} - -// ES5 15.2.3.8 -// http://es5.github.com/#x15.2.3.8 -if (!Object.seal) { - Object.seal = function seal(object) { - // this is misleading and breaks feature-detection, but - // allows "securable" code to "gracefully" degrade to working - // but insecure code. - return object; - }; -} - -// ES5 15.2.3.9 -// http://es5.github.com/#x15.2.3.9 -if (!Object.freeze) { - Object.freeze = function freeze(object) { - // this is misleading and breaks feature-detection, but - // allows "securable" code to "gracefully" degrade to working - // but insecure code. - return object; - }; -} - -// detect a Rhino bug and patch it -try { - Object.freeze(function () {}); -} catch (exception) { - Object.freeze = (function freeze(freezeObject) { - return function freeze(object) { - if (typeof object == "function") { - return object; - } else { - return freezeObject(object); - } - }; - })(Object.freeze); -} - -// ES5 15.2.3.10 -// http://es5.github.com/#x15.2.3.10 -if (!Object.preventExtensions) { - Object.preventExtensions = function preventExtensions(object) { - // this is misleading and breaks feature-detection, but - // allows "securable" code to "gracefully" degrade to working - // but insecure code. - return object; - }; -} - -// ES5 15.2.3.11 -// http://es5.github.com/#x15.2.3.11 -if (!Object.isSealed) { - Object.isSealed = function isSealed(object) { - return false; - }; -} - -// ES5 15.2.3.12 -// http://es5.github.com/#x15.2.3.12 -if (!Object.isFrozen) { - Object.isFrozen = function isFrozen(object) { - return false; - }; -} - -// ES5 15.2.3.13 -// http://es5.github.com/#x15.2.3.13 -if (!Object.isExtensible) { - Object.isExtensible = function isExtensible(object) { - // 1. If Type(O) is not Object throw a TypeError exception. - if (Object(object) === object) { - throw new TypeError(); // TODO message - } - // 2. Return the Boolean value of the [[Extensible]] internal property of O. - var name = ''; - while (owns(object, name)) { - name += '?'; - } - object[name] = true; - var returnValue = owns(object, name); - delete object[name]; - return returnValue; - }; -} - -// ES5 15.2.3.14 -// http://es5.github.com/#x15.2.3.14 -if (!Object.keys) { - // http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation - var hasDontEnumBug = true, - dontEnums = [ - "toString", - "toLocaleString", - "valueOf", - "hasOwnProperty", - "isPrototypeOf", - "propertyIsEnumerable", - "constructor" - ], - dontEnumsLength = dontEnums.length; - - for (var key in {"toString": null}) - hasDontEnumBug = false; - - Object.keys = function keys(object) { - - if ((typeof object != "object" && typeof object != "function") || object === null) - throw new TypeError("Object.keys called on a non-object"); - - var keys = []; - for (var name in object) { - if (owns(object, name)) { - keys.push(name); - } - } - - if (hasDontEnumBug) { - for (var i = 0, ii = dontEnumsLength; i < ii; i++) { - var dontEnum = dontEnums[i]; - if (owns(object, dontEnum)) { - keys.push(dontEnum); - } - } - } - - return keys; - }; - -} - -// -// Date -// ==== -// - -// ES5 15.9.5.43 -// http://es5.github.com/#x15.9.5.43 -// This function returns a String value represent the instance in time -// represented by this Date object. The format of the String is the Date Time -// string format defined in 15.9.1.15. All fields are present in the String. -// The time zone is always UTC, denoted by the suffix Z. If the time value of -// this object is not a finite Number a RangeError exception is thrown. -if (!Date.prototype.toISOString || (new Date(-62198755200000).toISOString().indexOf('-000001') === -1)) { - Date.prototype.toISOString = function toISOString() { - var result, length, value, year; - if (!isFinite(this)) - throw new RangeError; - - // the date time string format is specified in 15.9.1.15. - result = [this.getUTCMonth() + 1, this.getUTCDate(), - this.getUTCHours(), this.getUTCMinutes(), this.getUTCSeconds()]; - year = this.getUTCFullYear(); - year = (year < 0 ? '-' : (year > 9999 ? '+' : '')) + ('00000' + Math.abs(year)).slice(0 <= year && year <= 9999 ? -4 : -6); - - length = result.length; - while (length--) { - value = result[length]; - // pad months, days, hours, minutes, and seconds to have two digits. - if (value < 10) - result[length] = "0" + value; - } - // pad milliseconds to have three digits. - return year + "-" + result.slice(0, 2).join("-") + "T" + result.slice(2).join(":") + "." + - ("000" + this.getUTCMilliseconds()).slice(-3) + "Z"; - } -} - -// ES5 15.9.4.4 -// http://es5.github.com/#x15.9.4.4 -if (!Date.now) { - Date.now = function now() { - return new Date().getTime(); - }; -} - -// ES5 15.9.5.44 -// http://es5.github.com/#x15.9.5.44 -// This function provides a String representation of a Date object for use by -// JSON.stringify (15.12.3). -if (!Date.prototype.toJSON) { - Date.prototype.toJSON = function toJSON(key) { - // When the toJSON method is called with argument key, the following - // steps are taken: - - // 1. Let O be the result of calling ToObject, giving it the this - // value as its argument. - // 2. Let tv be ToPrimitive(O, hint Number). - // 3. If tv is a Number and is not finite, return null. - // XXX - // 4. Let toISO be the result of calling the [[Get]] internal method of - // O with argument "toISOString". - // 5. If IsCallable(toISO) is false, throw a TypeError exception. - if (typeof this.toISOString != "function") - throw new TypeError(); // TODO message - // 6. Return the result of calling the [[Call]] internal method of - // toISO with O as the this value and an empty argument list. - return this.toISOString(); - - // NOTE 1 The argument is ignored. - - // NOTE 2 The toJSON function is intentionally generic; it does not - // require that its this value be a Date object. Therefore, it can be - // transferred to other kinds of objects for use as a method. However, - // it does require that any such object have a toISOString method. An - // object is free to use the argument key to filter its - // stringification. - }; -} - -// ES5 15.9.4.2 -// http://es5.github.com/#x15.9.4.2 -// based on work shared by Daniel Friesen (dantman) -// http://gist.github.com/303249 -if (Date.parse("+275760-09-13T00:00:00.000Z") !== 8.64e15) { - // XXX global assignment won't work in embeddings that use - // an alternate object for the context. - Date = (function(NativeDate) { - - // Date.length === 7 - var Date = function Date(Y, M, D, h, m, s, ms) { - var length = arguments.length; - if (this instanceof NativeDate) { - var date = length == 1 && String(Y) === Y ? // isString(Y) - // We explicitly pass it through parse: - new NativeDate(Date.parse(Y)) : - // We have to manually make calls depending on argument - // length here - length >= 7 ? new NativeDate(Y, M, D, h, m, s, ms) : - length >= 6 ? new NativeDate(Y, M, D, h, m, s) : - length >= 5 ? new NativeDate(Y, M, D, h, m) : - length >= 4 ? new NativeDate(Y, M, D, h) : - length >= 3 ? new NativeDate(Y, M, D) : - length >= 2 ? new NativeDate(Y, M) : - length >= 1 ? new NativeDate(Y) : - new NativeDate(); - // Prevent mixups with unfixed Date object - date.constructor = Date; - return date; - } - return NativeDate.apply(this, arguments); - }; - - // 15.9.1.15 Date Time String Format. - var isoDateExpression = new RegExp("^" + - "(\\d{4}|[\+\-]\\d{6})" + // four-digit year capture or sign + 6-digit extended year - "(?:-(\\d{2})" + // optional month capture - "(?:-(\\d{2})" + // optional day capture - "(?:" + // capture hours:minutes:seconds.milliseconds - "T(\\d{2})" + // hours capture - ":(\\d{2})" + // minutes capture - "(?:" + // optional :seconds.milliseconds - ":(\\d{2})" + // seconds capture - "(?:\\.(\\d{3}))?" + // milliseconds capture - ")?" + - "(?:" + // capture UTC offset component - "Z|" + // UTC capture - "(?:" + // offset specifier +/-hours:minutes - "([-+])" + // sign capture - "(\\d{2})" + // hours offset capture - ":(\\d{2})" + // minutes offset capture - ")" + - ")?)?)?)?" + - "$"); - - // Copy any custom methods a 3rd party library may have added - for (var key in NativeDate) - Date[key] = NativeDate[key]; - - // Copy "native" methods explicitly; they may be non-enumerable - Date.now = NativeDate.now; - Date.UTC = NativeDate.UTC; - Date.prototype = NativeDate.prototype; - Date.prototype.constructor = Date; - - // Upgrade Date.parse to handle simplified ISO 8601 strings - Date.parse = function parse(string) { - var match = isoDateExpression.exec(string); - if (match) { - match.shift(); // kill match[0], the full match - // parse months, days, hours, minutes, seconds, and milliseconds - for (var i = 1; i < 7; i++) { - // provide default values if necessary - match[i] = +(match[i] || (i < 3 ? 1 : 0)); - // match[1] is the month. Months are 0-11 in JavaScript - // `Date` objects, but 1-12 in ISO notation, so we - // decrement. - if (i == 1) - match[i]--; - } - - // parse the UTC offset component - var minuteOffset = +match.pop(), hourOffset = +match.pop(), sign = match.pop(); - - // compute the explicit time zone offset if specified - var offset = 0; - if (sign) { - // detect invalid offsets and return early - if (hourOffset > 23 || minuteOffset > 59) - return NaN; - - // express the provided time zone offset in minutes. The offset is - // negative for time zones west of UTC; positive otherwise. - offset = (hourOffset * 60 + minuteOffset) * 6e4 * (sign == "+" ? -1 : 1); - } - - // Date.UTC for years between 0 and 99 converts year to 1900 + year - // The Gregorian calendar has a 400-year cycle, so - // to Date.UTC(year + 400, .... ) - 12622780800000 == Date.UTC(year, ...), - // where 12622780800000 - number of milliseconds in Gregorian calendar 400 years - var year = +match[0]; - if (0 <= year && year <= 99) { - match[0] = year + 400; - return NativeDate.UTC.apply(this, match) + offset - 12622780800000; - } - - // compute a new UTC date value, accounting for the optional offset - return NativeDate.UTC.apply(this, match) + offset; - } - return NativeDate.parse.apply(this, arguments); - }; - - return Date; - })(Date); -} - -// -// String -// ====== -// - -// ES5 15.5.4.20 -// http://es5.github.com/#x15.5.4.20 -var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003" + - "\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" + - "\u2029\uFEFF"; -if (!String.prototype.trim || ws.trim()) { - // http://blog.stevenlevithan.com/archives/faster-trim-javascript - // http://perfectionkills.com/whitespace-deviations/ - ws = "[" + ws + "]"; - var trimBeginRegexp = new RegExp("^" + ws + ws + "*"), - trimEndRegexp = new RegExp(ws + ws + "*$"); - String.prototype.trim = function trim() { - return String(this).replace(trimBeginRegexp, "").replace(trimEndRegexp, ""); - }; -} - -// -// Util -// ====== -// - -// ES5 9.4 -// http://es5.github.com/#x9.4 -// http://jsperf.com/to-integer -var toInteger = function (n) { - n = +n; - if (n !== n) // isNaN - n = 0; - else if (n !== 0 && n !== (1/0) && n !== -(1/0)) - n = (n > 0 || -1) * Math.floor(Math.abs(n)); - return n; -}; - -var prepareString = "a"[0] != "a", - // ES5 9.9 - // http://es5.github.com/#x9.9 - toObject = function (o) { - if (o == null) { // this matches both null and undefined - throw new TypeError(); // TODO message - } - // If the implementation doesn't support by-index access of - // string characters (ex. IE < 7), split the string - if (prepareString && typeof o == "string" && o) { - return o.split(""); - } - return Object(o); - }; -}); - -define("ace/lib/oop",[], function(require, exports, module) { - -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]; - } -}; - -exports.implement = function(proto, mixin) { - exports.mixin(proto, mixin); -}; - -}); - - -define("ace/lib/event",[], function(require, exports, module) { - -var keys = require("ace/lib/keys"); -var useragent = require("ace/lib/useragent"); -var dom = require("ace/lib/dom"); - -exports.addListener = function(elem, type, callback) { - if (elem.addEventListener) { - return elem.addEventListener(type, callback, false); - } - if (elem.attachEvent) { - var wrapper = function() { - callback(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; -}; - -exports.getDocumentX = function(e) { - if (e.clientX) { - return e.clientX + dom.getPageScrollLeft(); - } else { - return e.pageX; - } -}; - -exports.getDocumentY = function(e) { - if (e.clientY) { - return e.clientY + dom.getPageScrollTop(); - } else { - return e.pageY; - } -}; - -/** - * @return {Number} 0 for left button, 1 for middle button, 2 for right button - */ -exports.getButton = function(e) { - if (e.type == "dblclick") - return 0; - else if (e.type == "contextmenu") - return 2; - - // DOM Event - if (e.preventDefault) { - return e.button; - } - // old IE - else { - return {1:0, 2:2, 4:1}[e.button]; - } -}; - -if (document.documentElement.setCapture) { - exports.capture = function(el, eventHandler, releaseCaptureHandler) { - function onMouseMove(e) { - eventHandler(e); - return exports.stopPropagation(e); - } - - var called = false; - function onReleaseCapture(e) { - eventHandler(e); - - if (!called) { - called = true; - releaseCaptureHandler(e); - } - - exports.removeListener(el, "mousemove", eventHandler); - exports.removeListener(el, "mouseup", onReleaseCapture); - exports.removeListener(el, "losecapture", onReleaseCapture); - - el.releaseCapture(); - } - - exports.addListener(el, "mousemove", eventHandler); - exports.addListener(el, "mouseup", onReleaseCapture); - exports.addListener(el, "losecapture", onReleaseCapture); - el.setCapture(); - }; -} -else { - exports.capture = function(el, eventHandler, releaseCaptureHandler) { - function onMouseMove(e) { - eventHandler(e); - e.stopPropagation(); - } - - function onMouseUp(e) { - eventHandler && eventHandler(e); - releaseCaptureHandler && releaseCaptureHandler(e); - - document.removeEventListener("mousemove", onMouseMove, true); - document.removeEventListener("mouseup", onMouseUp, true); - - e.stopPropagation(); - } - - document.addEventListener("mousemove", onMouseMove, true); - document.addEventListener("mouseup", onMouseUp, true); - }; -} - -exports.addMouseWheelListener = function(el, callback) { - var max = 0; - var listener = function(e) { - if (e.wheelDelta !== undefined) { - - // some versions of Safari (e.g. 5.0.5) report insanely high - // scroll values. These browsers require a higher factor - if (Math.abs(e.wheelDeltaY) > max) - max = Math.abs(e.wheelDeltaY) - - if (max > 5000) - factor = 400; - else - factor = 8; - - if (e.wheelDeltaX !== undefined) { - e.wheelX = -e.wheelDeltaX / factor; - e.wheelY = -e.wheelDeltaY / factor; - } else { - e.wheelX = 0; - e.wheelY = -e.wheelDelta / factor; - } - } - else { - 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.addListener(el, "DOMMouseScroll", listener); - exports.addListener(el, "mousewheel", listener); -}; - -exports.addMultiMouseDownListener = function(el, button, count, timeout, callback) { - var clicks = 0; - var startX, startY; - - var listener = function(e) { - clicks += 1; - if (clicks == 1) { - startX = e.clientX; - startY = e.clientY; - - setTimeout(function() { - clicks = 0; - }, timeout || 600); - } - - var isButton = exports.getButton(e) == button; - if (!isButton || Math.abs(e.clientX - startX) > 5 || Math.abs(e.clientY - startY) > 5) - clicks = 0; - - if (clicks == count) { - clicks = 0; - callback(e); - } - - if (isButton) - return exports.preventDefault(e); - }; - - exports.addListener(el, "mousedown", listener); - useragent.isOldIE && exports.addListener(el, "dblclick", listener); -}; - -function normalizeCommandKeys(callback, e, keyCode) { - var hashId = 0; - if (useragent.isOpera && 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 (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 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 (!(keyCode in keys.FUNCTION_KEYS) && !(keyCode in keys.PRINTABLE_KEYS)) { - return false; - } - return callback(e, hashId, keyCode); -} - -exports.addCommandKeyListener = function(el, callback) { - var addListener = exports.addListener; - if (useragent.isOldGecko) { - // 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 lastDown = null; - - addListener(el, "keydown", function(e) { - lastDown = e.keyIdentifier || e.keyCode; - return normalizeCommandKeys(callback, e, e.keyCode); - }); - - // repeated keys are fired as keypress and not keydown events - if (useragent.isMac && useragent.isOpera) { - addListener(el, "keypress", function(e) { - var keyId = e.keyIdentifier || e.keyCode; - if (lastDown !== keyId) { - return normalizeCommandKeys(callback, e, lastDown); - } else { - lastDown = null; - } - }); - } - } -}; - -}); - - -define("ace/lib/lang",[], function(require, exports, module) { - -exports.stringReverse = function(string) { - return string.split("").reverse().join(""); -}; - -exports.stringRepeat = function (string, count) { - return new Array(count + 1).join(string); -}; - -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 (i=0, l=array.length; i= 0; - -exports.isIPad = ua.indexOf("iPad") >= 0; - -exports.isTouchPad = ua.indexOf("TouchPad") >= 0; - -/** - * 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']; - } -}; - -}); - - -define("ace/keyboard/textinput",[], function(require, exports, module) { - -var event = require("ace/lib/event"); -var useragent = require("ace/lib/useragent"); -var dom = require("ace/lib/dom"); - -var TextInput = function(parentNode, host) { - - var text = dom.createElement("textarea"); - if (useragent.isTouchPad) - text.setAttribute("x-palm-disable-auto-cap", true); - - text.style.left = "-10000px"; - parentNode.appendChild(text); - - var PLACEHOLDER = String.fromCharCode(0); - sendText(); - - var inCompostion = false; - var copied = false; - var pasted = false; - var tempStyle = ''; - - function select() { - try { - text.select(); - } catch (e) {} - } - - function sendText(valueToSend) { - if (!copied) { - var value = valueToSend || text.value; - if (value) { - if (value.charCodeAt(value.length-1) == PLACEHOLDER.charCodeAt(0)) { - value = value.slice(0, -1); - if (value) - host.onTextInput(value, !pasted); - } - else { - host.onTextInput(value, !pasted); - } - - // If editor is no longer focused we quit immediately, since - // it means that something else is in charge now. - if (!isFocused()) - return false; - } - } - - copied = false; - pasted = false; - - // Safari doesn't fire copy events if no text is selected - text.value = PLACEHOLDER; - select(); - } - - var onTextInput = function(e) { - setTimeout(function () { - if (!inCompostion) - sendText(e.data); - }, 0); - }; - - var onPropertyChange = function(e) { - if (useragent.isOldIE && text.value.charCodeAt(0) > 128) return; - setTimeout(function() { - if (!inCompostion) - sendText(); - }, 0); - }; - - var onCompositionStart = function(e) { - inCompostion = true; - host.onCompositionStart(); - if (!useragent.isGecko) setTimeout(onCompositionUpdate, 0); - }; - - var onCompositionUpdate = function() { - if (!inCompostion) return; - host.onCompositionUpdate(text.value); - }; - - var onCompositionEnd = function(e) { - inCompostion = false; - host.onCompositionEnd(); - }; - - var onCopy = function(e) { - copied = true; - var copyText = host.getCopyText(); - if(copyText) - text.value = copyText; - else - e.preventDefault(); - select(); - setTimeout(function () { - sendText(); - }, 0); - }; - - var onCut = function(e) { - copied = true; - var copyText = host.getCopyText(); - if(copyText) { - text.value = copyText; - host.onCut(); - } else - e.preventDefault(); - select(); - setTimeout(function () { - sendText(); - }, 0); - }; - - event.addCommandKeyListener(text, host.onCommandKey.bind(host)); - if (useragent.isOldIE) { - var keytable = { 13:1, 27:1 }; - event.addListener(text, "keyup", function (e) { - if (inCompostion && (!text.value || keytable[e.keyCode])) - setTimeout(onCompositionEnd, 0); - if ((text.value.charCodeAt(0)|0) < 129) { - return; - } - inCompostion ? onCompositionUpdate() : onCompositionStart(); - }); - } - - if ("onpropertychange" in text && !("oninput" in text)) - event.addListener(text, "propertychange", onPropertyChange); - else - event.addListener(text, "input", onTextInput); - - event.addListener(text, "paste", function(e) { - // Mark that the next input text comes from past. - pasted = true; - // Some browsers support the event.clipboardData API. Use this to get - // the pasted content which increases speed if pasting a lot of lines. - if (e.clipboardData && e.clipboardData.getData) { - sendText(e.clipboardData.getData("text/plain")); - e.preventDefault(); - } - else { - // If a browser doesn't support any of the things above, use the regular - // method to detect the pasted input. - onPropertyChange(); - } - }); - - if ("onbeforecopy" in text && typeof clipboardData !== "undefined") { - event.addListener(text, "beforecopy", function(e) { - var copyText = host.getCopyText(); - if(copyText) - clipboardData.setData("Text", copyText); - else - e.preventDefault(); - }); - event.addListener(parentNode, "keydown", function(e) { - if (e.ctrlKey && e.keyCode == 88) { - var copyText = host.getCopyText(); - if (copyText) { - clipboardData.setData("Text", copyText); - host.onCut(); - } - event.preventDefault(e) - } - }); - } - else { - event.addListener(text, "copy", onCopy); - event.addListener(text, "cut", onCut); - } - - event.addListener(text, "compositionstart", onCompositionStart); - if (useragent.isGecko) { - event.addListener(text, "text", onCompositionUpdate); - }; - if (useragent.isWebKit) { - event.addListener(text, "keyup", onCompositionUpdate); - }; - event.addListener(text, "compositionend", onCompositionEnd); - - event.addListener(text, "blur", function() { - host.onBlur(); - }); - - event.addListener(text, "focus", function() { - host.onFocus(); - select(); - }); - - this.focus = function() { - host.onFocus(); - select(); - text.focus(); - }; - - this.blur = function() { - text.blur(); - }; - - function isFocused() { - return document.activeElement === text; - }; - this.isFocused = isFocused; - - this.getElement = function() { - return text; - }; - - this.onContextMenu = function(mousePos, isEmpty){ - if (mousePos) { - if (!tempStyle) - tempStyle = text.style.cssText; - - text.style.cssText = - 'position:fixed; z-index:1000;' + - 'left:' + (mousePos.x - 2) + 'px; top:' + (mousePos.y - 2) + 'px;' - - } - if (isEmpty) - text.value=''; - } - - this.onContextMenuClose = function(){ - setTimeout(function () { - if (tempStyle) { - text.style.cssText = tempStyle; - tempStyle = ''; - } - sendText(); - }, 0); - } -}; - -exports.TextInput = TextInput; -}); - - -define("ace/mouse/mouse_handler",[], function(require, exports, module) { - -var event = require("ace/lib/event"); -var DefaultHandlers = require("ace/mouse/default_handlers").DefaultHandlers; -var MouseEvent = require("ace/mouse/mouse_event").MouseEvent; - -var MouseHandler = function(editor) { - this.editor = editor; - - this.defaultHandlers = new DefaultHandlers(editor); - event.addListener(editor.container, "mousedown", function(e) { - editor.focus(); - return event.preventDefault(e); - }); - event.addListener(editor.container, "selectstart", function(e) { - return event.preventDefault(e); - }); - - var mouseTarget = editor.renderer.getMouseEventTarget(); - event.addListener(mouseTarget, "mousedown", this.onMouseDown.bind(this)); - event.addListener(mouseTarget, "click", this.onMouseClick.bind(this)); - event.addListener(mouseTarget, "mousemove", this.onMouseMove.bind(this)); - event.addMultiMouseDownListener(mouseTarget, 0, 2, 500, this.onMouseDoubleClick.bind(this)); - event.addMultiMouseDownListener(mouseTarget, 0, 3, 600, this.onMouseTripleClick.bind(this)); - event.addMultiMouseDownListener(mouseTarget, 0, 4, 600, this.onMouseQuadClick.bind(this)); - event.addMouseWheelListener(editor.container, this.onMouseWheel.bind(this)); -}; - -(function() { - - this.$scrollSpeed = 1; - this.setScrollSpeed = function(speed) { - this.$scrollSpeed = speed; - }; - - this.getScrollSpeed = function() { - return this.$scrollSpeed; - }; - - this.onMouseDown = function(e) { - this.editor._dispatchEvent("mousedown", new MouseEvent(e, this.editor)); - }; - - this.onMouseClick = function(e) { - this.editor._dispatchEvent("click", new MouseEvent(e, this.editor)); - }; - - this.onMouseMove = function(e) { - // optimization, because mousemove doesn't have a default handler. - var listeners = this.editor._eventRegistry && this.editor._eventRegistry["mousemove"]; - if (!listeners || !listeners.length) - return; - - this.editor._dispatchEvent("mousemove", new MouseEvent(e, this.editor)); - }; - - this.onMouseDoubleClick = function(e) { - this.editor._dispatchEvent("dblclick", new MouseEvent(e, this.editor)); - }; - - this.onMouseTripleClick = function(e) { - this.editor._dispatchEvent("tripleclick", new MouseEvent(e, this.editor)); - }; - - this.onMouseQuadClick = function(e) { - this.editor._dispatchEvent("quadclick", new MouseEvent(e, this.editor)); - }; - - this.onMouseWheel = function(e) { - var mouseEvent = new MouseEvent(e, this.editor); - mouseEvent.speed = this.$scrollSpeed * 2; - mouseEvent.wheelX = e.wheelX; - mouseEvent.wheelY = e.wheelY; - - this.editor._dispatchEvent("mousewheel", mouseEvent); - }; - -}).call(MouseHandler.prototype); - -exports.MouseHandler = MouseHandler; -}); - - -define("ace/keyboard/keybinding",[], function(require, exports, module) { - -var useragent = require("ace/lib/useragent"); -var keyUtil = require("ace/lib/keys"); -var event = require("ace/lib/event"); -require("ace/commands/default_commands"); - -var KeyBinding = function(editor) { - this.$editor = editor; - this.$data = { }; - this.$keyboardHandler = null; -}; - -(function() { - this.setKeyboardHandler = function(keyboardHandler) { - if (this.$keyboardHandler != keyboardHandler) { - this.$data = { }; - this.$keyboardHandler = keyboardHandler; - } - }; - - this.getKeyboardHandler = function() { - return this.$keyboardHandler; - }; - - this.$callKeyboardHandler = function (e, hashId, keyOrText, keyCode) { - var env = {editor: this.$editor}; - var toExecute; - var commands = this.$editor.commands; - - if (this.$keyboardHandler) { - toExecute = - this.$keyboardHandler.handleKeyboard(this.$data, hashId, keyOrText, keyCode, e); - } - - - // If there is nothing to execute yet, then use the default keymapping. - if (!toExecute || !toExecute.command) { - if (hashId != 0 || keyCode != 0) { - toExecute = { - command: commands.findKeyCommand(env, hashId, keyOrText) - } - } else { - toExecute = { - command: "inserttext", - args: { - text: keyOrText - } - } - } - } - - var success = false; - if (toExecute && toExecute.command) { - success = commands.exec( - toExecute.command, - env, toExecute.args - ); - if (success!==false) { - event.stopEvent(e); - } - } - return success; - }; - - this.onCommandKey = function(e, hashId, keyCode, keyString) { - // In case there is no keyString, try to interprete the keyCode. - if (!keyString) { - keyString = keyUtil.keyCodeToString(keyCode); - } - return this.$callKeyboardHandler(e, hashId, keyString, keyCode); - }; - - this.onTextInput = function(text) { - return this.$callKeyboardHandler({}, 0, text, 0); - } - -}).call(KeyBinding.prototype); - -exports.KeyBinding = KeyBinding; -}); - - -define("ace/edit_session",[], function(require, exports, module) { - -var oop = require("ace/lib/oop"); -var lang = require("ace/lib/lang"); -var EventEmitter = require("ace/lib/event_emitter").EventEmitter; -var Selection = require("ace/selection").Selection; -var TextMode = require("ace/mode/text").Mode; -var Range = require("ace/range").Range; -var Document = require("ace/document").Document; -var BackgroundTokenizer = require("ace/background_tokenizer").BackgroundTokenizer; - -var EditSession = function(text, mode) { - this.$modified = true; - this.$breakpoints = []; - this.$frontMarkers = {}; - this.$backMarkers = {}; - this.$markerId = 1; - this.$rowCache = []; - this.$wrapData = []; - this.$foldData = []; - this.$foldData.toString = function() { - var str = ""; - this.forEach(function(foldLine) { - str += "\n" + foldLine.toString(); - }); - return str; - } - - if (text instanceof Document) { - this.setDocument(text); - } else { - this.setDocument(new Document(text)); - } - - this.selection = new Selection(this); - if (mode) - this.setMode(mode); - else - this.setMode(new TextMode()); -}; - - -(function() { - - oop.implement(this, EventEmitter); - - this.setDocument = function(doc) { - if (this.doc) - throw new Error("Document is already set"); - - this.doc = doc; - doc.on("change", this.onChange.bind(this)); - this.on("changeFold", this.onChangeFold.bind(this)); - - if (this.bgTokenizer) { - this.bgTokenizer.setDocument(this.getDocument()); - this.bgTokenizer.start(0); - } - }; - - this.getDocument = function() { - return this.doc; - }; - - this.$resetRowCache = function(row) { - if (row == 0) { - this.$rowCache = []; - return; - } - var rowCache = this.$rowCache; - for (var i = 0; i < rowCache.length; i++) { - if (rowCache[i].docRow >= row) { - rowCache.splice(i, rowCache.length); - return; - } - } - }; - - this.onChangeFold = function(e) { - var fold = e.data; - this.$resetRowCache(fold.start.row); - }; - - this.onChange = function(e) { - var delta = e.data; - this.$modified = true; - - this.$resetRowCache(delta.range.start.row); - - var removedFolds = this.$updateInternalDataOnChange(e); - if (!this.$fromUndo && this.$undoManager && !delta.ignore) { - this.$deltasDoc.push(delta); - if (removedFolds && removedFolds.length != 0) { - this.$deltasFold.push({ - action: "removeFolds", - folds: removedFolds - }); - } - - this.$informUndoManager.schedule(); - } - - this.bgTokenizer.start(delta.range.start.row); - this._dispatchEvent("change", e); - }; - - this.setValue = function(text) { - this.doc.setValue(text); - this.selection.moveCursorTo(0, 0); - this.selection.clearSelection(); - - this.$resetRowCache(0); - this.$deltas = []; - this.$deltasDoc = []; - this.$deltasFold = []; - this.getUndoManager().reset(); - }; - - this.getValue = - this.toString = function() { - return this.doc.getValue(); - }; - - this.getSelection = function() { - return this.selection; - }; - - this.getState = function(row) { - return this.bgTokenizer.getState(row); - }; - - this.getTokens = function(firstRow, lastRow) { - return this.bgTokenizer.getTokens(firstRow, lastRow); - }; - - this.getTokenAt = function(row, column) { - var tokens = this.bgTokenizer.getTokens(row, row)[0].tokens; - var token, c = 0; - if (column == null) { - i = tokens.length - 1; - c = this.getLine(row).length; - } else { - for (var i = 0; i < tokens.length; i++) { - c += tokens[i].value.length; - if (c >= column) - break; - } - } - token = tokens[i]; - if (!token) - return null; - token.index = i; - token.start = c - token.value.length; - return token; - }; - - this.setUndoManager = function(undoManager) { - this.$undoManager = undoManager; - this.$resetRowCache(0); - this.$deltas = []; - this.$deltasDoc = []; - this.$deltasFold = []; - - if (this.$informUndoManager) - this.$informUndoManager.cancel(); - - if (undoManager) { - var self = this; - this.$syncInformUndoManager = function() { - self.$informUndoManager.cancel(); - - if (self.$deltasFold.length) { - self.$deltas.push({ - group: "fold", - deltas: self.$deltasFold - }); - self.$deltasFold = []; - } - - if (self.$deltasDoc.length) { - self.$deltas.push({ - group: "doc", - deltas: self.$deltasDoc - }); - self.$deltasDoc = []; - } - - if (self.$deltas.length > 0) { - undoManager.execute({ - action: "aceupdate", - args: [self.$deltas, self] - }); - } - - self.$deltas = []; - } - this.$informUndoManager = - lang.deferredCall(this.$syncInformUndoManager); - } - }; - - this.$defaultUndoManager = { - undo: function() {}, - redo: function() {}, - reset: function() {} - }; - - this.getUndoManager = function() { - return this.$undoManager || this.$defaultUndoManager; - }, - - this.getTabString = function() { - if (this.getUseSoftTabs()) { - return lang.stringRepeat(" ", this.getTabSize()); - } else { - return "\t"; - } - }; - - this.$useSoftTabs = true; - this.setUseSoftTabs = function(useSoftTabs) { - if (this.$useSoftTabs === useSoftTabs) return; - - this.$useSoftTabs = useSoftTabs; - }; - - this.getUseSoftTabs = function() { - return this.$useSoftTabs; - }; - - this.$tabSize = 4; - this.setTabSize = function(tabSize) { - if (isNaN(tabSize) || this.$tabSize === tabSize) return; - - this.$modified = true; - this.$tabSize = tabSize; - this._dispatchEvent("changeTabSize"); - }; - - this.getTabSize = function() { - return this.$tabSize; - }; - - this.isTabStop = function(position) { - return this.$useSoftTabs && (position.column % this.$tabSize == 0); - }; - - this.$overwrite = false; - this.setOverwrite = function(overwrite) { - if (this.$overwrite == overwrite) return; - - this.$overwrite = overwrite; - this._dispatchEvent("changeOverwrite"); - }; - - this.getOverwrite = function() { - return this.$overwrite; - }; - - this.toggleOverwrite = function() { - this.setOverwrite(!this.$overwrite); - }; - - this.getBreakpoints = function() { - return this.$breakpoints; - }; - - this.setBreakpoints = function(rows) { - this.$breakpoints = []; - for (var i=0; i 0) { - inToken = !!line.charAt(column - 1).match(this.tokenRe); - } - - if (!inToken) { - inToken = !!line.charAt(column).match(this.tokenRe); - } - - var re = inToken ? this.tokenRe : this.nonTokenRe; - - var start = column; - if (start > 0) { - do { - start--; - } - while (start >= 0 && line.charAt(start).match(re)); - start++; - } - - var end = column; - while (end < line.length && line.charAt(end).match(re)) { - end++; - } - - return new Range(row, start, row, end); - }; - - this.setNewLineMode = function(newLineMode) { - this.doc.setNewLineMode(newLineMode); - }; - - this.getNewLineMode = function() { - return this.doc.getNewLineMode(); - }; - - this.$useWorker = true; - this.setUseWorker = function(useWorker) { - if (this.$useWorker == useWorker) - return; - - this.$useWorker = useWorker; - - this.$stopWorker(); - if (useWorker) - this.$startWorker(); - }; - - this.getUseWorker = function() { - return this.$useWorker; - }; - - this.onReloadTokenizer = function(e) { - var rows = e.data; - this.bgTokenizer.start(rows.first); - this._dispatchEvent("tokenizerUpdate", e); - }; - - this.$mode = null; - this.setMode = function(mode) { - if (this.$mode === mode) return; - this.$mode = mode; - - this.$stopWorker(); - - if (this.$useWorker) - this.$startWorker(); - - var tokenizer = mode.getTokenizer(); - - if(tokenizer.addEventListener !== undefined) { - var onReloadTokenizer = this.onReloadTokenizer.bind(this); - tokenizer.addEventListener("update", onReloadTokenizer); - } - - if (!this.bgTokenizer) { - this.bgTokenizer = new BackgroundTokenizer(tokenizer); - var _self = this; - this.bgTokenizer.addEventListener("update", function(e) { - _self._dispatchEvent("tokenizerUpdate", e); - }); - } else { - this.bgTokenizer.setTokenizer(tokenizer); - } - - this.bgTokenizer.setDocument(this.getDocument()); - this.bgTokenizer.start(0); - - this.tokenRe = mode.tokenRe; - this.nonTokenRe = mode.nonTokenRe; - - this._dispatchEvent("changeMode"); - }; - - this.$stopWorker = function() { - if (this.$worker) - this.$worker.terminate(); - - this.$worker = null; - }; - - this.$startWorker = function() { - if (typeof Worker !== "undefined" && !require.noWorker) { - try { - this.$worker = this.$mode.createWorker(this); - } catch (e) { - console.log("Could not load worker"); - console.log(e); - this.$worker = null; - } - } - else - this.$worker = null; - }; - - this.getMode = function() { - return this.$mode; - }; - - this.$scrollTop = 0; - this.setScrollTopRow = function(scrollTopRow) { - if (this.$scrollTop === scrollTopRow) return; - - this.$scrollTop = scrollTopRow; - this._dispatchEvent("changeScrollTop"); - }; - - this.getScrollTopRow = function() { - return this.$scrollTop; - }; - - this.getWidth = function() { - this.$computeWidth(); - return this.width; - }; - - this.getScreenWidth = function() { - this.$computeWidth(); - return this.screenWidth; - }; - - this.$computeWidth = function(force) { - if (this.$modified || force) { - this.$modified = false; - - var lines = this.doc.getAllLines(); - var longestLine = 0; - var longestScreenLine = 0; - - for ( var i = 0; i < lines.length; i++) { - var foldLine = this.getFoldLine(i), - line, len; - - line = lines[i]; - if (foldLine) { - var end = foldLine.range.end; - line = this.getFoldDisplayLine(foldLine); - // Continue after the foldLine.end.row. All the lines in - // between are folded. - i = end.row; - } - len = line.length; - longestLine = Math.max(longestLine, len); - if (!this.$useWrapMode) { - longestScreenLine = Math.max( - longestScreenLine, - this.$getStringScreenWidth(line)[0] - ); - } - } - this.width = longestLine; - - if (this.$useWrapMode) { - this.screenWidth = this.$wrapLimit; - } else { - this.screenWidth = longestScreenLine; - } - } - }; - - /** - * Get a verbatim copy of the given line as it is in the document - */ - this.getLine = function(row) { - return this.doc.getLine(row); - }; - - this.getLines = function(firstRow, lastRow) { - return this.doc.getLines(firstRow, lastRow); - }; - - this.getLength = function() { - return this.doc.getLength(); - }; - - this.getTextRange = function(range) { - return this.doc.getTextRange(range); - }; - - this.insert = function(position, text) { - return this.doc.insert(position, text); - }; - - this.remove = function(range) { - return this.doc.remove(range); - }; - - this.undoChanges = function(deltas, dontSelect) { - if (!deltas.length) - return; - - this.$fromUndo = true; - var lastUndoRange = null; - for (var i = deltas.length - 1; i != -1; i--) { - delta = deltas[i]; - if (delta.group == "doc") { - this.doc.revertDeltas(delta.deltas); - lastUndoRange = - this.$getUndoSelection(delta.deltas, true, lastUndoRange); - } else { - delta.deltas.forEach(function(foldDelta) { - this.addFolds(foldDelta.folds); - }, this); - } - } - this.$fromUndo = false; - lastUndoRange && - !dontSelect && - this.selection.setSelectionRange(lastUndoRange); - return lastUndoRange; - }, - - this.redoChanges = function(deltas, dontSelect) { - if (!deltas.length) - return; - - this.$fromUndo = true; - var lastUndoRange = null; - for (var i = 0; i < deltas.length; i++) { - delta = deltas[i]; - if (delta.group == "doc") { - this.doc.applyDeltas(delta.deltas); - lastUndoRange = - this.$getUndoSelection(delta.deltas, false, lastUndoRange); - } - } - this.$fromUndo = false; - lastUndoRange && - !dontSelect && - this.selection.setSelectionRange(lastUndoRange); - return lastUndoRange; - }, - - this.$getUndoSelection = function(deltas, isUndo, lastUndoRange) { - function isInsert(delta) { - var insert = - delta.action == "insertText" || delta.action == "insertLines"; - return isUndo ? !insert : insert; - } - - var delta = deltas[0]; - var range, point; - var lastDeltaIsInsert = false; - if (isInsert(delta)) { - range = delta.range.clone(); - lastDeltaIsInsert = true; - } else { - range = Range.fromPoints(delta.range.start, delta.range.start); - lastDeltaIsInsert = false; - } - - for (var i = 1; i < deltas.length; i++) { - delta = deltas[i]; - if (isInsert(delta)) { - point = delta.range.start; - if (range.compare(point.row, point.column) == -1) { - range.setStart(delta.range.start); - } - point = delta.range.end; - if (range.compare(point.row, point.column) == 1) { - range.setEnd(delta.range.end); - } - lastDeltaIsInsert = true; - } else { - point = delta.range.start; - if (range.compare(point.row, point.column) == -1) { - range = - Range.fromPoints(delta.range.start, delta.range.start); - } - lastDeltaIsInsert = false; - } - } - - // Check if this range and the last undo range has something in common. - // If true, merge the ranges. - if (lastUndoRange != null) { - var cmp = lastUndoRange.compareRange(range); - if (cmp == 1) { - range.setStart(lastUndoRange.start); - } else if (cmp == -1) { - range.setEnd(lastUndoRange.end); - } - } - - return range; - }, - - this.replace = function(range, text) { - return this.doc.replace(range, text); - }; - - /** - * Move a range of text from the given range to the given position. - * - * @param fromRange {Range} The range of text you want moved within the - * document. - * @param toPosition {Object} The location (row and column) where you want - * to move the text to. - * @return {Range} The new range where the text was moved to. - */ - this.moveText = function(fromRange, toPosition) { - var text = this.getTextRange(fromRange); - this.remove(fromRange); - - var toRow = toPosition.row; - var toColumn = toPosition.column; - - // Make sure to update the insert location, when text is removed in - // front of the chosen point of insertion. - if (!fromRange.isMultiLine() && fromRange.start.row == toRow && - fromRange.end.column < toColumn) - toColumn -= text.length; - - if (fromRange.isMultiLine() && fromRange.end.row < toRow) { - var lines = this.doc.$split(text); - toRow -= lines.length - 1; - } - - var endRow = toRow + fromRange.end.row - fromRange.start.row; - var endColumn = fromRange.isMultiLine() ? - fromRange.end.column : - toColumn + fromRange.end.column - fromRange.start.column; - - var toRange = new Range(toRow, toColumn, endRow, endColumn); - - this.insert(toRange.start, text); - - return toRange; - }; - - this.indentRows = function(startRow, endRow, indentString) { - indentString = indentString.replace(/\t/g, this.getTabString()); - for (var row=startRow; row<=endRow; row++) - this.insert({row: row, column:0}, indentString); - }; - - this.outdentRows = function (range) { - var rowRange = range.collapseRows(); - var deleteRange = new Range(0, 0, 0, 0); - var size = this.getTabSize(); - - for (var i = rowRange.start.row; i <= rowRange.end.row; ++i) { - var line = this.getLine(i); - - deleteRange.start.row = i; - deleteRange.end.row = i; - for (var j = 0; j < size; ++j) - if (line.charAt(j) != ' ') - break; - if (j < size && line.charAt(j) == '\t') { - deleteRange.start.column = j; - deleteRange.end.column = j + 1; - } else { - deleteRange.start.column = 0; - deleteRange.end.column = j; - } - this.remove(deleteRange); - } - }; - - this.moveLinesUp = function(firstRow, lastRow) { - if (firstRow <= 0) return 0; - - var removed = this.doc.removeLines(firstRow, lastRow); - this.doc.insertLines(firstRow - 1, removed); - return -1; - }; - - this.moveLinesDown = function(firstRow, lastRow) { - if (lastRow >= this.doc.getLength()-1) return 0; - - var removed = this.doc.removeLines(firstRow, lastRow); - this.doc.insertLines(firstRow+1, removed); - return 1; - }; - - this.duplicateLines = function(firstRow, lastRow) { - var firstRow = this.$clipRowToDocument(firstRow); - var lastRow = this.$clipRowToDocument(lastRow); - - var lines = this.getLines(firstRow, lastRow); - this.doc.insertLines(firstRow, lines); - - var addedRows = lastRow - firstRow + 1; - return addedRows; - }; - - this.$clipRowToDocument = function(row) { - return Math.max(0, Math.min(row, this.doc.getLength()-1)); - }; - - this.$clipPositionToDocument = function(row, column) { - column = Math.max(0, column); - - if (row < 0) { - row = 0; - column = 0; - } else { - var len = this.doc.getLength(); - if (row >= len) { - row = len - 1; - column = this.doc.getLine(len-1).length; - } else { - column = Math.min(this.doc.getLine(row).length, column); - } - } - - return { - row: row, - column: column - }; - }; - - // WRAPMODE - this.$wrapLimit = 80; - this.$useWrapMode = false; - this.$wrapLimitRange = { - min : null, - max : null - }; - - this.setUseWrapMode = function(useWrapMode) { - if (useWrapMode != this.$useWrapMode) { - this.$useWrapMode = useWrapMode; - this.$modified = true; - this.$resetRowCache(0); - - // If wrapMode is activaed, the wrapData array has to be initialized. - if (useWrapMode) { - var len = this.getLength(); - this.$wrapData = []; - for (i = 0; i < len; i++) { - this.$wrapData.push([]); - } - this.$updateWrapData(0, len - 1); - } - - this._dispatchEvent("changeWrapMode"); - } - }; - - this.getUseWrapMode = function() { - return this.$useWrapMode; - }; - - // Allow the wrap limit to move freely between min and max. Either - // parameter can be null to allow the wrap limit to be unconstrained - // in that direction. Or set both parameters to the same number to pin - // the limit to that value. - this.setWrapLimitRange = function(min, max) { - if (this.$wrapLimitRange.min !== min || this.$wrapLimitRange.max !== max) { - this.$wrapLimitRange.min = min; - this.$wrapLimitRange.max = max; - this.$modified = true; - // This will force a recalculation of the wrap limit - this._dispatchEvent("changeWrapMode"); - } - }; - - // This should generally only be called by the renderer when a resize - // is detected. - this.adjustWrapLimit = function(desiredLimit) { - var wrapLimit = this.$constrainWrapLimit(desiredLimit); - if (wrapLimit != this.$wrapLimit && wrapLimit > 0) { - this.$wrapLimit = wrapLimit; - this.$modified = true; - if (this.$useWrapMode) { - this.$updateWrapData(0, this.getLength() - 1); - this.$resetRowCache(0) - this._dispatchEvent("changeWrapLimit"); - } - return true; - } - return false; - }; - - this.$constrainWrapLimit = function(wrapLimit) { - var min = this.$wrapLimitRange.min; - if (min) - wrapLimit = Math.max(min, wrapLimit); - - var max = this.$wrapLimitRange.max; - if (max) - wrapLimit = Math.min(max, wrapLimit); - - // What would a limit of 0 even mean? - return Math.max(1, wrapLimit); - }; - - this.getWrapLimit = function() { - return this.$wrapLimit; - }; - - this.getWrapLimitRange = function() { - // Avoid unexpected mutation by returning a copy - return { - min : this.$wrapLimitRange.min, - max : this.$wrapLimitRange.max - }; - }; - - this.$updateInternalDataOnChange = function(e) { - var useWrapMode = this.$useWrapMode; - var len; - var action = e.data.action; - var firstRow = e.data.range.start.row, - lastRow = e.data.range.end.row, - start = e.data.range.start, - end = e.data.range.end; - var removedFolds = null; - - if (action.indexOf("Lines") != -1) { - if (action == "insertLines") { - lastRow = firstRow + (e.data.lines.length); - } else { - lastRow = firstRow; - } - len = e.data.lines ? e.data.lines.length : lastRow - firstRow; - } else { - len = lastRow - firstRow; - } - - if (len != 0) { - if (action.indexOf("remove") != -1) { - useWrapMode && this.$wrapData.splice(firstRow, len); - - var foldLines = this.$foldData; - removedFolds = this.getFoldsInRange(e.data.range); - this.removeFolds(removedFolds); - - var foldLine = this.getFoldLine(end.row); - var idx = 0; - if (foldLine) { - foldLine.addRemoveChars(end.row, end.column, start.column - end.column); - foldLine.shiftRow(-len); - - var foldLineBefore = this.getFoldLine(firstRow); - if (foldLineBefore && foldLineBefore !== foldLine) { - foldLineBefore.merge(foldLine); - foldLine = foldLineBefore; - } - idx = foldLines.indexOf(foldLine) + 1; - } - - for (idx; idx < foldLines.length; idx++) { - var foldLine = foldLines[idx]; - if (foldLine.start.row >= end.row) { - foldLine.shiftRow(-len); - } - } - - lastRow = firstRow; - } else { - var args; - if (useWrapMode) { - args = [firstRow, 0]; - for (var i = 0; i < len; i++) args.push([]); - this.$wrapData.splice.apply(this.$wrapData, args); - } - - // If some new line is added inside of a foldLine, then split - // the fold line up. - var foldLines = this.$foldData; - var foldLine = this.getFoldLine(firstRow); - var idx = 0; - if (foldLine) { - var cmp = foldLine.range.compareInside(start.row, start.column) - // Inside of the foldLine range. Need to split stuff up. - if (cmp == 0) { - foldLine = foldLine.split(start.row, start.column); - foldLine.shiftRow(len); - foldLine.addRemoveChars( - lastRow, 0, end.column - start.column); - } else - // Infront of the foldLine but same row. Need to shift column. - if (cmp == -1) { - foldLine.addRemoveChars(firstRow, 0, end.column - start.column); - foldLine.shiftRow(len); - } - // Nothing to do if the insert is after the foldLine. - idx = foldLines.indexOf(foldLine) + 1; - } - - for (idx; idx < foldLines.length; idx++) { - var foldLine = foldLines[idx]; - if (foldLine.start.row >= firstRow) { - foldLine.shiftRow(len); - } - } - } - } else { - // Realign folds. E.g. if you add some new chars before a fold, the - // fold should "move" to the right. - var column; - len = Math.abs(e.data.range.start.column - e.data.range.end.column); - if (action.indexOf("remove") != -1) { - // Get all the folds in the change range and remove them. - removedFolds = this.getFoldsInRange(e.data.range); - this.removeFolds(removedFolds); - - len = -len; - } - var foldLine = this.getFoldLine(firstRow); - if (foldLine) { - foldLine.addRemoveChars(firstRow, start.column, len); - } - } - - if (useWrapMode && this.$wrapData.length != this.doc.getLength()) { - console.error("doc.getLength() and $wrapData.length have to be the same!"); - } - - useWrapMode && this.$updateWrapData(firstRow, lastRow); - - return removedFolds; - }; - - this.$updateWrapData = function(firstRow, lastRow) { - var lines = this.doc.getAllLines(); - var tabSize = this.getTabSize(); - var wrapData = this.$wrapData; - var wrapLimit = this.$wrapLimit; - var tokens; - var foldLine; - - var row = firstRow; - lastRow = Math.min(lastRow, lines.length - 1); - while (row <= lastRow) { - foldLine = this.getFoldLine(row); - if (!foldLine) { - tokens = this.$getDisplayTokens(lang.stringTrimRight(lines[row])); - } else { - tokens = []; - foldLine.walk( - function(placeholder, row, column, lastColumn) { - var walkTokens; - if (placeholder) { - walkTokens = this.$getDisplayTokens( - placeholder, tokens.length); - walkTokens[0] = PLACEHOLDER_START; - for (var i = 1; i < walkTokens.length; i++) { - walkTokens[i] = PLACEHOLDER_BODY; - } - } else { - walkTokens = this.$getDisplayTokens( - lines[row].substring(lastColumn, column), - tokens.length); - } - tokens = tokens.concat(walkTokens); - }.bind(this), - foldLine.end.row, - lines[foldLine.end.row].length + 1 - ); - // Remove spaces/tabs from the back of the token array. - while (tokens.length != 0 - && tokens[tokens.length - 1] >= SPACE) - { - tokens.pop(); - } - } - wrapData[row] = - this.$computeWrapSplits(tokens, wrapLimit, tabSize); - - row = this.getRowFoldEnd(row) + 1; - } - }; - - // "Tokens" - var CHAR = 1, - CHAR_EXT = 2, - PLACEHOLDER_START = 3, - PLACEHOLDER_BODY = 4, - PUNCTUATION = 9, - SPACE = 10, - TAB = 11, - TAB_SPACE = 12; - - this.$computeWrapSplits = function(tokens, wrapLimit, tabSize) { - if (tokens.length == 0) { - return []; - } - - var tabSize = this.getTabSize(); - var splits = []; - var displayLength = tokens.length; - var lastSplit = 0, lastDocSplit = 0; - - function addSplit(screenPos) { - var displayed = tokens.slice(lastSplit, screenPos); - - // The document size is the current size - the extra width for tabs - // and multipleWidth characters. - var len = displayed.length; - displayed.join(""). - // Get all the TAB_SPACEs. - replace(/12/g, function(m) { - len -= 1; - }). - // Get all the CHAR_EXT/multipleWidth characters. - replace(/2/g, function(m) { - len -= 1; - }); - - lastDocSplit += len; - splits.push(lastDocSplit); - lastSplit = screenPos; - } - - while (displayLength - lastSplit > wrapLimit) { - // This is, where the split should be. - var split = lastSplit + wrapLimit; - - // If there is a space or tab at this split position, then making - // a split is simple. - if (tokens[split] >= SPACE) { - // Include all following spaces + tabs in this split as well. - while (tokens[split] >= SPACE) { - split ++; - } - addSplit(split); - continue; - } - - // === ELSE === - // Check if split is inside of a placeholder. Placeholder are - // not splitable. Therefore, seek the beginning of the placeholder - // and try to place the split beofre the placeholder's start. - if (tokens[split] == PLACEHOLDER_START - || tokens[split] == PLACEHOLDER_BODY) - { - // Seek the start of the placeholder and do the split - // before the placeholder. By definition there always - // a PLACEHOLDER_START between split and lastSplit. - for (split; split != lastSplit - 1; split--) { - if (tokens[split] == PLACEHOLDER_START) { - // split++; << No incremental here as we want to - // have the position before the Placeholder. - break; - } - } - - // If the PLACEHOLDER_START is not the index of the - // last split, then we can do the split - if (split > lastSplit) { - addSplit(split); - continue; - } - - // If the PLACEHOLDER_START IS the index of the last - // split, then we have to place the split after the - // placeholder. So, let's seek for the end of the placeholder. - split = lastSplit + wrapLimit; - for (split; split < tokens.length; split++) { - if (tokens[split] != PLACEHOLDER_BODY) - { - break; - } - } - - // If spilt == tokens.length, then the placeholder is the last - // thing in the line and adding a new split doesn't make sense. - if (split == tokens.length) { - break; // Breaks the while-loop. - } - - // Finally, add the split... - addSplit(split); - continue; - } - - // === ELSE === - // Search for the first non space/tab/placeholder/punctuation token backwards. - var minSplit = Math.max(split - 10, lastSplit - 1); - while (split > minSplit && tokens[split] < PLACEHOLDER_START) { - split --; - } - while (split > minSplit && tokens[split] == PUNCTUATION) { - split --; - } - // If we found one, then add the split. - if (split > minSplit) { - addSplit(++split); - continue; - } - - // === ELSE === - split = lastSplit + wrapLimit; - // The split is inside of a CHAR or CHAR_EXT token and no space - // around -> force a split. - addSplit(split); - } - return splits; - } - - /** - * @param - * offset: The offset in screenColumn at which position str starts. - * Important for calculating the realTabSize. - */ - this.$getDisplayTokens = function(str, offset) { - var arr = []; - var tabSize; - offset = offset || 0; - - for (var i = 0; i < str.length; i++) { - var c = str.charCodeAt(i); - // Tab - if (c == 9) { - tabSize = this.getScreenTabSize(arr.length + offset); - arr.push(TAB); - for (var n = 1; n < tabSize; n++) { - arr.push(TAB_SPACE); - } - } - // Space - else if (c == 32) { - arr.push(SPACE); - } else if((c > 39 && c < 48) || (c > 57 && c < 64)) { - arr.push(PUNCTUATION); - } - // full width characters - else if (c >= 0x1100 && isFullWidth(c)) { - arr.push(CHAR, CHAR_EXT); - } else { - arr.push(CHAR); - } - } - return arr; - } - - /** - * Calculates the width of the a string on the screen while assuming that - * the string starts at the first column on the screen. - * - * @param string str String to calculate the screen width of - * @return array - * [0]: number of columns for str on screen. - * [1]: docColumn position that was read until (useful with screenColumn) - */ - this.$getStringScreenWidth = function(str, maxScreenColumn, screenColumn) { - if (maxScreenColumn == 0) { - return [0, 0]; - } - if (maxScreenColumn == null) { - maxScreenColumn = screenColumn + - str.length * Math.max(this.getTabSize(), 2); - } - screenColumn = screenColumn || 0; - - var c, column; - for (column = 0; column < str.length; column++) { - c = str.charCodeAt(column); - // tab - if (c == 9) { - screenColumn += this.getScreenTabSize(screenColumn); - } - // full width characters - else if (c >= 0x1100 && isFullWidth(c)) { - screenColumn += 2; - } else { - screenColumn += 1; - } - if (screenColumn > maxScreenColumn) { - break - } - } - - return [screenColumn, column]; - } - - /** - * Returns the number of rows required to render this row on the screen - */ - this.getRowLength = function(row) { - if (!this.$useWrapMode || !this.$wrapData[row]) { - return 1; - } else { - return this.$wrapData[row].length + 1; - } - } - - /** - * Returns the height in pixels required to render this row on the screen - **/ - this.getRowHeight = function(config, row) { - return this.getRowLength(row) * config.lineHeight; - } - - this.getScreenLastRowColumn = function(screenRow) { - //return this.screenToDocumentColumn(screenRow, Number.MAX_VALUE / 10) - return this.documentToScreenColumn(screenRow, this.doc.getLine(screenRow).length); - }; - - this.getDocumentLastRowColumn = function(docRow, docColumn) { - var screenRow = this.documentToScreenRow(docRow, docColumn); - return this.getScreenLastRowColumn(screenRow); - }; - - this.getDocumentLastRowColumnPosition = function(docRow, docColumn) { - var screenRow = this.documentToScreenRow(docRow, docColumn); - return this.screenToDocumentPosition(screenRow, Number.MAX_VALUE / 10); - }; - - this.getRowSplitData = function(row) { - if (!this.$useWrapMode) { - return undefined; - } else { - return this.$wrapData[row]; - } - }; - - /** - * Returns the width of a tab character at screenColumn. - */ - this.getScreenTabSize = function(screenColumn) { - return this.$tabSize - screenColumn % this.$tabSize; - }; - - this.screenToDocumentRow = function(screenRow, screenColumn) { - return this.screenToDocumentPosition(screenRow, screenColumn).row; - }; - - this.screenToDocumentColumn = function(screenRow, screenColumn) { - return this.screenToDocumentPosition(screenRow, screenColumn).column; - }; - - this.screenToDocumentPosition = function(screenRow, screenColumn) { - if (screenRow < 0) { - return { - row: 0, - column: 0 - } - } - - var line; - var docRow = 0; - var docColumn = 0; - var column; - var foldLineRowLength; - var row = 0; - var rowLength = 0; - - var rowCache = this.$rowCache; - for (var i = 0; i < rowCache.length; i++) { - if (rowCache[i].screenRow < screenRow) { - row = rowCache[i].screenRow; - docRow = rowCache[i].docRow; - } - else { - break; - } - } - var doCache = !rowCache.length || i == rowCache.length; - - // clamp row before clamping column, for selection on last line - var maxRow = this.getLength() - 1; - - var foldLine = this.getNextFoldLine(docRow); - var foldStart = foldLine ? foldLine.start.row : Infinity; - - while (row <= screenRow) { - rowLength = this.getRowLength(docRow); - if (row + rowLength - 1 >= screenRow || docRow >= maxRow) { - break; - } else { - row += rowLength; - docRow++; - if (docRow > foldStart) { - docRow = foldLine.end.row+1; - foldLine = this.getNextFoldLine(docRow, foldLine); - foldStart = foldLine ? foldLine.start.row : Infinity; - } - } - if (doCache) { - rowCache.push({ - docRow: docRow, - screenRow: row - }); - } - } - - if (foldLine && foldLine.start.row <= docRow) - line = this.getFoldDisplayLine(foldLine); - else { - line = this.getLine(docRow); - foldLine = null; - } - - var splits = []; - if (this.$useWrapMode) { - splits = this.$wrapData[docRow]; - if (splits) { - column = splits[screenRow - row] - if(screenRow > row && splits.length) { - docColumn = splits[screenRow - row - 1] || splits[splits.length - 1]; - line = line.substring(docColumn); - } - } - } - - docColumn += this.$getStringScreenWidth(line, screenColumn)[1]; - - // clip row at the end of the document - if (row + splits.length < screenRow) - docColumn = Number.MAX_VALUE; - - // Need to do some clamping action here. - if (this.$useWrapMode) { - if (docColumn >= column) { - // We remove one character at the end such that the docColumn - // position returned is not associated to the next row on the - // screen. - docColumn = column - 1; - } - } else { - docColumn = Math.min(docColumn, line.length); - } - - if (foldLine) { - return foldLine.idxToPosition(docColumn); - } - - return { - row: docRow, - column: docColumn - } - }; - - this.documentToScreenPosition = function(docRow, docColumn) { - // Normalize the passed in arguments. - if (typeof docColumn === "undefined") - var pos = this.$clipPositionToDocument(docRow.row, docRow.column); - else - pos = this.$clipPositionToDocument(docRow, docColumn); - - docRow = pos.row; - docColumn = pos.column; - - var LL = this.$rowCache.length; - - var wrapData; - // Special case in wrapMode if the doc is at the end of the document. - if (this.$useWrapMode) { - wrapData = this.$wrapData; - if (docRow > wrapData.length - 1) { - return { - row: this.getScreenLength(), - column: wrapData.length == 0 - ? 0 - : (wrapData[wrapData.length - 1].length - 1) - }; - } - } - - var screenRow = 0; - var screenColumn = 0; - var foldStartRow = null; - var fold = null; - - // Clamp the docRow position in case it's inside of a folded block. - fold = this.getFoldAt(docRow, docColumn, 1); - if (fold) { - docRow = fold.start.row; - docColumn = fold.start.column; - } - - var rowEnd, row = 0; - var rowCache = this.$rowCache; - - for (var i = 0; i < rowCache.length; i++) { - if (rowCache[i].docRow < docRow) { - screenRow = rowCache[i].screenRow; - row = rowCache[i].docRow; - } else { - break; - } - } - var doCache = !rowCache.length || i == rowCache.length; - - var foldLine = this.getNextFoldLine(row); - var foldStart = foldLine ?foldLine.start.row :Infinity; - - while (row < docRow) { - if (row >= foldStart) { - rowEnd = foldLine.end.row + 1; - if (rowEnd > docRow) - break; - foldLine = this.getNextFoldLine(rowEnd, foldLine); - foldStart = foldLine ?foldLine.start.row :Infinity; - } - else { - rowEnd = row + 1; - } - - screenRow += this.getRowLength(row); - row = rowEnd; - - if (doCache) { - rowCache.push({ - docRow: row, - screenRow: screenRow - }); - } - } - - // Calculate the text line that is displayed in docRow on the screen. - var textLine = ""; - // Check if the final row we want to reach is inside of a fold. - if (foldLine && row >= foldStart) { - textLine = this.getFoldDisplayLine(foldLine, docRow, docColumn); - foldStartRow = foldLine.start.row; - } else { - textLine = this.getLine(docRow).substring(0, docColumn); - foldStartRow = docRow; - } - // Clamp textLine if in wrapMode. - if (this.$useWrapMode) { - var wrapRow = wrapData[foldStartRow]; - var screenRowOffset = 0; - while (textLine.length >= wrapRow[screenRowOffset]) { - screenRow ++; - screenRowOffset++; - } - textLine = textLine.substring( - wrapRow[screenRowOffset - 1] || 0, textLine.length - ); - } - - return { - row: screenRow, - column: this.$getStringScreenWidth(textLine)[0] - }; - }; - - this.documentToScreenColumn = function(row, docColumn) { - return this.documentToScreenPosition(row, docColumn).column; - }; - - this.documentToScreenRow = function(docRow, docColumn) { - return this.documentToScreenPosition(docRow, docColumn).row; - }; - - this.getScreenLength = function() { - var screenRows = 0; - var lastFoldLine = null; - var foldLine = null; - if (!this.$useWrapMode) { - screenRows = this.getLength(); - - // Remove the folded lines again. - var foldData = this.$foldData; - for (var i = 0; i < foldData.length; i++) { - foldLine = foldData[i]; - screenRows -= foldLine.end.row - foldLine.start.row; - } - } else { - for (var row = 0; row < this.$wrapData.length; row++) { - if (foldLine = this.getFoldLine(row, lastFoldLine)) { - row = foldLine.end.row; - screenRows += 1; - } else { - screenRows += this.$wrapData[row].length + 1; - } - } - } - - return screenRows; - } - - // For every keystroke this gets called once per char in the whole doc!! - // Wouldn't hurt to make it a bit faster for c >= 0x1100 - function isFullWidth(c) { - if (c < 0x1100) - return false; - return c >= 0x1100 && c <= 0x115F || - c >= 0x11A3 && c <= 0x11A7 || - c >= 0x11FA && c <= 0x11FF || - c >= 0x2329 && c <= 0x232A || - c >= 0x2E80 && c <= 0x2E99 || - c >= 0x2E9B && c <= 0x2EF3 || - c >= 0x2F00 && c <= 0x2FD5 || - c >= 0x2FF0 && c <= 0x2FFB || - c >= 0x3000 && c <= 0x303E || - c >= 0x3041 && c <= 0x3096 || - c >= 0x3099 && c <= 0x30FF || - c >= 0x3105 && c <= 0x312D || - c >= 0x3131 && c <= 0x318E || - c >= 0x3190 && c <= 0x31BA || - c >= 0x31C0 && c <= 0x31E3 || - c >= 0x31F0 && c <= 0x321E || - c >= 0x3220 && c <= 0x3247 || - c >= 0x3250 && c <= 0x32FE || - c >= 0x3300 && c <= 0x4DBF || - c >= 0x4E00 && c <= 0xA48C || - c >= 0xA490 && c <= 0xA4C6 || - c >= 0xA960 && c <= 0xA97C || - c >= 0xAC00 && c <= 0xD7A3 || - c >= 0xD7B0 && c <= 0xD7C6 || - c >= 0xD7CB && c <= 0xD7FB || - c >= 0xF900 && c <= 0xFAFF || - c >= 0xFE10 && c <= 0xFE19 || - c >= 0xFE30 && c <= 0xFE52 || - c >= 0xFE54 && c <= 0xFE66 || - c >= 0xFE68 && c <= 0xFE6B || - c >= 0xFF01 && c <= 0xFF60 || - c >= 0xFFE0 && c <= 0xFFE6; - }; - -}).call(EditSession.prototype); - -require("ace/edit_session/folding").Folding.call(EditSession.prototype); -require("ace/edit_session/bracket_match").BracketMatch.call(EditSession.prototype); - -exports.EditSession = EditSession; -}); - - -define("ace/search",[], function(require, exports, module) { - -var lang = require("ace/lib/lang"); -var oop = require("ace/lib/oop"); -var Range = require("ace/range").Range; - -var Search = function() { - this.$options = { - needle: "", - backwards: false, - wrap: false, - caseSensitive: false, - wholeWord: false, - scope: Search.ALL, - regExp: false - }; -}; - -Search.ALL = 1; -Search.SELECTION = 2; - -(function() { - - this.set = function(options) { - oop.mixin(this.$options, options); - return this; - }; - - this.getOptions = function() { - return lang.copyObject(this.$options); - }; - - this.find = function(session) { - if (!this.$options.needle) - return null; - - if (this.$options.backwards) { - var iterator = this.$backwardMatchIterator(session); - } else { - iterator = this.$forwardMatchIterator(session); - } - - var firstRange = null; - iterator.forEach(function(range) { - firstRange = range; - return true; - }); - - return firstRange; - }; - - this.findAll = function(session) { - var options = this.$options; - if (!options.needle) - return []; - - if (options.backwards) { - var iterator = this.$backwardMatchIterator(session); - } else { - iterator = this.$forwardMatchIterator(session); - } - - var ignoreCursor = !options.start && options.wrap && options.scope == Search.ALL; - if (ignoreCursor) - options.start = {row: 0, column: 0}; - - var ranges = []; - iterator.forEach(function(range) { - ranges.push(range); - }); - - if (ignoreCursor) - options.start = null; - - return ranges; - }; - - this.replace = function(input, replacement) { - var re = this.$assembleRegExp(); - var match = re.exec(input); - if (match && match[0].length == input.length) { - if (this.$options.regExp) { - return input.replace(re, replacement); - } else { - return replacement; - } - } else { - return null; - } - }; - - this.$forwardMatchIterator = function(session) { - var re = this.$assembleRegExp(); - var self = this; - - return { - forEach: function(callback) { - self.$forwardLineIterator(session).forEach(function(line, startIndex, row) { - if (startIndex) { - line = line.substring(startIndex); - } - - var matches = []; - - line.replace(re, function(str) { - var offset = arguments[arguments.length-2]; - matches.push({ - str: str, - offset: startIndex + offset - }); - return str; - }); - - for (var i=0; i= 0; i--) { - var match = matches[i]; - var range = self.$rangeFromMatch(row, match.offset, match.str.length); - if (callback(range)) - return true; - } - }); - } - }; - }; - - this.$rangeFromMatch = function(row, column, length) { - return new Range(row, column, row, column+length); - }; - - this.$assembleRegExp = function() { - if (this.$options.regExp) { - var needle = this.$options.needle; - } else { - needle = lang.escapeRegExp(this.$options.needle); - } - - if (this.$options.wholeWord) { - needle = "\\b" + needle + "\\b"; - } - - var modifier = "g"; - if (!this.$options.caseSensitive) { - modifier += "i"; - } - - var re = new RegExp(needle, modifier); - return re; - }; - - this.$forwardLineIterator = function(session) { - var searchSelection = this.$options.scope == Search.SELECTION; - - var range = this.$options.range || session.getSelection().getRange(); - var start = this.$options.start || range[searchSelection ? "start" : "end"]; - - var firstRow = searchSelection ? range.start.row : 0; - var firstColumn = searchSelection ? range.start.column : 0; - var lastRow = searchSelection ? range.end.row : session.getLength() - 1; - - var wrap = this.$options.wrap; - var inWrap = false; - - function getLine(row) { - var line = session.getLine(row); - if (searchSelection && row == range.end.row) { - line = line.substring(0, range.end.column); - } - if (inWrap && row == start.row) { - line = line.substring(0, start.column); - } - return line; - } - - return { - forEach: function(callback) { - var row = start.row; - - var line = getLine(row); - var startIndex = start.column; - - var stop = false; - inWrap = false; - - while (!callback(line, startIndex, row)) { - - if (stop) { - return; - } - - row++; - startIndex = 0; - - if (row > lastRow) { - if (wrap) { - row = firstRow; - startIndex = firstColumn; - inWrap = true; - } else { - return; - } - } - - if (row == start.row) - stop = true; - - line = getLine(row); - } - } - }; - }; - - this.$backwardLineIterator = function(session) { - var searchSelection = this.$options.scope == Search.SELECTION; - - var range = this.$options.range || session.getSelection().getRange(); - var start = this.$options.start || range[searchSelection ? "end" : "start"]; - - var firstRow = searchSelection ? range.start.row : 0; - var firstColumn = searchSelection ? range.start.column : 0; - var lastRow = searchSelection ? range.end.row : session.getLength() - 1; - - var wrap = this.$options.wrap; - - return { - forEach : function(callback) { - var row = start.row; - - var line = session.getLine(row).substring(0, start.column); - var startIndex = 0; - var stop = false; - var inWrap = false; - - while (!callback(line, startIndex, row)) { - - if (stop) - return; - - row--; - startIndex = 0; - - if (row < firstRow) { - if (wrap) { - row = lastRow; - inWrap = true; - } else { - return; - } - } - - if (row == start.row) - stop = true; - - line = session.getLine(row); - if (searchSelection) { - if (row == firstRow) - startIndex = firstColumn; - else if (row == lastRow) - line = line.substring(0, range.end.column); - } - - if (inWrap && row == start.row) - startIndex = start.column; - } - } - }; - }; - -}).call(Search.prototype); - -exports.Search = Search; -}); - - -define("ace/range",[], function(require, exports, module) { - -var Range = function(startRow, startColumn, endRow, endColumn) { - this.start = { - row: startRow, - column: startColumn - }; - - this.end = { - row: endRow, - column: endColumn - }; -}; - -(function() { - - this.toString = function() { - return ("Range: [" + this.start.row + "/" + this.start.column + - "] -> [" + this.end.row + "/" + this.end.column + "]"); - }; - - this.contains = function(row, column) { - return this.compare(row, column) == 0; - }; - - /** - * Compares this range (A) with another range (B), where B is the passed in - * range. - * - * Return values: - * -2: (B) is infront of (A) and doesn't intersect with (A) - * -1: (B) begins before (A) but ends inside of (A) - * 0: (B) is completly inside of (A) OR (A) is complety inside of (B) - * +1: (B) begins inside of (A) but ends outside of (A) - * +2: (B) is after (A) and doesn't intersect with (A) - * - * 42: FTW state: (B) ends in (A) but starts outside of (A) - */ - this.compareRange = function(range) { - var cmp, - end = range.end, - start = range.start; - - cmp = this.compare(end.row, end.column); - if (cmp == 1) { - cmp = this.compare(start.row, start.column); - if (cmp == 1) { - return 2; - } else if (cmp == 0) { - return 1; - } else { - return 0; - } - } else if (cmp == -1) { - return -2; - } else { - cmp = this.compare(start.row, start.column); - if (cmp == -1) { - return -1; - } else if (cmp == 1) { - return 42; - } else { - return 0; - } - } - } - - this.comparePoint = function(p) { - return this.compare(p.row, p.column); - } - - this.containsRange = function(range) { - return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0; - } - - this.isEnd = function(row, column) { - return this.end.row == row && this.end.column == column; - } - - this.isStart = function(row, column) { - return this.start.row == row && this.start.column == column; - } - - this.setStart = function(row, column) { - if (typeof row == "object") { - this.start.column = row.column; - this.start.row = row.row; - } else { - this.start.row = row; - this.start.column = column; - } - } - - this.setEnd = function(row, column) { - if (typeof row == "object") { - this.end.column = row.column; - this.end.row = row.row; - } else { - this.end.row = row; - this.end.column = column; - } - } - - this.inside = function(row, column) { - if (this.compare(row, column) == 0) { - if (this.isEnd(row, column) || this.isStart(row, column)) { - return false; - } else { - return true; - } - } - return false; - } - - this.insideStart = function(row, column) { - if (this.compare(row, column) == 0) { - if (this.isEnd(row, column)) { - return false; - } else { - return true; - } - } - return false; - } - - this.insideEnd = function(row, column) { - if (this.compare(row, column) == 0) { - if (this.isStart(row, column)) { - return false; - } else { - return true; - } - } - return false; - } - - this.compare = function(row, column) { - if (!this.isMultiLine()) { - if (row === this.start.row) { - return column < this.start.column ? -1 : (column > this.end.column ? 1 : 0); - }; - } - - if (row < this.start.row) - return -1; - - if (row > this.end.row) - return 1; - - if (this.start.row === row) - return column >= this.start.column ? 0 : -1; - - if (this.end.row === row) - return column <= this.end.column ? 0 : 1; - - return 0; - }; - - /** - * Like .compare(), but if isStart is true, return -1; - */ - this.compareStart = function(row, column) { - if (this.start.row == row && this.start.column == column) { - return -1; - } else { - return this.compare(row, column); - } - } - - /** - * Like .compare(), but if isEnd is true, return 1; - */ - this.compareEnd = function(row, column) { - if (this.end.row == row && this.end.column == column) { - return 1; - } else { - return this.compare(row, column); - } - } - - this.compareInside = function(row, column) { - if (this.end.row == row && this.end.column == column) { - return 1; - } else if (this.start.row == row && this.start.column == column) { - return -1; - } else { - return this.compare(row, column); - } - } - - this.clipRows = function(firstRow, lastRow) { - if (this.end.row > lastRow) { - var end = { - row: lastRow+1, - column: 0 - }; - } - - if (this.start.row > lastRow) { - var start = { - row: lastRow+1, - column: 0 - }; - } - - if (this.start.row < firstRow) { - var start = { - row: firstRow, - column: 0 - }; - } - - if (this.end.row < firstRow) { - var end = { - row: firstRow, - column: 0 - }; - } - return Range.fromPoints(start || this.start, end || this.end); - }; - - this.extend = function(row, column) { - var cmp = this.compare(row, column); - - if (cmp == 0) - return this; - else if (cmp == -1) - var start = {row: row, column: column}; - else - var end = {row: row, column: column}; - - return Range.fromPoints(start || this.start, end || this.end); - }; - - this.isEmpty = function() { - return (this.start.row == this.end.row && this.start.column == this.end.column); - }; - - this.isMultiLine = function() { - return (this.start.row !== this.end.row); - }; - - this.clone = function() { - return Range.fromPoints(this.start, this.end); - }; - - this.collapseRows = function() { - if (this.end.column == 0) - return new Range(this.start.row, 0, Math.max(this.start.row, this.end.row-1), 0) - else - return new Range(this.start.row, 0, this.end.row, 0) - }; - - this.toScreenRange = function(session) { - var screenPosStart = - session.documentToScreenPosition(this.start); - var screenPosEnd = - session.documentToScreenPosition(this.end); - - return new Range( - screenPosStart.row, screenPosStart.column, - screenPosEnd.row, screenPosEnd.column - ); - }; - -}).call(Range.prototype); - - -Range.fromPoints = function(start, end) { - return new Range(start.row, start.column, end.row, end.column); -}; - -exports.Range = Range; -}); - - -define("ace/lib/event_emitter",[], function(require, exports, module) { - -var EventEmitter = {}; - -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; - - e = e || {}; - e.type = eventName; - - if (!e.stopPropagation) { - e.stopPropagation = function() { - this.propagationStopped = true; - }; - } - - if (!e.preventDefault) { - e.preventDefault = function() { - this.defaultPrevented = true; - }; - } - - for (var i=0; iinclude - */ -exports.setCssClass = function(node, className, include) { - if (include) { - exports.addCssClass(node, className); - } else { - exports.removeCssClass(node, className); - } -}; - -exports.hasCssString = function(id, doc) { - var index = 0, sheets; - doc = doc || document; - - if (doc.createStyleSheet && (sheets = doc.styleSheets)) { - while (index < sheets.length) - if (sheets[index++].title === id) return true; - } else if ((sheets = doc.getElementsByTagName("style"))) { - while (index < sheets.length) - if (sheets[index++].id === id) return true; - } - - return false; -}; - -exports.importCssString = function importCssString(cssText, id, doc) { - doc = doc || document; - // If style is already imported return immediately. - if (id && exports.hasCssString(id, doc)) - return null; - - var style; - - if (doc.createStyleSheet) { - style = doc.createStyleSheet(); - style.cssText = cssText; - if (id) - style.title = id; - } else { - style = doc.createElementNS ? - doc.createElementNS(XHTML_NS, "style") : - doc.createElement("style"); - - style.appendChild(doc.createTextNode(cssText)); - if (id) - style.id = id; - - var head = doc.getElementsByTagName("head")[0] || doc.documentElement; - head.appendChild(style); - } -}; - -exports.importCssStylsheet = function(uri, doc) { - if (doc.createStyleSheet) { - var sheet = doc.createStyleSheet(uri); - } else { - var link = exports.createElement('link'); - link.rel = 'stylesheet'; - link.href = uri; - - var head = doc.getElementsByTagName("head")[0] || doc.documentElement; - head.appendChild(link); - } -}; - -exports.getInnerWidth = function(element) { - return (parseInt(exports.computedStyle(element, "paddingLeft")) - + parseInt(exports.computedStyle(element, "paddingRight")) + element.clientWidth); -}; - -exports.getInnerHeight = function(element) { - return (parseInt(exports.computedStyle(element, "paddingTop")) - + parseInt(exports.computedStyle(element, "paddingBottom")) + element.clientHeight); -}; - -if (window.pageYOffset !== undefined) { - exports.getPageScrollTop = function() { - return window.pageYOffset; - }; - - exports.getPageScrollLeft = function() { - return window.pageXOffset; - }; -} -else { - exports.getPageScrollTop = function() { - return document.body.scrollTop; - }; - - exports.getPageScrollLeft = function() { - return document.body.scrollLeft; - }; -} - -if (window.getComputedStyle) - exports.computedStyle = function(element, style) { - if (style) - return (window.getComputedStyle(element, "") || {})[style] || ""; - return window.getComputedStyle(element, "") || {} - }; -else - exports.computedStyle = function(element, style) { - if (style) - return element.currentStyle[style]; - return element.currentStyle - }; - -exports.scrollbarWidth = function(document) { - - var inner = exports.createElement("p"); - inner.style.width = "100%"; - inner.style.minWidth = "0px"; - inner.style.height = "200px"; - - var outer = exports.createElement("div"); - var style = outer.style; - - style.position = "absolute"; - style.left = "-10000px"; - style.overflow = "hidden"; - style.width = "200px"; - style.minWidth = "0px"; - style.height = "150px"; - - outer.appendChild(inner); - - var body = document.body || document.documentElement; - body.appendChild(outer); - - var noScrollbar = inner.offsetWidth; - - style.overflow = "scroll"; - var withScrollbar = inner.offsetWidth; - - if (noScrollbar == withScrollbar) { - withScrollbar = outer.clientWidth; - } - - body.removeChild(outer); - - return noScrollbar-withScrollbar; -}; - -/** - * Optimized set innerHTML. This is faster than plain innerHTML if the element - * already contains a lot of child elements. - * - * See http://blog.stevenlevithan.com/archives/faster-than-innerhtml for details - */ -exports.setInnerHtml = function(el, innerHtml) { - var element = el.cloneNode(false);//document.createElement("div"); - element.innerHTML = innerHtml; - el.parentNode.replaceChild(element, el); - return element; -}; - -exports.setInnerText = function(el, innerText) { - var document = el.ownerDocument; - if (document.body && "textContent" in document.body) - el.textContent = innerText; - else - el.innerText = innerText; - -}; - -exports.getInnerText = function(el) { - var document = el.ownerDocument; - if (document.body && "textContent" in document.body) - return el.textContent; - else - return el.innerText || el.textContent || ""; -}; - -exports.getParentWindow = function(document) { - return document.defaultView || document.parentWindow; -}; - -exports.getSelectionStart = function(textarea) { - // TODO IE - var start; - try { - start = textarea.selectionStart || 0; - } catch (e) { - start = 0; - } - return start; -}; - -exports.setSelectionStart = function(textarea, start) { - // TODO IE - return textarea.selectionStart = start; -}; - -exports.getSelectionEnd = function(textarea) { - // TODO IE - var end; - try { - end = textarea.selectionEnd || 0; - } catch (e) { - end = 0; - } - return end; -}; - -exports.setSelectionEnd = function(textarea, end) { - // TODO IE - return textarea.selectionEnd = end; -}; - -}); - - -define("ace/layer/gutter",[], function(require, exports, module) { - -var dom = require("ace/lib/dom"); - -var Gutter = function(parentEl) { - this.element = dom.createElement("div"); - this.element.className = "ace_layer ace_gutter-layer"; - parentEl.appendChild(this.element); - - this.$breakpoints = []; - this.$annotations = []; - this.$decorations = []; -}; - -(function() { - - this.setSession = function(session) { - this.session = session; - }; - - this.addGutterDecoration = function(row, className){ - if (!this.$decorations[row]) - this.$decorations[row] = ""; - this.$decorations[row] += " ace_" + className; - } - - this.removeGutterDecoration = function(row, className){ - this.$decorations[row] = this.$decorations[row].replace(" ace_" + className, ""); - }; - - this.setBreakpoints = function(rows) { - this.$breakpoints = rows.concat(); - }; - - this.setAnnotations = function(annotations) { - // iterate over sparse array - this.$annotations = []; - for (var row in annotations) if (annotations.hasOwnProperty(row)) { - var rowAnnotations = annotations[row]; - if (!rowAnnotations) - continue; - - var rowInfo = this.$annotations[row] = { - text: [] - }; - for (var i=0; i foldStart) { - i = fold.end.row + 1; - fold = this.session.getNextFoldLine(i, fold); - foldStart = fold ?fold.start.row :Infinity; - } - if(i > lastRow) - break; - - var annotation = this.$annotations[i] || emptyAnno; - html.push("
", (i+1)); - - var wrappedRowLength = this.session.getRowLength(i) - 1; - while (wrappedRowLength--) { - html.push("
\xA6"); - } - - html.push("
"); - - i++; - } - this.element = dom.setInnerHtml(this.element, html.join("")); - this.element.style.height = config.minHeight + "px"; - }; - -}).call(Gutter.prototype); - -exports.Gutter = Gutter; - -}); - - -define("ace/layer/marker",[], function(require, exports, module) { - -var Range = require("ace/range").Range; -var dom = require("ace/lib/dom"); - -var Marker = function(parentEl) { - this.element = dom.createElement("div"); - this.element.className = "ace_layer ace_marker-layer"; - parentEl.appendChild(this.element); -}; - -(function() { - - this.$padding = 0; - - this.setPadding = function(padding) { - this.$padding = padding; - }; - this.setSession = function(session) { - this.session = session; - }; - - this.setMarkers = function(markers) { - this.markers = markers; - }; - - this.update = function(config) { - var config = config || this.config; - if (!config) - return; - - this.config = config; - - - var html = []; - for ( var key in this.markers) { - var marker = this.markers[key]; - - var range = marker.range.clipRows(config.firstRow, config.lastRow); - if (range.isEmpty()) continue; - - range = range.toScreenRange(this.session); - if (marker.renderer) { - var top = this.$getTop(range.start.row, config); - var left = Math.round( - this.$padding + range.start.column * config.characterWidth - ); - marker.renderer(html, range, left, top, config); - } - else if (range.isMultiLine()) { - if (marker.type == "text") { - this.drawTextMarker(html, range, marker.clazz, config); - } else { - this.drawMultiLineMarker( - html, range, marker.clazz, config, - marker.type - ); - } - } - else { - this.drawSingleLineMarker( - html, range, marker.clazz, config, - null, marker.type - ); - } - } - this.element = dom.setInnerHtml(this.element, html.join("")); - }; - - this.$getTop = function(row, layerConfig) { - return (row - layerConfig.firstRowScreen) * layerConfig.lineHeight; - }; - - /** - * Draws a marker, which spans a range of text in a single line - */ - this.drawTextMarker = function(stringBuilder, range, clazz, layerConfig) { - // selection start - var row = range.start.row; - - var lineRange = new Range( - row, range.start.column, - row, this.session.getScreenLastRowColumn(row) - ); - this.drawSingleLineMarker(stringBuilder, lineRange, clazz, layerConfig, 1, "text"); - - // selection end - row = range.end.row; - lineRange = new Range(row, 0, row, range.end.column); - this.drawSingleLineMarker(stringBuilder, lineRange, clazz, layerConfig, 0, "text"); - - for (row = range.start.row + 1; row < range.end.row; row++) { - lineRange.start.row = row; - lineRange.end.row = row; - lineRange.end.column = this.session.getScreenLastRowColumn(row); - this.drawSingleLineMarker(stringBuilder, lineRange, clazz, layerConfig, 1, "text"); - } - }; - - /** - * Draws a multi line marker, where lines span the full width - */ - this.drawMultiLineMarker = function(stringBuilder, range, clazz, layerConfig, type) { - // from selection start to the end of the line - var padding = type === "background" ? 0 : this.$padding; - var height = layerConfig.lineHeight; - var width = Math.round(layerConfig.width - (range.start.column * layerConfig.characterWidth)); - var top = this.$getTop(range.start.row, layerConfig); - var left = Math.round( - padding + range.start.column * layerConfig.characterWidth - ); - - stringBuilder.push( - "
" - ); - - // from start of the last line to the selection end - top = this.$getTop(range.end.row, layerConfig); - width = Math.round(range.end.column * layerConfig.characterWidth); - - stringBuilder.push( - "
" - ); - - // all the complete lines - height = (range.end.row - range.start.row - 1) * layerConfig.lineHeight; - if (height < 0) - return; - top = this.$getTop(range.start.row + 1, layerConfig); - width = layerConfig.width; - - stringBuilder.push( - "
" - ); - }; - - /** - * Draws a marker which covers one single full line - */ - this.drawSingleLineMarker = function(stringBuilder, range, clazz, layerConfig, extraLength, type) { - var padding = type === "background" ? 0 : this.$padding; - var height = layerConfig.lineHeight; - - if (type === "background") - var width = layerConfig.width; - else - width = Math.round((range.end.column + (extraLength || 0) - range.start.column) * layerConfig.characterWidth); - - var top = this.$getTop(range.start.row, layerConfig); - var left = Math.round( - padding + range.start.column * layerConfig.characterWidth - ); - - stringBuilder.push( - "
" - ); - }; - -}).call(Marker.prototype); - -exports.Marker = Marker; - -}); - - -define("ace/layer/text",[], function(require, exports, module) { - -var oop = require("ace/lib/oop"); -var dom = require("ace/lib/dom"); -var lang = require("ace/lib/lang"); -var useragent = require("ace/lib/useragent"); -var EventEmitter = require("ace/lib/event_emitter").EventEmitter; - -var Text = function(parentEl) { - this.element = dom.createElement("div"); - this.element.className = "ace_layer ace_text-layer"; - parentEl.appendChild(this.element); - - this.$characterSize = this.$measureSizes() || {width: 0, height: 0}; - this.$pollSizeChanges(); -}; - -(function() { - - oop.implement(this, EventEmitter); - - this.EOF_CHAR = "\xB6"; //"¶"; - this.EOL_CHAR = "\xAC"; //"¬"; - this.TAB_CHAR = "\u2192"; //"→"; - this.SPACE_CHAR = "\xB7"; //"·"; - this.$padding = 0; - - this.setPadding = function(padding) { - this.$padding = padding; - this.element.style.padding = "0 " + padding + "px"; - }; - - this.getLineHeight = function() { - return this.$characterSize.height || 1; - }; - - this.getCharacterWidth = function() { - return this.$characterSize.width || 1; - }; - - this.checkForSizeChanges = function() { - var size = this.$measureSizes(); - if (size && (this.$characterSize.width !== size.width || this.$characterSize.height !== size.height)) { - this.$characterSize = size; - this._dispatchEvent("changeCharaterSize", {data: size}); - } - }; - - this.$pollSizeChanges = function() { - var self = this; - this.$pollSizeChangesTimer = setInterval(function() { - self.checkForSizeChanges(); - }, 500); - }; - - this.$fontStyles = { - fontFamily : 1, - fontSize : 1, - fontWeight : 1, - fontStyle : 1, - lineHeight : 1 - }; - - this.$measureSizes = function() { - var n = 1000; - if (!this.$measureNode) { - var measureNode = this.$measureNode = dom.createElement("div"); - var style = measureNode.style; - - style.width = style.height = "auto"; - style.left = style.top = (-n * 40) + "px"; - - style.visibility = "hidden"; - style.position = "absolute"; - style.overflow = "visible"; - style.whiteSpace = "nowrap"; - - // in FF 3.6 monospace fonts can have a fixed sub pixel width. - // that's why we have to measure many characters - // Note: characterWidth can be a float! - measureNode.innerHTML = lang.stringRepeat("Xy", n); - - if (this.element.ownerDocument.body) { - this.element.ownerDocument.body.appendChild(measureNode); - } else { - var container = this.element.parentNode; - while (!dom.hasCssClass(container, "ace_editor")) - container = container.parentNode; - container.appendChild(measureNode); - } - - } - - var style = this.$measureNode.style; - var computedStyle = dom.computedStyle(this.element); - for (var prop in this.$fontStyles) - style[prop] = computedStyle[prop]; - - var size = { - height: this.$measureNode.offsetHeight, - width: this.$measureNode.offsetWidth / (n * 2) - }; - - // Size and width can be null if the editor is not visible or - // detached from the document - if (size.width == 0 && size.height == 0) - return null; - - return size; - }; - - this.setSession = function(session) { - this.session = session; - }; - - this.showInvisibles = false; - this.setShowInvisibles = function(showInvisibles) { - if (this.showInvisibles == showInvisibles) - return false; - - this.showInvisibles = showInvisibles; - return true; - }; - - this.$tabStrings = []; - this.$computeTabString = function() { - var tabSize = this.session.getTabSize(); - var tabStr = this.$tabStrings = [0]; - for (var i = 1; i < tabSize + 1; i++) { - if (this.showInvisibles) { - tabStr.push("" - + this.TAB_CHAR - + new Array(i).join(" ") - + ""); - } else { - tabStr.push(new Array(i+1).join(" ")); - } - } - - }; - - this.updateLines = function(config, firstRow, lastRow) { - this.$computeTabString(); - // Due to wrap line changes there can be new lines if e.g. - // the line to updated wrapped in the meantime. - if (this.config.lastRow != config.lastRow || - this.config.firstRow != config.firstRow) { - this.scrollLines(config); - } - this.config = config; - - var first = Math.max(firstRow, config.firstRow); - var last = Math.min(lastRow, config.lastRow); - - var lineElements = this.element.childNodes; - var lineElementsIdx = 0; - - for (var row = config.firstRow; row < first; row++) { - var foldLine = this.session.getFoldLine(row); - if (foldLine) { - if (foldLine.containsRow(first)) { - break; - } else { - row = foldLine.end.row; - } - } - lineElementsIdx ++; - } - - for (var i=first; i<=last; i++) { - var lineElement = lineElements[lineElementsIdx++]; - if (!lineElement) - continue; - - var html = []; - var tokens = this.session.getTokens(i, i); - this.$renderLine(html, i, tokens[0].tokens, !this.$useLineGroups()); - lineElement = dom.setInnerHtml(lineElement, html.join("")); - - i = this.session.getRowFoldEnd(i); - } - }; - - this.scrollLines = function(config) { - this.$computeTabString(); - var oldConfig = this.config; - this.config = config; - - if (!oldConfig || oldConfig.lastRow < config.firstRow) - return this.update(config); - - if (config.lastRow < oldConfig.firstRow) - return this.update(config); - - var el = this.element; - if (oldConfig.firstRow < config.firstRow) - for (var row=this.session.getFoldedRowCount(oldConfig.firstRow, config.firstRow - 1); row>0; row--) - el.removeChild(el.firstChild); - - if (oldConfig.lastRow > config.lastRow) - for (var row=this.session.getFoldedRowCount(config.lastRow + 1, oldConfig.lastRow); row>0; row--) - el.removeChild(el.lastChild); - - if (config.firstRow < oldConfig.firstRow) { - var fragment = this.$renderLinesFragment(config, config.firstRow, oldConfig.firstRow - 1); - if (el.firstChild) - el.insertBefore(fragment, el.firstChild); - else - el.appendChild(fragment); - } - - if (config.lastRow > oldConfig.lastRow) { - var fragment = this.$renderLinesFragment(config, oldConfig.lastRow + 1, config.lastRow); - el.appendChild(fragment); - } - }; - - this.$renderLinesFragment = function(config, firstRow, lastRow) { - var fragment = this.element.ownerDocument.createDocumentFragment(), - row = firstRow, - fold = this.session.getNextFoldLine(row), - foldStart = fold ?fold.start.row :Infinity; - - while (true) { - if(row > foldStart) { - row = fold.end.row+1; - fold = this.session.getNextFoldLine(row, fold); - foldStart = fold ?fold.start.row :Infinity; - } - if(row > lastRow) - break; - - var container = dom.createElement("div"); - - var html = []; - // Get the tokens per line as there might be some lines in between - // beeing folded. - // OPTIMIZE: If there is a long block of unfolded lines, just make - // this call once for that big block of unfolded lines. - var tokens = this.session.getTokens(row, row); - if (tokens.length == 1) - this.$renderLine(html, row, tokens[0].tokens, false); - - // don't use setInnerHtml since we are working with an empty DIV - container.innerHTML = html.join(""); - if (this.$useLineGroups()) { - container.className = 'ace_line_group'; - fragment.appendChild(container); - } else { - var lines = container.childNodes - while(lines.length) - fragment.appendChild(lines[0]); - } - - row++; - } - return fragment; - }; - - this.update = function(config) { - this.$computeTabString(); - this.config = config; - - var html = []; - var firstRow = config.firstRow, lastRow = config.lastRow; - - var row = firstRow, - fold = this.session.getNextFoldLine(row), - foldStart = fold ?fold.start.row :Infinity; - - while (true) { - if(row > foldStart) { - row = fold.end.row+1; - fold = this.session.getNextFoldLine(row, fold); - foldStart = fold ?fold.start.row :Infinity; - } - if(row > lastRow) - break; - - if (this.$useLineGroups()) - html.push("
") - - // Get the tokens per line as there might be some lines in between - // beeing folded. - // OPTIMIZE: If there is a long block of unfolded lines, just make - // this call once for that big block of unfolded lines. - var tokens = this.session.getTokens(row, row); - if (tokens.length == 1) - this.$renderLine(html, row, tokens[0].tokens, false); - - if (this.$useLineGroups()) - html.push("
"); // end the line group - - row++; - } - this.element = dom.setInnerHtml(this.element, html.join("")); - }; - - this.$textToken = { - "text": true, - "rparen": true, - "lparen": true - }; - - this.$renderToken = function(stringBuilder, screenColumn, token, value) { - var self = this; - var replaceReg = /\t|&|<|( +)|([\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000])|[\u1100-\u115F]|[\u11A3-\u11A7]|[\u11FA-\u11FF]|[\u2329-\u232A]|[\u2E80-\u2E99]|[\u2E9B-\u2EF3]|[\u2F00-\u2FD5]|[\u2FF0-\u2FFB]|[\u3000-\u303E]|[\u3041-\u3096]|[\u3099-\u30FF]|[\u3105-\u312D]|[\u3131-\u318E]|[\u3190-\u31BA]|[\u31C0-\u31E3]|[\u31F0-\u321E]|[\u3220-\u3247]|[\u3250-\u32FE]|[\u3300-\u4DBF]|[\u4E00-\uA48C]|[\uA490-\uA4C6]|[\uA960-\uA97C]|[\uAC00-\uD7A3]|[\uD7B0-\uD7C6]|[\uD7CB-\uD7FB]|[\uF900-\uFAFF]|[\uFE10-\uFE19]|[\uFE30-\uFE52]|[\uFE54-\uFE66]|[\uFE68-\uFE6B]|[\uFF01-\uFF60]|[\uFFE0-\uFFE6]/g; - var replaceFunc = function(c, a, b, tabIdx, idx4) { - if (c.charCodeAt(0) == 32) { - return new Array(c.length+1).join(" "); - } else if (c == "\t") { - var tabSize = self.session.getScreenTabSize(screenColumn + tabIdx); - screenColumn += tabSize - 1; - return self.$tabStrings[tabSize]; - } else if (c == "&") { - if (useragent.isOldGecko) - return "&"; - else - return "&"; - } else if (c == "<") { - return "<"; - } else if (c == "\u3000") { - // U+3000 is both invisible AND full-width, so must be handled uniquely - var classToUse = self.showInvisibles ? "ace_cjk ace_invisible" : "ace_cjk"; - var space = self.showInvisibles ? self.SPACE_CHAR : ""; - screenColumn += 1; - return "" + space + ""; - } else if (c.match(/[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/)) { - if (self.showInvisibles) { - var space = new Array(c.length+1).join(self.SPACE_CHAR); - return "" + space + ""; - } else { - return " "; - } - } else { - screenColumn += 1; - return "" + c + ""; - } - }; - - var output = value.replace(replaceReg, replaceFunc); - - if (!this.$textToken[token.type]) { - var classes = "ace_" + token.type.replace(/\./g, " ace_"); - stringBuilder.push("", output, ""); - } - else { - stringBuilder.push(output); - } - return screenColumn + value.length; - }; - - this.$renderLineCore = function(stringBuilder, lastRow, tokens, splits, onlyContents) { - var chars = 0; - var split = 0; - var splitChars; - var characterWidth = this.config.characterWidth; - var screenColumn = 0; - var self = this; - - if (!splits || splits.length == 0) - splitChars = Number.MAX_VALUE; - else - splitChars = splits[0]; - - if (!onlyContents) { - stringBuilder.push("
" - ); - } - - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - var value = token.value; - - if (chars + value.length < splitChars) { - screenColumn = self.$renderToken( - stringBuilder, screenColumn, token, value - ); - chars += value.length; - } - else { - while (chars + value.length >= splitChars) { - screenColumn = self.$renderToken( - stringBuilder, screenColumn, - token, value.substring(0, splitChars - chars) - ); - value = value.substring(splitChars - chars); - chars = splitChars; - - if (!onlyContents) { - stringBuilder.push("
", - "
" - ); - } - - split ++; - screenColumn = 0; - splitChars = splits[split] || Number.MAX_VALUE; - } - if (value.length != 0) { - chars += value.length; - screenColumn = self.$renderToken( - stringBuilder, screenColumn, token, value - ); - } - } - } - - if (this.showInvisibles) { - if (lastRow !== this.session.getLength() - 1) - stringBuilder.push("" + this.EOL_CHAR + ""); - else - stringBuilder.push("" + this.EOF_CHAR + ""); - } - if (!onlyContents) - stringBuilder.push("
"); - }; - - this.$renderLine = function(stringBuilder, row, tokens, onlyContents) { - // Check if the line to render is folded or not. If not, things are - // simple, otherwise, we need to fake some things... - if (!this.session.isRowFolded(row)) { - var splits = this.session.getRowSplitData(row); - this.$renderLineCore(stringBuilder, row, tokens, splits, onlyContents); - } else { - this.$renderFoldLine(stringBuilder, row, tokens, onlyContents); - } - }; - - this.$renderFoldLine = function(stringBuilder, row, tokens, onlyContents) { - var session = this.session, - foldLine = session.getFoldLine(row), - renderTokens = []; - - function addTokens(tokens, from, to) { - var idx = 0, col = 0; - while ((col + tokens[idx].value.length) < from) { - col += tokens[idx].value.length; - idx++; - - if (idx == tokens.length) { - return; - } - } - if (col != from) { - var value = tokens[idx].value.substring(from - col); - // Check if the token value is longer then the from...to spacing. - if (value.length > (to - from)) { - value = value.substring(0, to - from); - } - - renderTokens.push({ - type: tokens[idx].type, - value: value - }); - - col = from + value.length; - idx += 1; - } - - while (col < to) { - var value = tokens[idx].value; - if (value.length + col > to) { - value = value.substring(0, to - col); - } - renderTokens.push({ - type: tokens[idx].type, - value: value - }); - col += value.length; - idx += 1; - } - } - - foldLine.walk(function(placeholder, row, column, lastColumn, isNewRow) { - if (placeholder) { - renderTokens.push({ - type: "fold", - value: placeholder - }); - } else { - if (isNewRow) { - tokens = this.session.getTokens(row, row)[0].tokens; - } - if (tokens.length != 0) { - addTokens(tokens, lastColumn, column); - } - } - }.bind(this), foldLine.end.row, this.session.getLine(foldLine.end.row).length); - - // TODO: Build a fake splits array! - var splits = this.session.$useWrapMode?this.session.$wrapData[row]:null; - this.$renderLineCore(stringBuilder, row, renderTokens, splits, onlyContents); - }; - - this.$useLineGroups = function() { - // For the updateLines function to work correctly, it's important that the - // child nodes of this.element correspond on a 1-to-1 basis to rows in the - // document (as distinct from lines on the screen). For sessions that are - // wrapped, this means we need to add a layer to the node hierarchy (tagged - // with the class name ace_line_group). - return this.session.getUseWrapMode(); - }; - - this.destroy = function() { - clearInterval(this.$pollSizeChangesTimer); - if (this.$measureNode) - this.$measureNode.parentNode.removeChild(this.$measureNode); - delete this.$measureNode; - }; - -}).call(Text.prototype); - -exports.Text = Text; - -}); - - -define("ace/layer/cursor",[], function(require, exports, module) { - -var dom = require("ace/lib/dom"); - -var Cursor = function(parentEl) { - this.element = dom.createElement("div"); - this.element.className = "ace_layer ace_cursor-layer"; - parentEl.appendChild(this.element); - - this.cursor = dom.createElement("div"); - this.cursor.className = "ace_cursor ace_hidden"; - this.element.appendChild(this.cursor); - - this.isVisible = false; -}; - -(function() { - - this.$padding = 0; - this.setPadding = function(padding) { - this.$padding = padding; - }; - - this.setSession = function(session) { - this.session = session; - }; - - this.hideCursor = function() { - this.isVisible = false; - dom.addCssClass(this.cursor, "ace_hidden"); - clearInterval(this.blinkId); - }; - - this.showCursor = function() { - this.isVisible = true; - dom.removeCssClass(this.cursor, "ace_hidden"); - this.cursor.style.visibility = "visible"; - this.restartTimer(); - }; - - this.restartTimer = function() { - clearInterval(this.blinkId); - if (!this.isVisible) { - return; - } - - var cursor = this.cursor; - this.blinkId = setInterval(function() { - cursor.style.visibility = "hidden"; - setTimeout(function() { - cursor.style.visibility = "visible"; - }, 400); - }, 1000); - }; - - this.getPixelPosition = function(onScreen) { - if (!this.config || !this.session) { - return { - left : 0, - top : 0 - }; - } - - var position = this.session.selection.getCursor(); - var pos = this.session.documentToScreenPosition(position); - var cursorLeft = Math.round(this.$padding + - pos.column * this.config.characterWidth); - var cursorTop = (pos.row - (onScreen ? this.config.firstRowScreen : 0)) * - this.config.lineHeight; - - return { - left : cursorLeft, - top : cursorTop - }; - }; - - this.update = function(config) { - this.config = config; - - this.pixelPos = this.getPixelPosition(true); - - this.cursor.style.left = this.pixelPos.left + "px"; - this.cursor.style.top = this.pixelPos.top + "px"; - this.cursor.style.width = config.characterWidth + "px"; - this.cursor.style.height = config.lineHeight + "px"; - - var overwrite = this.session.getOverwrite() - if (overwrite != this.overwrite) { - this.overwrite = overwrite; - if (overwrite) - dom.addCssClass(this.cursor, "ace_overwrite"); - else - dom.removeCssClass(this.cursor, "ace_overwrite"); - } - - this.restartTimer(); - }; - - this.destroy = function() { - clearInterval(this.blinkId); - } - -}).call(Cursor.prototype); - -exports.Cursor = Cursor; - -}); - - -define("ace/scrollbar",[], function(require, exports, module) { - -var oop = require("ace/lib/oop"); -var dom = require("ace/lib/dom"); -var event = require("ace/lib/event"); -var EventEmitter = require("ace/lib/event_emitter").EventEmitter; - -var ScrollBar = function(parent) { - this.element = dom.createElement("div"); - this.element.className = "ace_sb"; - - this.inner = dom.createElement("div"); - this.element.appendChild(this.inner); - - parent.appendChild(this.element); - - // in OSX lion the scrollbars appear to have no width. In this case resize - // the to show the scrollbar but still pretend that the scrollbar has a width - // of 0px - // in Firefox 6+ scrollbar is hidden if element has the same width as scrollbar - // make element a little bit wider to retain scrollbar when page is zoomed - this.width = dom.scrollbarWidth(parent.ownerDocument); - this.element.style.width = (this.width || 15) + 5 + "px"; - - event.addListener(this.element, "scroll", this.onScroll.bind(this)); -}; - -(function() { - oop.implement(this, EventEmitter); - - this.onScroll = function() { - this._dispatchEvent("scroll", {data: this.element.scrollTop}); - }; - - this.getWidth = function() { - return this.width; - }; - - this.setHeight = function(height) { - this.element.style.height = height + "px"; - }; - - this.setInnerHeight = function(height) { - this.inner.style.height = height + "px"; - }; - - this.setScrollTop = function(scrollTop) { - this.element.scrollTop = scrollTop; - }; - -}).call(ScrollBar.prototype); - -exports.ScrollBar = ScrollBar; -}); - - -define("ace/renderloop",[], function(require, exports, module) { - -var event = require("ace/lib/event"); - -var RenderLoop = function(onRender, window) { - this.onRender = onRender; - this.pending = false; - this.changes = 0; - this.setTimeoutZero = this.setTimeoutZero.bind(window); -}; - -(function() { - - this.schedule = function(change) { - //this.onRender(change); - //return; - this.changes = this.changes | change; - if (!this.pending) { - this.pending = true; - var _self = this; - this.setTimeoutZero(function() { - _self.pending = false; - var changes = _self.changes; - _self.changes = 0; - _self.onRender(changes); - }); - } - }; - - if (window.postMessage) { - this.setTimeoutZero = (function(messageName, attached, listener) { - return function setTimeoutZero(callback) { - // Set up listener if not listening already. - if (!attached) { - event.addListener(this, "message", function(e) { - if (listener && e.data == messageName) { - event.stopPropagation(e); - listener(); - } - }); - attached = true; - } - - listener = callback; - this.postMessage(messageName, "*"); - }; - })("zero-timeout-message", false, null); - } - else { - this.setTimeoutZero = function(callback) { - this.setTimeout(callback, 0); - }; - } - -}).call(RenderLoop.prototype); - -exports.RenderLoop = RenderLoop; -}); -define("ace/css/editor.css",[], "\ -\ -.ace_editor {\ - position: absolute;\ - overflow: hidden;\ - font-family: monospace;\ - font-size: 12px;\ -}\ -\ -.ace_scroller {\ - position: absolute;\ - overflow-x: scroll;\ - overflow-y: hidden;\ -}\ -\ -.ace_content {\ - position: absolute;\ - box-sizing: border-box;\ - -moz-box-sizing: border-box;\ - -webkit-box-sizing: border-box;\ - cursor: text;\ -}\ -\ -/* setting pointer-events: auto; on node under the mouse, which changes during scroll,\ - will break mouse wheel scrolling in Safari */\ -.ace_content * {\ - pointer-events: none;\ -}\ -\ -.ace_composition {\ - position: absolute;\ - background: #555;\ - color: #DDD;\ - z-index: 4;\ -}\ -\ -.ace_gutter {\ - position: absolute;\ - overflow-x: hidden;\ - overflow-y: hidden;\ - height: 100%;\ - cursor: default;\ -}\ -\ -.ace_gutter-cell.ace_error {\ - background-image: url(\"data:image/gif,GIF89a%10%00%10%00%D5%00%00%F5or%F5%87%88%F5nr%F4ns%EBmq%F5z%7F%DDJT%DEKS%DFOW%F1Yc%F2ah%CE(7%CE)8%D18E%DD%40M%F2KZ%EBU%60%F4%60m%DCir%C8%16(%C8%19*%CE%255%F1%3FR%F1%3FS%E6%AB%B5%CA%5DI%CEn%5E%F7%A2%9A%C9G%3E%E0a%5B%F7%89%85%F5yy%F6%82%80%ED%82%80%FF%BF%BF%E3%C4%C4%FF%FF%FF%FF%FF%FF%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00!%F9%04%01%00%00%25%00%2C%00%00%00%00%10%00%10%00%00%06p%C0%92pH%2C%1A%8F%C8%D2H%93%E1d4%23%E4%88%D3%09mB%1DN%B48%F5%90%40%60%92G%5B%94%20%3E%22%D2%87%24%FA%20%24%C5%06A%00%20%B1%07%02B%A38%89X.v%17%82%11%13q%10%0Fi%24%0F%8B%10%7BD%12%0Ei%09%92%09%0EpD%18%15%24%0A%9Ci%05%0C%18F%18%0B%07%04%01%04%06%A0H%18%12%0D%14%0D%12%A1I%B3%B4%B5IA%00%3B\");\ - background-repeat: no-repeat;\ - background-position: 4px center;\ -}\ -\ -.ace_gutter-cell.ace_warning {\ - background-image: url(\"data:image/gif,GIF89a%10%00%10%00%D5%00%00%FF%DBr%FF%DE%81%FF%E2%8D%FF%E2%8F%FF%E4%96%FF%E3%97%FF%E5%9D%FF%E6%9E%FF%EE%C1%FF%C8Z%FF%CDk%FF%D0s%FF%D4%81%FF%D5%82%FF%D5%83%FF%DC%97%FF%DE%9D%FF%E7%B8%FF%CCl%7BQ%13%80U%15%82W%16%81U%16%89%5B%18%87%5B%18%8C%5E%1A%94d%1D%C5%83-%C9%87%2F%C6%84.%C6%85.%CD%8B2%C9%871%CB%8A3%CD%8B5%DC%98%3F%DF%9BB%E0%9CC%E1%A5U%CB%871%CF%8B5%D1%8D6%DB%97%40%DF%9AB%DD%99B%E3%B0p%E7%CC%AE%FF%FF%FF%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00!%F9%04%01%00%00%2F%00%2C%00%00%00%00%10%00%10%00%00%06a%C0%97pH%2C%1A%8FH%A1%ABTr%25%87%2B%04%82%F4%7C%B9X%91%08%CB%99%1C!%26%13%84*iJ9(%15G%CA%84%14%01%1A%97%0C%03%80%3A%9A%3E%81%84%3E%11%08%B1%8B%20%02%12%0F%18%1A%0F%0A%03'F%1C%04%0B%10%16%18%10%0B%05%1CF%1D-%06%07%9A%9A-%1EG%1B%A0%A1%A0U%A4%A5%A6BA%00%3B\");\ - background-repeat: no-repeat;\ - background-position: 4px center;\ -}\ -\ -.ace_editor .ace_sb {\ - position: absolute;\ - overflow-x: hidden;\ - overflow-y: scroll;\ - right: 0;\ -}\ -\ -.ace_editor .ace_sb div {\ - position: absolute;\ - width: 1px;\ - left: 0;\ -}\ -\ -.ace_editor .ace_print_margin_layer {\ - z-index: 0;\ - position: absolute;\ - overflow: hidden;\ - margin: 0;\ - left: 0;\ - height: 100%;\ - width: 100%;\ -}\ -\ -.ace_editor .ace_print_margin {\ - position: absolute;\ - height: 100%;\ -}\ -\ -.ace_editor textarea {\ - position: fixed;\ - z-index: -1;\ - width: 10px;\ - height: 30px;\ - opacity: 0;\ - background: transparent;\ - appearance: none;\ - -moz-appearance: none;\ - border: none;\ - resize: none;\ - outline: none;\ - overflow: hidden;\ -}\ -\ -.ace_layer {\ - z-index: 1;\ - position: absolute;\ - overflow: hidden;\ - white-space: nowrap;\ - height: 100%;\ - width: 100%;\ -}\ -\ -.ace_text-layer {\ - color: black;\ -}\ -\ -.ace_cjk {\ - display: inline-block;\ - text-align: center;\ -}\ -\ -.ace_cursor-layer {\ - z-index: 4;\ -}\ -\ -.ace_cursor {\ - z-index: 4;\ - position: absolute;\ -}\ -\ -.ace_cursor.ace_hidden {\ - opacity: 0.2;\ -}\ -\ -.ace_line {\ - white-space: nowrap;\ -}\ -\ -.ace_marker-layer .ace_step {\ - position: absolute;\ - z-index: 3;\ -}\ -\ -.ace_marker-layer .ace_selection {\ - position: absolute;\ - z-index: 4;\ -}\ -\ -.ace_marker-layer .ace_bracket {\ - position: absolute;\ - z-index: 5;\ -}\ -\ -.ace_marker-layer .ace_active_line {\ - position: absolute;\ - z-index: 2;\ -}\ -\ -.ace_marker-layer .ace_selected_word {\ - position: absolute;\ - z-index: 6;\ - box-sizing: border-box;\ - -moz-box-sizing: border-box;\ - -webkit-box-sizing: border-box;\ -}\ -\ -.ace_line .ace_fold {\ - cursor: pointer;\ - pointer-events: auto;\ - color: darkred;\ - -moz-outline-radius: 4px;\ - background: none repeat scroll 0 0 transparent;\ - border-radius: 4px;\ - box-shadow: 0 0 1px 1px #FFFFFF inset;\ - outline: 1px solid #1C00FF;\ - outline-offset: -2px;\ - pointer-events: auto;\ -}\ -\ -.ace_fold:hover{\ - background: gold!important;\ -}\ -\ -.ace_dragging .ace_content {\ - cursor: move;\ -}\ -"); - -// Most of the following code is taken from SproutCore with a few changes. - -define("ace/lib/keys",[], function(require, exports, module) { - -var oop = require("ace/lib/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 - }, - - 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", - 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].toUpperCase(); - 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); - - return ret; -})(); -oop.mixin(exports, Keys); - -exports.keyCodeToString = function(keyCode) { - return (Keys[keyCode] || String.fromCharCode(keyCode)).toLowerCase(); -} - -}); - - -define("ace/mouse/default_handlers",[], function(require, exports, module) { - -var event = require("ace/lib/event"); -var dom = require("ace/lib/dom"); -var EventEmitter = require("ace/lib/event_emitter").EventEmitter; - -var STATE_UNKNOWN = 0; -var STATE_SELECT = 1; -var STATE_DRAG = 2; - -var DRAG_TIMER = 250; // milliseconds -var DRAG_OFFSET = 5; // pixels - -function DefaultHandlers(editor) { - this.editor = editor; - this.$clickSelection = null; - - editor.setDefaultHandler("mousedown", this.onMouseDown.bind(this)); - editor.setDefaultHandler("dblclick", this.onDoubleClick.bind(this)); - editor.setDefaultHandler("tripleclick", this.onTripleClick.bind(this)); - editor.setDefaultHandler("quadclick", this.onQuadClick.bind(this)); - editor.setDefaultHandler("mousewheel", this.onScroll.bind(this)); -} - -(function() { - - this.onMouseDown = function(ev) { - var inSelection = ev.inSelection(); - var pageX = ev.pageX; - var pageY = ev.pageY; - var pos = ev.getDocumentPosition(); - var editor = this.editor; - var _self = this; - - var selectionRange = editor.getSelectionRange(); - var selectionEmpty = selectionRange.isEmpty(); - var state = STATE_UNKNOWN; - - var button = ev.getButton(); - if (button !== 0) { - if (selectionEmpty) { - editor.moveCursorToPosition(pos); - } - if(button == 2) { - editor.textInput.onContextMenu({x: pageX, y: pageY}, selectionEmpty); - event.capture(editor.container, function(){}, editor.textInput.onContextMenuClose); - } - return; - } - else { - // Select the fold as the user clicks it. - var fold = editor.session.getFoldAt(pos.row, pos.column, 1); - if (fold) { - editor.selection.setSelectionRange(fold.range); - return; - } - } - - if (!inSelection) { - // Directly pick STATE_SELECT, since the user is not clicking inside - // a selection. - onStartSelect(pos); - } - - var mousePageX = pageX, mousePageY = pageY; - var overwrite = editor.getOverwrite(); - var mousedownTime = (new Date()).getTime(); - var dragCursor, dragRange; - - var onMouseSelection = function(e) { - mousePageX = event.getDocumentX(e); - mousePageY = event.getDocumentY(e); - }; - - var onMouseSelectionEnd = function(e) { - clearInterval(timerId); - if (state == STATE_UNKNOWN) - onStartSelect(pos); - else if (state == STATE_DRAG) - onMouseDragSelectionEnd(e); - - _self.$clickSelection = null; - state = STATE_UNKNOWN; - }; - - var onMouseDragSelectionEnd = function(e) { - dom.removeCssClass(editor.container, "ace_dragging"); - editor.session.removeMarker(dragSelectionMarker); - - if (!editor.$mouseHandler.$clickSelection) { - if (!dragCursor) { - editor.moveCursorToPosition(pos); - editor.selection.clearSelection(pos.row, pos.column); - } - } - - if (!dragCursor) - return; - - if (dragRange.contains(dragCursor.row, dragCursor.column)) { - dragCursor = null; - return; - } - - editor.clearSelection(); - if (e && (e.ctrlKey || e.altKey)) { - var session = editor.session; - var newRange = session.insert(dragCursor, session.getTextRange(dragRange)); - } else { - var newRange = editor.moveText(dragRange, dragCursor); - } - if (!newRange) { - dragCursor = null; - return; - } - - editor.selection.setSelectionRange(newRange); - }; - - var onSelectionInterval = function() { - if (state == STATE_UNKNOWN) { - var distance = calcDistance(pageX, pageY, mousePageX, mousePageY); - var time = (new Date()).getTime(); - - if (distance > DRAG_OFFSET) { - state = STATE_SELECT; - var cursor = editor.renderer.screenToTextCoordinates(mousePageX, mousePageY); - cursor.row = Math.max(0, Math.min(cursor.row, editor.session.getLength()-1)); - onStartSelect(cursor); - } - else if ((time - mousedownTime) > DRAG_TIMER) { - state = STATE_DRAG; - dragRange = editor.getSelectionRange(); - var style = editor.getSelectionStyle(); - dragSelectionMarker = editor.session.addMarker(dragRange, "ace_selection", style); - editor.clearSelection(); - dom.addCssClass(editor.container, "ace_dragging"); - } - - } - - if (state == STATE_DRAG) - onDragSelectionInterval(); - else if (state == STATE_SELECT) - onUpdateSelectionInterval(); - }; - - function onStartSelect(pos) { - if (ev.getShiftKey()) { - editor.selection.selectToPosition(pos); - } - else { - if (!_self.$clickSelection) { - editor.moveCursorToPosition(pos); - editor.selection.clearSelection(pos.row, pos.column); - } - } - state = STATE_SELECT; - } - - var onUpdateSelectionInterval = function() { - var anchor; - var cursor = editor.renderer.screenToTextCoordinates(mousePageX, mousePageY); - cursor.row = Math.max(0, Math.min(cursor.row, editor.session.getLength()-1)); - - if (_self.$clickSelection) { - if (_self.$clickSelection.contains(cursor.row, cursor.column)) { - editor.selection.setSelectionRange(_self.$clickSelection); - } - else { - if (_self.$clickSelection.compare(cursor.row, cursor.column) == -1) { - anchor = _self.$clickSelection.end; - } - else { - anchor = _self.$clickSelection.start; - } - editor.selection.setSelectionAnchor(anchor.row, anchor.column); - editor.selection.selectToPosition(cursor); - } - } - else { - editor.selection.selectToPosition(cursor); - } - - editor.renderer.scrollCursorIntoView(); - }; - - var onDragSelectionInterval = function() { - dragCursor = editor.renderer.screenToTextCoordinates(mousePageX, mousePageY); - dragCursor.row = Math.max(0, Math.min(dragCursor.row, editor.session.getLength() - 1)); - - editor.moveCursorToPosition(dragCursor); - }; - - event.capture(editor.container, onMouseSelection, onMouseSelectionEnd); - var timerId = setInterval(onSelectionInterval, 20); - - return ev.preventDefault(); - }; - - this.onDoubleClick = function(ev) { - var pos = ev.getDocumentPosition(); - var editor = this.editor; - - // If the user dclicked on a fold, then expand it. - var fold = editor.session.getFoldAt(pos.row, pos.column, 1); - if (fold) { - editor.session.expandFold(fold); - } - else { - editor.moveCursorToPosition(pos); - editor.selection.selectWord(); - this.$clickSelection = editor.getSelectionRange(); - } - }; - - this.onTripleClick = function(ev) { - var pos = ev.getDocumentPosition(); - var editor = this.editor; - - editor.moveCursorToPosition(pos); - editor.selection.selectLine(); - this.$clickSelection = editor.getSelectionRange(); - }; - - this.onQuadClick = function(ev) { - var editor = this.editor; - - editor.selectAll(); - this.$clickSelection = editor.getSelectionRange(); - }; - - this.onScroll = function(ev) { - var editor = this.editor; - - editor.renderer.scrollBy(ev.wheelX * ev.speed, ev.wheelY * ev.speed); - if (editor.renderer.isScrollableBy(ev.wheelX * ev.speed, ev.wheelY * ev.speed)) - return ev.preventDefault(); - }; - -}).call(DefaultHandlers.prototype); - -exports.DefaultHandlers = DefaultHandlers; - -function calcDistance(ax, ay, bx, by) { - return Math.sqrt(Math.pow(bx - ax, 2) + Math.pow(by - ay, 2)); -} - -}); - - -define("ace/mouse/mouse_event",[], function(require, exports, module) { - -var event = require("ace/lib/event"); -var dom = require("ace/lib/dom"); - -/** - * Custom Ace mouse event - */ -var MouseEvent = exports.MouseEvent = function(domEvent, editor) { - this.domEvent = domEvent; - this.editor = editor; - - this.pageX = event.getDocumentX(domEvent); - this.pageY = event.getDocumentY(domEvent); - - this.$pos = null; - this.$inSelection = null; - - this.propagationStopped = false; - this.defaultPrevented = false; -}; - -(function() { - - this.stopPropagation = function() { - event.stopPropagation(this.domEvent); - this.propagationStopped = true; - }; - - this.preventDefault = function() { - event.preventDefault(this.domEvent); - this.defaultPrevented = true; - }; - - /** - * Get the document position below the mouse cursor - * - * @return {Object} 'row' and 'column' of the document position - */ - this.getDocumentPosition = function() { - if (this.$pos) - return this.$pos; - - var pageX = event.getDocumentX(this.domEvent); - var pageY = event.getDocumentY(this.domEvent); - this.$pos = this.editor.renderer.screenToTextCoordinates(pageX, pageY); - this.$pos.row = Math.max(0, Math.min(this.$pos.row, this.editor.session.getLength()-1)); - return this.$pos; - }; - - /** - * Check if the mouse cursor is inside of the text selection - * - * @return {Boolean} whether the mouse cursor is inside of the selection - */ - this.inSelection = function() { - if (this.$inSelection !== null) - return this.$inSelection; - - var editor = this.editor; - - if (editor.getReadOnly()) { - this.$inSelection = false; - } - else { - var selectionRange = editor.getSelectionRange(); - if (selectionRange.isEmpty()) - this.$inSelection = false; - else { - var pos = this.getDocumentPosition(); - this.$inSelection = selectionRange.contains(pos.row, pos.column); - } - } - return this.$inSelection; - }; - - /** - * Get the clicked mouse button - * - * @return {Number} 0 for left button, 1 for middle button, 2 for right button - */ - this.getButton = function() { - return event.getButton(this.domEvent); - }; - - /** - * @return {Boolean} whether the shift key was pressed when the event was emitted - */ - this.getShiftKey = function() { - return this.domEvent.shiftKey; - }; - -}).call(MouseEvent.prototype); - -}); - -define("ace/selection",[], function(require, exports, module) { - -var oop = require("ace/lib/oop"); -var lang = require("ace/lib/lang"); -var EventEmitter = require("ace/lib/event_emitter").EventEmitter; -var Range = require("ace/range").Range; - -/** - * Keeps cursor position and the text selection of an edit session. - * - * The row/columns used in the selection are in document coordinates - * representing ths coordinates as thez appear in the document - * before applying soft wrap and folding. - */ -var Selection = function(session) { - this.session = session; - this.doc = session.getDocument(); - - this.clearSelection(); - this.selectionLead = this.doc.createAnchor(0, 0); - this.selectionAnchor = this.doc.createAnchor(0, 0); - - var _self = this; - this.selectionLead.on("change", function(e) { - _self._dispatchEvent("changeCursor"); - if (!_self.$isEmpty) - _self._dispatchEvent("changeSelection"); - if (!_self.$preventUpdateDesiredColumnOnChange && e.old.column != e.value.column) - _self.$updateDesiredColumn(); - }); - - this.selectionAnchor.on("change", function() { - if (!_self.$isEmpty) - _self._dispatchEvent("changeSelection"); - }); -}; - -(function() { - - oop.implement(this, EventEmitter); - - this.isEmpty = function() { - return (this.$isEmpty || ( - this.selectionAnchor.row == this.selectionLead.row && - this.selectionAnchor.column == this.selectionLead.column - )); - }; - - this.isMultiLine = function() { - if (this.isEmpty()) { - return false; - } - - return this.getRange().isMultiLine(); - }; - - this.getCursor = function() { - return this.selectionLead.getPosition(); - }; - - this.setSelectionAnchor = function(row, column) { - this.selectionAnchor.setPosition(row, column); - - if (this.$isEmpty) { - this.$isEmpty = false; - this._dispatchEvent("changeSelection"); - } - }; - - this.getSelectionAnchor = function() { - if (this.$isEmpty) - return this.getSelectionLead() - else - return this.selectionAnchor.getPosition(); - }; - - this.getSelectionLead = function() { - return this.selectionLead.getPosition(); - }; - - this.shiftSelection = function(columns) { - if (this.$isEmpty) { - this.moveCursorTo(this.selectionLead.row, this.selectionLead.column + columns); - return; - }; - - var anchor = this.getSelectionAnchor(); - var lead = this.getSelectionLead(); - - var isBackwards = this.isBackwards(); - - if (!isBackwards || anchor.column !== 0) - this.setSelectionAnchor(anchor.row, anchor.column + columns); - - if (isBackwards || lead.column !== 0) { - this.$moveSelection(function() { - this.moveCursorTo(lead.row, lead.column + columns); - }); - } - }; - - this.isBackwards = function() { - var anchor = this.selectionAnchor; - var lead = this.selectionLead; - return (anchor.row > lead.row || (anchor.row == lead.row && anchor.column > lead.column)); - }; - - this.getRange = function() { - var anchor = this.selectionAnchor; - var lead = this.selectionLead; - - if (this.isEmpty()) - return Range.fromPoints(lead, lead); - - if (this.isBackwards()) { - return Range.fromPoints(lead, anchor); - } - else { - return Range.fromPoints(anchor, lead); - } - }; - - this.clearSelection = function() { - if (!this.$isEmpty) { - this.$isEmpty = true; - this._dispatchEvent("changeSelection"); - } - }; - - this.selectAll = function() { - var lastRow = this.doc.getLength() - 1; - this.setSelectionAnchor(lastRow, this.doc.getLine(lastRow).length); - this.moveCursorTo(0, 0); - }; - - this.setSelectionRange = function(range, reverse) { - if (reverse) { - this.setSelectionAnchor(range.end.row, range.end.column); - this.selectTo(range.start.row, range.start.column); - } else { - this.setSelectionAnchor(range.start.row, range.start.column); - this.selectTo(range.end.row, range.end.column); - } - this.$updateDesiredColumn(); - }; - - this.$updateDesiredColumn = function() { - var cursor = this.getCursor(); - this.$desiredColumn = this.session.documentToScreenColumn(cursor.row, cursor.column); - }; - - this.$moveSelection = function(mover) { - var lead = this.selectionLead; - if (this.$isEmpty) - this.setSelectionAnchor(lead.row, lead.column); - - mover.call(this); - }; - - this.selectTo = function(row, column) { - this.$moveSelection(function() { - this.moveCursorTo(row, column); - }); - }; - - this.selectToPosition = function(pos) { - this.$moveSelection(function() { - this.moveCursorToPosition(pos); - }); - }; - - this.selectUp = function() { - this.$moveSelection(this.moveCursorUp); - }; - - this.selectDown = function() { - this.$moveSelection(this.moveCursorDown); - }; - - this.selectRight = function() { - this.$moveSelection(this.moveCursorRight); - }; - - this.selectLeft = function() { - this.$moveSelection(this.moveCursorLeft); - }; - - this.selectLineStart = function() { - this.$moveSelection(this.moveCursorLineStart); - }; - - this.selectLineEnd = function() { - this.$moveSelection(this.moveCursorLineEnd); - }; - - this.selectFileEnd = function() { - this.$moveSelection(this.moveCursorFileEnd); - }; - - this.selectFileStart = function() { - this.$moveSelection(this.moveCursorFileStart); - }; - - this.selectWordRight = function() { - this.$moveSelection(this.moveCursorWordRight); - }; - - this.selectWordLeft = function() { - this.$moveSelection(this.moveCursorWordLeft); - }; - - this.selectWord = function() { - var cursor = this.getCursor(); - var range = this.session.getWordRange(cursor.row, cursor.column); - this.setSelectionRange(range); - }; - - this.selectLine = function() { - var rowStart = this.selectionLead.row; - var rowEnd; - - var foldLine = this.session.getFoldLine(rowStart); - if (foldLine) { - rowStart = foldLine.start.row; - rowEnd = foldLine.end.row; - } else { - rowEnd = rowStart; - } - this.setSelectionAnchor(rowStart, 0); - this.$moveSelection(function() { - this.moveCursorTo(rowEnd + 1, 0); - }); - }; - - this.moveCursorUp = function() { - this.moveCursorBy(-1, 0); - }; - - this.moveCursorDown = function() { - this.moveCursorBy(1, 0); - }; - - this.moveCursorLeft = function() { - var cursor = this.selectionLead.getPosition(), - fold; - - if (fold = this.session.getFoldAt(cursor.row, cursor.column, -1)) { - this.moveCursorTo(fold.start.row, fold.start.column); - } else if (cursor.column == 0) { - // cursor is a line (start - if (cursor.row > 0) { - this.moveCursorTo(cursor.row - 1, this.doc.getLine(cursor.row - 1).length); - } - } - else { - var tabSize = this.session.getTabSize(); - if (this.session.isTabStop(cursor) && this.doc.getLine(cursor.row).slice(cursor.column-tabSize, cursor.column).split(" ").length-1 == tabSize) - this.moveCursorBy(0, -tabSize); - else - this.moveCursorBy(0, -1); - } - }; - - this.moveCursorRight = function() { - var cursor = this.selectionLead.getPosition(), - fold; - if (fold = this.session.getFoldAt(cursor.row, cursor.column, 1)) { - this.moveCursorTo(fold.end.row, fold.end.column); - } - else if (this.selectionLead.column == this.doc.getLine(this.selectionLead.row).length) { - if (this.selectionLead.row < this.doc.getLength() - 1) { - this.moveCursorTo(this.selectionLead.row + 1, 0); - } - } - else { - var tabSize = this.session.getTabSize(); - var cursor = this.selectionLead; - if (this.session.isTabStop(cursor) && this.doc.getLine(cursor.row).slice(cursor.column, cursor.column+tabSize).split(" ").length-1 == tabSize) - this.moveCursorBy(0, tabSize); - else - this.moveCursorBy(0, 1); - } - }; - - this.moveCursorLineStart = function() { - var row = this.selectionLead.row; - var column = this.selectionLead.column; - var screenRow = this.session.documentToScreenRow(row, column); - - // Determ the doc-position of the first character at the screen line. - var firstColumnPosition = this.session.screenToDocumentPosition(screenRow, 0); - - // Determ the line - var beforeCursor = this.session.getDisplayLine( - row, null, - firstColumnPosition.row, firstColumnPosition.column - ); - - var leadingSpace = beforeCursor.match(/^\s*/); - if (leadingSpace[0].length == column) { - this.moveCursorTo( - firstColumnPosition.row, firstColumnPosition.column - ); - } - else { - this.moveCursorTo( - firstColumnPosition.row, - firstColumnPosition.column + leadingSpace[0].length - ); - } - }; - - this.moveCursorLineEnd = function() { - var lead = this.selectionLead; - var lastRowColumnPosition = - this.session.getDocumentLastRowColumnPosition(lead.row, lead.column); - this.moveCursorTo( - lastRowColumnPosition.row, - lastRowColumnPosition.column - ); - }; - - this.moveCursorFileEnd = function() { - var row = this.doc.getLength() - 1; - var column = this.doc.getLine(row).length; - this.moveCursorTo(row, column); - }; - - this.moveCursorFileStart = function() { - this.moveCursorTo(0, 0); - }; - - this.moveCursorWordRight = function() { - var row = this.selectionLead.row; - var column = this.selectionLead.column; - var line = this.doc.getLine(row); - var rightOfCursor = line.substring(column); - - var match; - this.session.nonTokenRe.lastIndex = 0; - this.session.tokenRe.lastIndex = 0; - - var fold; - if (fold = this.session.getFoldAt(row, column, 1)) { - this.moveCursorTo(fold.end.row, fold.end.column); - return; - } else if (column == line.length) { - this.moveCursorRight(); - return; - } - else if (match = this.session.nonTokenRe.exec(rightOfCursor)) { - column += this.session.nonTokenRe.lastIndex; - this.session.nonTokenRe.lastIndex = 0; - } - else if (match = this.session.tokenRe.exec(rightOfCursor)) { - column += this.session.tokenRe.lastIndex; - this.session.tokenRe.lastIndex = 0; - } - - this.moveCursorTo(row, column); - }; - - this.moveCursorWordLeft = function() { - var row = this.selectionLead.row; - var column = this.selectionLead.column; - - var fold; - if (fold = this.session.getFoldAt(row, column, -1)) { - this.moveCursorTo(fold.start.row, fold.start.column); - return; - } - - if (column == 0) { - this.moveCursorLeft(); - return; - } - - var str = this.session.getFoldStringAt(row, column, -1); - if (str == null) { - str = this.doc.getLine(row).substring(0, column) - } - var leftOfCursor = lang.stringReverse(str); - - var match; - this.session.nonTokenRe.lastIndex = 0; - this.session.tokenRe.lastIndex = 0; - - if (match = this.session.nonTokenRe.exec(leftOfCursor)) { - column -= this.session.nonTokenRe.lastIndex; - this.session.nonTokenRe.lastIndex = 0; - } - else if (match = this.session.tokenRe.exec(leftOfCursor)) { - column -= this.session.tokenRe.lastIndex; - this.session.tokenRe.lastIndex = 0; - } - - this.moveCursorTo(row, column); - }; - - this.moveCursorBy = function(rows, chars) { - var row = this.selectionLead.row; - var col = this.selectionLead.column; - - var screenPos = this.session.documentToScreenPosition(row, col); - var screenCol = (chars == 0 && this.$desiredColumn) || screenPos.column; - var docPos = this.session.screenToDocumentPosition(screenPos.row + rows, screenCol); - - // if we are at the EOL of current line, and targetline is all whitespace - // set the new column to the EOL of the target line, without updating desired column - // TODO: will this be better handled in moveCursorUP/Down? - if (chars == 0) { - var currentLine = this.session.getLine(row); - var targetLine = this.session.getLine(docPos.row); - if ( - currentLine && targetLine - && currentLine.length === col - && targetLine.match(/^\s*$/) - ) { - docPos.column = targetLine.length; - } - } - - // move the cursor and update the desired column - this.moveCursorTo(docPos.row, docPos.column + chars, chars == 0); - }; - - this.moveCursorToPosition = function(position) { - this.moveCursorTo(position.row, position.column); - }; - - this.moveCursorTo = function(row, column, preventUpdateDesiredColumn) { - // Ensure the row/column is not inside of a fold. - var fold = this.session.getFoldAt(row, column, 1); - if (fold) { - row = fold.start.row; - column = fold.start.column; - } - - this.$preventUpdateDesiredColumnOnChange = true; - this.selectionLead.setPosition(row, column); - this.$preventUpdateDesiredColumnOnChange = false; - - if (!preventUpdateDesiredColumn) - this.$updateDesiredColumn(this.selectionLead.column); - }; - - this.moveCursorToScreen = function(row, column, preventUpdateDesiredColumn) { - var pos = this.session.screenToDocumentPosition(row, column); - row = pos.row; - column = pos.column; - this.moveCursorTo(row, column, preventUpdateDesiredColumn); - }; - -}).call(Selection.prototype); - -exports.Selection = Selection; -}); - - -define("ace/mode/text",[], function(require, exports, module) { - -var Tokenizer = require("ace/tokenizer").Tokenizer; -var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules; -var Behaviour = require("ace/mode/behaviour").Behaviour; -var unicode = require("ace/unicode"); - -var Mode = function() { - this.$tokenizer = new Tokenizer(new TextHighlightRules().getRules()); - this.$behaviour = new Behaviour(); -}; - -(function() { - - this.tokenRe = new RegExp("^[" - + unicode.packages.L - + unicode.packages.Mn + unicode.packages.Mc - + unicode.packages.Nd - + unicode.packages.Pc + "\\$_]+", "g" - ); - - this.nonTokenRe = new RegExp("^(?:[^" - + unicode.packages.L - + unicode.packages.Mn + unicode.packages.Mc - + unicode.packages.Nd - + unicode.packages.Pc + "\\$_]|\s])+", "g" - ); - - this.getTokenizer = function() { - return this.$tokenizer; - }; - - this.toggleCommentLines = function(state, doc, startRow, endRow) { - }; - - this.getNextLineIndent = function(state, line, tab) { - return ""; - }; - - this.checkOutdent = function(state, line, input) { - return false; - }; - - this.autoOutdent = function(state, doc, row) { - }; - - this.$getIndent = function(line) { - var match = line.match(/^(\s+)/); - if (match) { - return match[1]; - } - - return ""; - }; - - this.createWorker = function(session) { - return null; - }; - - this.highlightSelection = function(editor) { - var session = editor.session; - if (!session.$selectionOccurrences) - session.$selectionOccurrences = []; - - if (session.$selectionOccurrences.length) - this.clearSelectionHighlight(editor); - - var selection = editor.getSelectionRange(); - if (selection.isEmpty() || selection.isMultiLine()) - return; - - var startOuter = selection.start.column - 1; - var endOuter = selection.end.column + 1; - var line = session.getLine(selection.start.row); - var lineCols = line.length; - var needle = line.substring(Math.max(startOuter, 0), - Math.min(endOuter, lineCols)); - - // Make sure the outer characters are not part of the word. - if ((startOuter >= 0 && /^[\w\d]/.test(needle)) || - (endOuter <= lineCols && /[\w\d]$/.test(needle))) - return; - - needle = line.substring(selection.start.column, selection.end.column); - if (!/^[\w\d]+$/.test(needle)) - return; - - var cursor = editor.getCursorPosition(); - - var newOptions = { - wrap: true, - wholeWord: true, - caseSensitive: true, - needle: needle - }; - - var currentOptions = editor.$search.getOptions(); - editor.$search.set(newOptions); - - var ranges = editor.$search.findAll(session); - ranges.forEach(function(range) { - if (!range.contains(cursor.row, cursor.column)) { - var marker = session.addMarker(range, "ace_selected_word", "text"); - session.$selectionOccurrences.push(marker); - } - }); - - editor.$search.set(currentOptions); - }; - - this.clearSelectionHighlight = function(editor) { - if (!editor.session.$selectionOccurrences) - return; - - editor.session.$selectionOccurrences.forEach(function(marker) { - editor.session.removeMarker(marker); - }); - - editor.session.$selectionOccurrences = []; - }; - - this.createModeDelegates = function (mapping) { - if (!this.$embeds) { - return; - } - this.$modes = {}; - for (var i = 0; i < this.$embeds.length; i++) { - if (mapping[this.$embeds[i]]) { - this.$modes[this.$embeds[i]] = new mapping[this.$embeds[i]](); - } - } - - var delegations = ['toggleCommentLines', 'getNextLineIndent', 'checkOutdent', 'autoOutdent', 'transformAction']; - - for (var i = 0; i < delegations.length; i++) { - (function(scope) { - var functionName = delegations[i]; - var defaultHandler = scope[functionName]; - scope[delegations[i]] = function() { - return this.$delegator(functionName, arguments, defaultHandler); - } - } (this)); - } - } - - this.$delegator = function(method, args, defaultHandler) { - var state = args[0]; - - for (var i = 0; i < this.$embeds.length; i++) { - if (!this.$modes[this.$embeds[i]]) continue; - - var split = state.split(this.$embeds[i]); - if (!split[0] && split[1]) { - args[0] = split[1]; - var mode = this.$modes[this.$embeds[i]]; - return mode[method].apply(mode, args); - } - } - var ret = defaultHandler.apply(this, args); - return defaultHandler ? ret : undefined; - }; - - this.transformAction = function(state, action, editor, session, param) { - if (this.$behaviour) { - var behaviours = this.$behaviour.getBehaviours(); - for (var key in behaviours) { - if (behaviours[key][action]) { - var ret = behaviours[key][action].apply(this, arguments); - if (ret) { - return ret; - } - } - } - } - } - -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - - -define("ace/document",[], function(require, exports, module) { - -var oop = require("ace/lib/oop"); -var EventEmitter = require("ace/lib/event_emitter").EventEmitter; -var Range = require("ace/range").Range; -var Anchor = require("ace/anchor").Anchor; - -var Document = function(text) { - this.$lines = []; - - if (Array.isArray(text)) { - this.insertLines(0, text); - } - // There has to be one line at least in the document. If you pass an empty - // string to the insert function, nothing will happen. Workaround. - else if (text.length == 0) { - this.$lines = [""]; - } else { - this.insert({row: 0, column:0}, text); - } -}; - -(function() { - - oop.implement(this, EventEmitter); - - this.setValue = function(text) { - var len = this.getLength(); - this.remove(new Range(0, 0, len, this.getLine(len-1).length)); - this.insert({row: 0, column:0}, text); - }; - - this.getValue = function() { - return this.getAllLines().join(this.getNewLineCharacter()); - }; - - this.createAnchor = function(row, column) { - return new Anchor(this, row, column); - }; - - // check for IE split bug - if ("aaa".split(/a/).length == 0) - this.$split = function(text) { - return text.replace(/\r\n|\r/g, "\n").split("\n"); - } - else - this.$split = function(text) { - return text.split(/\r\n|\r|\n/); - }; - - - this.$detectNewLine = function(text) { - var match = text.match(/^.*?(\r\n|\r|\n)/m); - if (match) { - this.$autoNewLine = match[1]; - } else { - this.$autoNewLine = "\n"; - } - }; - - this.getNewLineCharacter = function() { - switch (this.$newLineMode) { - case "windows": - return "\r\n"; - - case "unix": - return "\n"; - - case "auto": - return this.$autoNewLine; - } - }, - - this.$autoNewLine = "\n"; - this.$newLineMode = "auto"; - this.setNewLineMode = function(newLineMode) { - if (this.$newLineMode === newLineMode) - return; - - this.$newLineMode = newLineMode; - }; - - this.getNewLineMode = function() { - return this.$newLineMode; - }; - - this.isNewLine = function(text) { - return (text == "\r\n" || text == "\r" || text == "\n"); - }; - - /** - * Get a verbatim copy of the given line as it is in the document - */ - this.getLine = function(row) { - return this.$lines[row] || ""; - }; - - this.getLines = function(firstRow, lastRow) { - return this.$lines.slice(firstRow, lastRow + 1); - }; - - /** - * Returns all lines in the document as string array. Warning: The caller - * should not modify this array! - */ - this.getAllLines = function() { - return this.getLines(0, this.getLength()); - }; - - this.getLength = function() { - return this.$lines.length; - }; - - this.getTextRange = function(range) { - if (range.start.row == range.end.row) { - return this.$lines[range.start.row].substring(range.start.column, - range.end.column); - } - else { - var lines = []; - lines.push(this.$lines[range.start.row].substring(range.start.column)); - lines.push.apply(lines, this.getLines(range.start.row+1, range.end.row-1)); - lines.push(this.$lines[range.end.row].substring(0, range.end.column)); - return lines.join(this.getNewLineCharacter()); - } - }; - - this.$clipPosition = function(position) { - var length = this.getLength(); - if (position.row >= length) { - position.row = Math.max(0, length - 1); - position.column = this.getLine(length-1).length; - } - return position; - } - - this.insert = function(position, text) { - if (text.length == 0) - return position; - - position = this.$clipPosition(position); - - if (this.getLength() <= 1) - this.$detectNewLine(text); - - var lines = this.$split(text); - var firstLine = lines.splice(0, 1)[0]; - var lastLine = lines.length == 0 ? null : lines.splice(lines.length - 1, 1)[0]; - - position = this.insertInLine(position, firstLine); - if (lastLine !== null) { - position = this.insertNewLine(position); // terminate first line - position = this.insertLines(position.row, lines); - position = this.insertInLine(position, lastLine || ""); - } - return position; - }; - - this.insertLines = function(row, lines) { - if (lines.length == 0) - return {row: row, column: 0}; - - var args = [row, 0]; - args.push.apply(args, lines); - this.$lines.splice.apply(this.$lines, args); - - var range = new Range(row, 0, row + lines.length, 0); - var delta = { - action: "insertLines", - range: range, - lines: lines - }; - this._dispatchEvent("change", { data: delta }); - return range.end; - }, - - this.insertNewLine = function(position) { - position = this.$clipPosition(position); - var line = this.$lines[position.row] || ""; - - this.$lines[position.row] = line.substring(0, position.column); - this.$lines.splice(position.row + 1, 0, line.substring(position.column, line.length)); - - var end = { - row : position.row + 1, - column : 0 - }; - - var delta = { - action: "insertText", - range: Range.fromPoints(position, end), - text: this.getNewLineCharacter() - }; - this._dispatchEvent("change", { data: delta }); - - return end; - }; - - this.insertInLine = function(position, text) { - if (text.length == 0) - return position; - - var line = this.$lines[position.row] || ""; - - this.$lines[position.row] = line.substring(0, position.column) + text - + line.substring(position.column); - - var end = { - row : position.row, - column : position.column + text.length - }; - - var delta = { - action: "insertText", - range: Range.fromPoints(position, end), - text: text - }; - this._dispatchEvent("change", { data: delta }); - - return end; - }; - - this.remove = function(range) { - // clip to document - range.start = this.$clipPosition(range.start); - range.end = this.$clipPosition(range.end); - - if (range.isEmpty()) - return range.start; - - var firstRow = range.start.row; - var lastRow = range.end.row; - - if (range.isMultiLine()) { - var firstFullRow = range.start.column == 0 ? firstRow : firstRow + 1; - var lastFullRow = lastRow - 1; - - if (range.end.column > 0) - this.removeInLine(lastRow, 0, range.end.column); - - if (lastFullRow >= firstFullRow) - this.removeLines(firstFullRow, lastFullRow); - - if (firstFullRow != firstRow) { - this.removeInLine(firstRow, range.start.column, this.getLine(firstRow).length); - this.removeNewLine(range.start.row); - } - } - else { - this.removeInLine(firstRow, range.start.column, range.end.column); - } - return range.start; - }; - - this.removeInLine = function(row, startColumn, endColumn) { - if (startColumn == endColumn) - return; - - var range = new Range(row, startColumn, row, endColumn); - var line = this.getLine(row); - var removed = line.substring(startColumn, endColumn); - var newLine = line.substring(0, startColumn) + line.substring(endColumn, line.length); - this.$lines.splice(row, 1, newLine); - - var delta = { - action: "removeText", - range: range, - text: removed - }; - this._dispatchEvent("change", { data: delta }); - return range.start; - }; - - /** - * Removes a range of full lines - * - * @param firstRow {Integer} The first row to be removed - * @param lastRow {Integer} The last row to be removed - * @return {String[]} The removed lines - */ - this.removeLines = function(firstRow, lastRow) { - var range = new Range(firstRow, 0, lastRow + 1, 0); - var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1); - - var delta = { - action: "removeLines", - range: range, - nl: this.getNewLineCharacter(), - lines: removed - }; - this._dispatchEvent("change", { data: delta }); - return removed; - }; - - this.removeNewLine = function(row) { - var firstLine = this.getLine(row); - var secondLine = this.getLine(row+1); - - var range = new Range(row, firstLine.length, row+1, 0); - var line = firstLine + secondLine; - - this.$lines.splice(row, 2, line); - - var delta = { - action: "removeText", - range: range, - text: this.getNewLineCharacter() - }; - this._dispatchEvent("change", { data: delta }); - }; - - this.replace = function(range, text) { - if (text.length == 0 && range.isEmpty()) - return range.start; - - // Shortcut: If the text we want to insert is the same as it is already - // in the document, we don't have to replace anything. - if (text == this.getTextRange(range)) - return range.end; - - this.remove(range); - if (text) { - var end = this.insert(range.start, text); - } - else { - end = range.start; - } - - return end; - }; - - this.applyDeltas = function(deltas) { - for (var i=0; i=0; i--) { - var delta = deltas[i]; - - var range = Range.fromPoints(delta.range.start, delta.range.end); - - if (delta.action == "insertLines") - this.removeLines(range.start.row, range.end.row - 1) - else if (delta.action == "insertText") - this.remove(range) - else if (delta.action == "removeLines") - this.insertLines(range.start.row, delta.lines) - else if (delta.action == "removeText") - this.insert(range.start, delta.text) - } - }; - -}).call(Document.prototype); - -exports.Document = Document; -}); - - -define("ace/background_tokenizer",[], function(require, exports, module) { - -var oop = require("ace/lib/oop"); -var EventEmitter = require("ace/lib/event_emitter").EventEmitter; - -var BackgroundTokenizer = function(tokenizer, editor) { - this.running = false; - this.lines = []; - this.currentLine = 0; - this.tokenizer = tokenizer; - - var self = this; - - this.$worker = function() { - if (!self.running) { return; } - - var workerStart = new Date(); - var startLine = self.currentLine; - var doc = self.doc; - - var processedLines = 0; - - var len = doc.getLength(); - while (self.currentLine < len) { - self.lines[self.currentLine] = self.$tokenizeRows(self.currentLine, self.currentLine)[0]; - self.currentLine++; - - // only check every 5 lines - processedLines += 1; - if ((processedLines % 5 == 0) && (new Date() - workerStart) > 20) { - self.fireUpdateEvent(startLine, self.currentLine-1); - self.running = setTimeout(self.$worker, 20); - return; - } - } - - self.running = false; - - self.fireUpdateEvent(startLine, len - 1); - }; -}; - -(function(){ - - oop.implement(this, EventEmitter); - - this.setTokenizer = function(tokenizer) { - this.tokenizer = tokenizer; - this.lines = []; - - this.start(0); - }; - - this.setDocument = function(doc) { - this.doc = doc; - this.lines = []; - - this.stop(); - }; - - this.fireUpdateEvent = function(firstRow, lastRow) { - var data = { - first: firstRow, - last: lastRow - }; - this._dispatchEvent("update", {data: data}); - }; - - this.start = function(startRow) { - this.currentLine = Math.min(startRow || 0, this.currentLine, - this.doc.getLength()); - - // remove all cached items below this line - this.lines.splice(this.currentLine, this.lines.length); - - this.stop(); - // pretty long delay to prevent the tokenizer from interfering with the user - this.running = setTimeout(this.$worker, 700); - }; - - this.stop = function() { - if (this.running) - clearTimeout(this.running); - this.running = false; - }; - - this.getTokens = function(firstRow, lastRow) { - return this.$tokenizeRows(firstRow, lastRow); - }; - - this.getState = function(row) { - return this.$tokenizeRows(row, row)[0].state; - }; - - this.$tokenizeRows = function(firstRow, lastRow) { - if (!this.doc) - return []; - - var rows = []; - - // determine start state - var state = "start"; - var doCache = false; - if (firstRow > 0 && this.lines[firstRow - 1]) { - state = this.lines[firstRow - 1].state; - doCache = true; - } else if (firstRow == 0) { - state = "start"; - doCache = true; - } else if (this.lines.length > 0) { - // Guess that we haven't changed state. - state = this.lines[this.lines.length-1].state; - } - - var lines = this.doc.getLines(firstRow, lastRow); - for (var row=firstRow; row<=lastRow; row++) { - if (!this.lines[row]) { - var tokens = this.tokenizer.getLineTokens(lines[row-firstRow] || "", state); - var state = tokens.state; - rows.push(tokens); - - if (doCache) { - this.lines[row] = tokens; - } - } - else { - var tokens = this.lines[row]; - state = tokens.state; - rows.push(tokens); - } - } - return rows; - }; - -}).call(BackgroundTokenizer.prototype); - -exports.BackgroundTokenizer = BackgroundTokenizer; -}); - - -define("ace/edit_session/folding",[], function(require, exports, module) { - -var Range = require("ace/range").Range; -var FoldLine = require("ace/edit_session/fold_line").FoldLine; -var Fold = require("ace/edit_session/fold").Fold; - -function Folding() { - /** - * Looks up a fold at a given row/column. Possible values for side: - * -1: ignore a fold if fold.start = row/column - * +1: ignore a fold if fold.end = row/column - */ - this.getFoldAt = function(row, column, side) { - var foldLine = this.getFoldLine(row); - if (!foldLine) - return null; - - var folds = foldLine.folds; - for (var i = 0; i < folds.length; i++) { - var fold = folds[i]; - if (fold.range.contains(row, column)) { - if (side == 1 && fold.range.isEnd(row, column)) { - continue; - } else if (side == -1 && fold.range.isStart(row, column)) { - continue; - } - return fold; - } - } - }; - - /** - * Returns all folds in the given range. Note, that this will return folds - * - */ - this.getFoldsInRange = function(range) { - range = range.clone(); - var start = range.start; - var end = range.end; - var foldLines = this.$foldData; - var foundFolds = []; - - start.column += 1; - end.column -= 1; - - for (var i = 0; i < foldLines.length; i++) { - var cmp = foldLines[i].range.compareRange(range); - if (cmp == 2) { - // Range is before foldLine. No intersection. This means, - // there might be other foldLines that intersect. - continue; - } - else if (cmp == -2) { - // Range is after foldLine. There can't be any other foldLines then, - // so let's give up. - break; - } - - var folds = foldLines[i].folds; - for (var j = 0; j < folds.length; j++) { - var fold = folds[j]; - cmp = fold.range.compareRange(range); - if (cmp == -2) { - break; - } else if (cmp == 2) { - continue; - } else - // WTF-state: Can happen due to -1/+1 to start/end column. - if (cmp == 42) { - break; - } - foundFolds.push(fold); - } - } - return foundFolds; - } - - /** - * Returns the string between folds at the given position. - * E.g. - * foob|arwolrd -> "bar" - * foobarwol|rd -> "world" - * foobarwolrd -> - * - * where | means the position of row/column - * - * The trim option determs if the return string should be trimed according - * to the "side" passed with the trim value: - * - * E.g. - * foob|arwolrd -trim=-1> "b" - * foobarwol|rd -trim=+1> "rld" - * fo|obarwolrd -trim=00> "foo" - */ - this.getFoldStringAt = function(row, column, trim, foldLine) { - var foldLine = foldLine || this.getFoldLine(row); - if (!foldLine) - return null; - - var lastFold = { - end: { column: 0 } - }; - // TODO: Refactor to use getNextFoldTo function. - for (var i = 0; i < foldLine.folds.length; i++) { - var fold = foldLine.folds[i]; - var cmp = fold.range.compareEnd(row, column); - if (cmp == -1) { - var str = this - .getLine(fold.start.row) - .substring(lastFold.end.column, fold.start.column); - break; - } - else if (cmp == 0) { - return null; - } - lastFold = fold; - } - if (!str) - str = this.getLine(fold.start.row).substring(lastFold.end.column); - - if (trim == -1) - return str.substring(0, column - lastFold.end.column); - else if (trim == 1) - return str.substring(column - lastFold.end.column) - else - return str; - } - - this.getFoldLine = function(docRow, startFoldLine) { - var foldData = this.$foldData; - var i = 0; - if (startFoldLine) - i = foldData.indexOf(startFoldLine); - if (i == -1) - i = 0; - for (i; i < foldData.length; i++) { - var foldLine = foldData[i]; - if (foldLine.start.row <= docRow && foldLine.end.row >= docRow) { - return foldLine; - } else if (foldLine.end.row > docRow) { - return null; - } - } - return null; - } - - // returns the fold which starts after or contains docRow - this.getNextFoldLine = function(docRow, startFoldLine) { - var foldData = this.$foldData, ans; - var i = 0; - if (startFoldLine) - i = foldData.indexOf(startFoldLine); - if (i == -1) - i = 0; - for (i; i < foldData.length; i++) { - var foldLine = foldData[i]; - if (foldLine.end.row >= docRow) { - return foldLine; - } - } - return null; - } - - this.getFoldedRowCount = function(first, last) { - var foldData = this.$foldData, rowCount = last-first+1; - for (var i = 0; i < foldData.length; i++) { - var foldLine = foldData[i], - end = foldLine.end.row, - start = foldLine.start.row; - if (end >= last) { - if(start < last) { - if(start >= first) - rowCount -= last-start; - else - rowCount = 0;//in one fold - } - break; - } else if(end >= first){ - if (start >= first) //fold inside range - rowCount -= end-start; - else - rowCount -= end-first+1; - } - } - return rowCount; - } - - this.$addFoldLine = function(foldLine) { - this.$foldData.push(foldLine); - this.$foldData.sort(function(a, b) { - return a.start.row - b.start.row; - }); - return foldLine; - } - - /** - * Adds a new fold. - * - * @returns - * The new created Fold object or an existing fold object in case the - * passed in range fits an existing fold exactly. - */ - this.addFold = function(placeholder, range) { - var foldData = this.$foldData; - var added = false; - - if (placeholder instanceof Fold) - var fold = placeholder; - else - fold = new Fold(range, placeholder); - - var startRow = fold.start.row; - var startColumn = fold.start.column; - var endRow = fold.end.row; - var endColumn = fold.end.column; - - // --- Some checking --- - if (fold.placeholder.length < 2) - throw "Placeholder has to be at least 2 characters"; - - if (startRow == endRow && endColumn - startColumn < 2) - throw "The range has to be at least 2 characters width"; - - var existingFold = this.getFoldAt(startRow, startColumn, 1); - if ( - existingFold - && existingFold.range.isEnd(endRow, endColumn) - && existingFold.range.isStart(startRow, startColumn) - ) { - return fold; - } - - existingFold = this.getFoldAt(startRow, startColumn, 1); - if (existingFold && !existingFold.range.isStart(startRow, startColumn)) - throw "A fold can't start inside of an already existing fold"; - - existingFold = this.getFoldAt(endRow, endColumn, -1); - if (existingFold && !existingFold.range.isEnd(endRow, endColumn)) - throw "A fold can't end inside of an already existing fold"; - - if (endRow >= this.doc.getLength()) - throw "End of fold is outside of the document."; - - if (endColumn > this.getLine(endRow).length || startColumn > this.getLine(startRow).length) - throw "End of fold is outside of the document."; - - // Check if there are folds in the range we create the new fold for. - var folds = this.getFoldsInRange(fold.range); - if (folds.length > 0) { - // Remove the folds from fold data. - this.removeFolds(folds); - // Add the removed folds as subfolds on the new fold. - fold.subFolds = folds; - } - - for (var i = 0; i < foldData.length; i++) { - var foldLine = foldData[i]; - if (endRow == foldLine.start.row) { - foldLine.addFold(fold); - added = true; - break; - } - else if (startRow == foldLine.end.row) { - foldLine.addFold(fold); - added = true; - if (!fold.sameRow) { - // Check if we might have to merge two FoldLines. - foldLineNext = foldData[i + 1]; - if (foldLineNext && foldLineNext.start.row == endRow) { - // We need to merge! - foldLine.merge(foldLineNext); - break; - } - } - break; - } - else if (endRow <= foldLine.start.row) { - break; - } - } - - if (!added) - foldLine = this.$addFoldLine(new FoldLine(this.$foldData, fold)); - - if (this.$useWrapMode) - this.$updateWrapData(foldLine.start.row, foldLine.start.row); - - // Notify that fold data has changed. - this.$modified = true; - this._dispatchEvent("changeFold", { data: fold }); - - return fold; - }; - - this.addFolds = function(folds) { - folds.forEach(function(fold) { - this.addFold(fold); - }, this); - }; - - this.removeFold = function(fold) { - var foldLine = fold.foldLine; - var startRow = foldLine.start.row; - var endRow = foldLine.end.row; - - var foldLines = this.$foldData, - folds = foldLine.folds; - // Simple case where there is only one fold in the FoldLine such that - // the entire fold line can get removed directly. - if (folds.length == 1) { - foldLines.splice(foldLines.indexOf(foldLine), 1); - } else - // If the fold is the last fold of the foldLine, just remove it. - if (foldLine.range.isEnd(fold.end.row, fold.end.column)) { - folds.pop(); - foldLine.end.row = folds[folds.length - 1].end.row; - foldLine.end.column = folds[folds.length - 1].end.column; - } else - // If the fold is the first fold of the foldLine, just remove it. - if (foldLine.range.isStart(fold.start.row, fold.start.column)) { - folds.shift(); - foldLine.start.row = folds[0].start.row; - foldLine.start.column = folds[0].start.column; - } else - // We know there are more then 2 folds and the fold is not at the edge. - // This means, the fold is somewhere in between. - // - // If the fold is in one row, we just can remove it. - if (fold.sameRow) { - folds.splice(folds.indexOf(fold), 1); - } else - // The fold goes over more then one row. This means remvoing this fold - // will cause the fold line to get splitted up. - { - var newFoldLine = foldLine.split(fold.start.row, fold.start.column); - newFoldLine.folds.shift(); - foldLine.start.row = folds[0].start.row; - foldLine.start.column = folds[0].start.column; - this.$addFoldLine(newFoldLine); - } - - if (this.$useWrapMode) { - this.$updateWrapData(startRow, endRow); - } - - // Notify that fold data has changed. - this.$modified = true; - this._dispatchEvent("changeFold", { data: fold }); - } - - this.removeFolds = function(folds) { - // We need to clone the folds array passed in as it might be the folds - // array of a fold line and as we call this.removeFold(fold), folds - // are removed from folds and changes the current index. - var cloneFolds = []; - for (var i = 0; i < folds.length; i++) { - cloneFolds.push(folds[i]); - } - - cloneFolds.forEach(function(fold) { - this.removeFold(fold); - }, this); - this.$modified = true; - } - - this.expandFold = function(fold) { - this.removeFold(fold); - fold.subFolds.forEach(function(fold) { - this.addFold(fold); - }, this); - fold.subFolds = []; - } - - this.expandFolds = function(folds) { - folds.forEach(function(fold) { - this.expandFold(fold); - }, this); - } - - /** - * Checks if a given documentRow is folded. This is true if there are some - * folded parts such that some parts of the line is still visible. - **/ - this.isRowFolded = function(docRow, startFoldRow) { - return !!this.getFoldLine(docRow, startFoldRow); - }; - - this.getRowFoldEnd = function(docRow, startFoldRow) { - var foldLine = this.getFoldLine(docRow, startFoldRow); - return (foldLine - ? foldLine.end.row - : docRow) - }; - - this.getFoldDisplayLine = function(foldLine, endRow, endColumn, startRow, startColumn) { - if (startRow == null) { - startRow = foldLine.start.row; - startColumn = 0; - } - - if (endRow == null) { - endRow = foldLine.end.row; - endColumn = this.getLine(endRow).length; - } - - // Build the textline using the FoldLine walker. - var line = ""; - var doc = this.doc; - var textLine = ""; - - foldLine.walk(function(placeholder, row, column, lastColumn, isNewRow) { - if (row < startRow) { - return; - } else if (row == startRow) { - if (column < startColumn) { - return; - } - lastColumn = Math.max(startColumn, lastColumn); - } - if (placeholder) { - textLine += placeholder; - } else { - textLine += doc.getLine(row).substring(lastColumn, column); - } - }.bind(this), endRow, endColumn); - return textLine; - }; - - this.getDisplayLine = function(row, endColumn, startRow, startColumn) { - var foldLine = this.getFoldLine(row); - - if (!foldLine) { - var line; - line = this.doc.getLine(row); - return line.substring(startColumn || 0, endColumn || line.length); - } else { - return this.getFoldDisplayLine( - foldLine, row, endColumn, startRow, startColumn); - } - }; - - this.$cloneFoldData = function() { - var foldData = this.$foldData; - var fd = []; - fd = this.$foldData.map(function(foldLine) { - var folds = foldLine.folds.map(function(fold) { - return fold.clone(); - }); - return new FoldLine(fd, folds); - }); - - return fd; - }; - - this.toggleFold = function(tryToUnfold) { - var selection = this.selection; - var range = selection.getRange(); - - if (range.isEmpty()) { - var cursor = range.start - var fold = this.getFoldAt(cursor.row, cursor.column); - var bracketPos, column; - - if (fold) { - this.expandFold(fold); - return; - } else if (bracketPos = this.findMatchingBracket(cursor)) { - if (range.comparePoint(bracketPos) == 1) { - range.end = bracketPos; - } else { - range.start = bracketPos; - range.start.column++; - range.end.column--; - } - } else if (bracketPos = this.findMatchingBracket({row: cursor.row, column: cursor.column + 1})) { - if (range.comparePoint(bracketPos) == 1) - range.end = bracketPos; - else - range.start = bracketPos; - - range.start.column++; - } else { - var token = this.getTokenAt(cursor.row, cursor.column); - if (token && /^comment|string/.test(token.type)) { - var startRow = cursor.row; - var endRow = cursor.row; - var t = token; - while ((t = this.getTokenAt(startRow - 1)) && t.type == token.type) { - startRow --; - token = t; - } - range.start.row = startRow; - range.start.column = token.start + 2; - - while ((t = this.getTokenAt(endRow + 1, 0)) && t.type == token.type) { - endRow ++; - token = t; - } - range.end.row = endRow; - range.end.column = token.start + token.value.length - 1; - } - } - } else { - var folds = this.getFoldsInRange(range); - if (tryToUnfold && folds.length) { - this.expandFolds(folds); - return; - } else if (folds.length == 1 ) { - fold = folds[0]; - } - } - - if (!fold) - fold = this.getFoldAt(range.start.row, range.start.column); - - if (fold && fold.range.toString() == range.toString()){ - this.expandFold(fold); - return - } - - - var placeholder = "..."; - if (!range.isMultiLine()) { - placeholder = this.getTextRange(range); - if(placeholder.length < 4) - return; - placeholder = placeholder.trim().substring(0, 2) + ".." - } - - this.addFold(placeholder, range); - }; -} -exports.Folding = Folding; - -}); - -define("ace/edit_session/bracket_match",[], function(require, exports, module) { - -var TokenIterator = require("ace/token_iterator").TokenIterator; - -function BracketMatch() { - - this.findMatchingBracket = function(position) { - if (position.column == 0) return null; - - var charBeforeCursor = this.getLine(position.row).charAt(position.column-1); - if (charBeforeCursor == "") return null; - - var match = charBeforeCursor.match(/([\(\[\{])|([\)\]\}])/); - if (!match) { - return null; - } - - if (match[1]) { - return this.$findClosingBracket(match[1], position); - } else { - return this.$findOpeningBracket(match[2], position); - } - }; - - this.$brackets = { - ")": "(", - "(": ")", - "]": "[", - "[": "]", - "{": "}", - "}": "{" - }; - - this.$findOpeningBracket = function(bracket, position) { - var openBracket = this.$brackets[bracket]; - var depth = 1; - - var iterator = new TokenIterator(this, position.row, position.column); - var token = iterator.getCurrentToken(); - if (!token) return null; - - // token.type contains a period-delimited list of token identifiers - // (e.g.: "constant.numeric" or "paren.lparen"). Create a pattern that - // matches any token containing the same identifiers or a subset. In - // addition, if token.type includes "rparen", then also match "lparen". - // So if type.token is "paren.rparen", then typeRe will match "lparen.paren". - var typeRe = new RegExp("\\.?(" + - token.type.replace(".", "|").replace("rparen", "lparen|rparen") + ")+"); - - // Start searching in token, just before the character at position.column - var valueIndex = position.column - iterator.getCurrentTokenColumn() - 2; - var value = token.value; - - while (true) { - - while (valueIndex >= 0) { - var char = value.charAt(valueIndex); - if (char == openBracket) { - depth -= 1; - if (depth == 0) { - return {row: iterator.getCurrentTokenRow(), - column: valueIndex + iterator.getCurrentTokenColumn()}; - } - } - else if (char == bracket) { - depth += 1; - } - valueIndex -= 1; - } - - // Scan backward through the document, looking for the next token - // whose type matches typeRe - do { - token = iterator.stepBackward(); - } while (token && !typeRe.test(token.type)); - - if (token == null) - break; - - value = token.value; - valueIndex = value.length - 1; - } - - return null; - }; - - this.$findClosingBracket = function(bracket, position) { - var closingBracket = this.$brackets[bracket]; - var depth = 1; - - var iterator = new TokenIterator(this, position.row, position.column); - var token = iterator.getCurrentToken(); - if (!token) return null; - - // token.type contains a period-delimited list of token identifiers - // (e.g.: "constant.numeric" or "paren.lparen"). Create a pattern that - // matches any token containing the same identifiers or a subset. In - // addition, if token.type includes "lparen", then also match "rparen". - // So if type.token is "lparen.paren", then typeRe will match "paren.rparen". - var typeRe = new RegExp("\\.?(" + - token.type.replace(".", "|").replace("lparen", "lparen|rparen") + ")+"); - - // Start searching in token, after the character at position.column - var valueIndex = position.column - iterator.getCurrentTokenColumn(); - - while (true) { - - var value = token.value; - var valueLength = value.length; - while (valueIndex < valueLength) { - var char = value.charAt(valueIndex); - if (char == closingBracket) { - depth -= 1; - if (depth == 0) { - return {row: iterator.getCurrentTokenRow(), - column: valueIndex + iterator.getCurrentTokenColumn()}; - } - } - else if (char == bracket) { - depth += 1; - } - valueIndex += 1; - } - - // Scan forward through the document, looking for the next token - // whose type matches typeRe - do { - token = iterator.stepForward(); - } while (token && !typeRe.test(token.type)); - - if (token == null) - break; - - valueIndex = 0; - } - - return null; - }; -} -exports.BracketMatch = BracketMatch; - -}); - - -define("ace/tokenizer",[], function(require, exports, module) { - -var Tokenizer = function(rules) { - this.rules = rules; - - this.regExps = {}; - this.matchMappings = {}; - for ( var key in this.rules) { - var rule = this.rules[key]; - var state = rule; - var ruleRegExps = []; - var matchTotal = 0; - var mapping = this.matchMappings[key] = {}; - - for ( var i = 0; i < state.length; i++) { - // Count number of matching groups. 2 extra groups from the full match - // And the catch-all on the end (used to force a match); - var matchcount = new RegExp("(?:(" + state[i].regex + ")|(.))").exec("a").length - 2; - - // Replace any backreferences and offset appropriately. - var adjustedregex = state[i].regex.replace(/\\([0-9]+)/g, function (match, digit) { - return "\\" + (parseInt(digit, 10) + matchTotal + 1); - }); - - mapping[matchTotal] = { - rule: i, - len: matchcount - }; - matchTotal += matchcount; - - ruleRegExps.push(adjustedregex); - } - - this.regExps[key] = new RegExp("(?:(" + ruleRegExps.join(")|(") + ")|(.))", "g"); - } -}; - -(function() { - - this.getLineTokens = function(line, startState) { - var currentState = startState; - var state = this.rules[currentState]; - var mapping = this.matchMappings[currentState]; - var re = this.regExps[currentState]; - var mapping = this.matchMappings[currentState]; - var re = this.regExps[currentState]; - - var match, tokens = []; - - var token = { - type: null, - value: "" - }; - - var n = line.length; - if (n > 250 || !re) { - token.type = 'text' - // if(n > 1500) - // token.value = line.slice(0, 1500) + '------unable-----to----display-----too-----long-----'; - // else - token.value = line; - return { - tokens : [token], - state : currentState - }; - } - - var lastIndex = 0; - - re.lastIndex = 0; - while (match = re.exec(line)) { - - var type = "text"; - var rule = null; - var value = [match[0]]; - - for (var i = 0; i < match.length-2; i++) { - if (match[i + 1] !== undefined) { - rule = state[mapping[i].rule]; - - if (mapping[i].len > 1) { - value = match.slice(i+2, i+1+mapping[i].len); - } - - // compute token type - if (typeof rule.token == "function") - type = rule.token.apply(this, value); - else - type = rule.token; - - var next = rule.next; - if (next && next !== currentState) { - currentState = next; - state = this.rules[currentState]; - mapping = this.matchMappings[currentState]; - lastIndex = re.lastIndex; - - re = this.regExps[currentState]; - re.lastIndex = lastIndex; - } - break; - } - }; - - if (value[0]) { - if (typeof type == "string") { - value = [value.join("")]; - type = [type]; - } - for (var i = 0; i < value.length; i++) { - if ((!rule || rule.merge || type[i] === "text") && token.type === type[i]) { - token.value += value[i]; - } else { - if (token.type) { - tokens.push(token); - } - - token = { - type: type[i], - value: value[i] - } - } - } - } - - if (lastIndex == line.length) - break; - - lastIndex = re.lastIndex; - }; - - if (token.type) - tokens.push(token); - - return { - tokens : tokens, - state : currentState - }; - }; - -}).call(Tokenizer.prototype); - -exports.Tokenizer = Tokenizer; -}); - - -define("ace/mode/text_highlight_rules",[], function(require, exports, module) { - -var lang = require("ace/lib/lang"); - -var TextHighlightRules = function() { - - // regexp must not have capturing parentheses - // regexps are ordered -> the first match is used - - this.$rules = { - "start" : [{ - token : "empty_line", - regex : '^$' - }, { - token : "text", - regex : ".+" - }] - }; -}; - -(function() { - - this.addRules = function(rules, prefix) { - for (var key in rules) { - var state = rules[key]; - for (var i=0; i -Uses the Unicode 5.2 character database - -This package for the XRegExp Unicode plugin enables the following Unicode categories (aka properties): - -L - Letter (the top-level Letter category is included in the Unicode plugin base script) - Ll - Lowercase letter - Lu - Uppercase letter - Lt - Titlecase letter - Lm - Modifier letter - Lo - Letter without case -M - Mark - Mn - Non-spacing mark - Mc - Spacing combining mark - Me - Enclosing mark -N - Number - Nd - Decimal digit - Nl - Letter number - No - Other number -P - Punctuation - Pd - Dash punctuation - Ps - Open punctuation - Pe - Close punctuation - Pi - Initial punctuation - Pf - Final punctuation - Pc - Connector punctuation - Po - Other punctuation -S - Symbol - Sm - Math symbol - Sc - Currency symbol - Sk - Modifier symbol - So - Other symbol -Z - Separator - Zs - Space separator - Zl - Line separator - Zp - Paragraph separator -C - Other - Cc - Control - Cf - Format - Co - Private use - Cs - Surrogate - Cn - Unassigned - -Example usage: - - \p{N} - \p{Cn} -*/ - - -// will be populated by addUnicodePackage -exports.packages = {}; - -addUnicodePackage({ - L: "0041-005A0061-007A00AA00B500BA00C0-00D600D8-00F600F8-02C102C6-02D102E0-02E402EC02EE0370-037403760377037A-037D03860388-038A038C038E-03A103A3-03F503F7-0481048A-05250531-055605590561-058705D0-05EA05F0-05F20621-064A066E066F0671-06D306D506E506E606EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA07F407F507FA0800-0815081A082408280904-0939093D09500958-0961097109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E460E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EC60EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10A0-10C510D0-10FA10FC1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317D717DC1820-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541AA71B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C7D1CE9-1CEC1CEE-1CF11D00-1DBF1E00-1F151F18-1F1D1F20-1F451F48-1F4D1F50-1F571F591F5B1F5D1F5F-1F7D1F80-1FB41FB6-1FBC1FBE1FC2-1FC41FC6-1FCC1FD0-1FD31FD6-1FDB1FE0-1FEC1FF2-1FF41FF6-1FFC2071207F2090-209421022107210A-211321152119-211D212421262128212A-212D212F-2139213C-213F2145-2149214E218321842C00-2C2E2C30-2C5E2C60-2CE42CEB-2CEE2D00-2D252D30-2D652D6F2D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE2E2F300530063031-3035303B303C3041-3096309D-309F30A1-30FA30FC-30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A48CA4D0-A4FDA500-A60CA610-A61FA62AA62BA640-A65FA662-A66EA67F-A697A6A0-A6E5A717-A71FA722-A788A78BA78CA7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2A9CFAA00-AA28AA40-AA42AA44-AA4BAA60-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADB-AADDABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB00-FB06FB13-FB17FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF21-FF3AFF41-FF5AFF66-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC", - Ll: "0061-007A00AA00B500BA00DF-00F600F8-00FF01010103010501070109010B010D010F01110113011501170119011B011D011F01210123012501270129012B012D012F01310133013501370138013A013C013E014001420144014601480149014B014D014F01510153015501570159015B015D015F01610163016501670169016B016D016F0171017301750177017A017C017E-0180018301850188018C018D019201950199-019B019E01A101A301A501A801AA01AB01AD01B001B401B601B901BA01BD-01BF01C601C901CC01CE01D001D201D401D601D801DA01DC01DD01DF01E101E301E501E701E901EB01ED01EF01F001F301F501F901FB01FD01FF02010203020502070209020B020D020F02110213021502170219021B021D021F02210223022502270229022B022D022F02310233-0239023C023F0240024202470249024B024D024F-02930295-02AF037103730377037B-037D039003AC-03CE03D003D103D5-03D703D903DB03DD03DF03E103E303E503E703E903EB03ED03EF-03F303F503F803FB03FC0430-045F04610463046504670469046B046D046F04710473047504770479047B047D047F0481048B048D048F04910493049504970499049B049D049F04A104A304A504A704A904AB04AD04AF04B104B304B504B704B904BB04BD04BF04C204C404C604C804CA04CC04CE04CF04D104D304D504D704D904DB04DD04DF04E104E304E504E704E904EB04ED04EF04F104F304F504F704F904FB04FD04FF05010503050505070509050B050D050F05110513051505170519051B051D051F0521052305250561-05871D00-1D2B1D62-1D771D79-1D9A1E011E031E051E071E091E0B1E0D1E0F1E111E131E151E171E191E1B1E1D1E1F1E211E231E251E271E291E2B1E2D1E2F1E311E331E351E371E391E3B1E3D1E3F1E411E431E451E471E491E4B1E4D1E4F1E511E531E551E571E591E5B1E5D1E5F1E611E631E651E671E691E6B1E6D1E6F1E711E731E751E771E791E7B1E7D1E7F1E811E831E851E871E891E8B1E8D1E8F1E911E931E95-1E9D1E9F1EA11EA31EA51EA71EA91EAB1EAD1EAF1EB11EB31EB51EB71EB91EBB1EBD1EBF1EC11EC31EC51EC71EC91ECB1ECD1ECF1ED11ED31ED51ED71ED91EDB1EDD1EDF1EE11EE31EE51EE71EE91EEB1EED1EEF1EF11EF31EF51EF71EF91EFB1EFD1EFF-1F071F10-1F151F20-1F271F30-1F371F40-1F451F50-1F571F60-1F671F70-1F7D1F80-1F871F90-1F971FA0-1FA71FB0-1FB41FB61FB71FBE1FC2-1FC41FC61FC71FD0-1FD31FD61FD71FE0-1FE71FF2-1FF41FF61FF7210A210E210F2113212F21342139213C213D2146-2149214E21842C30-2C5E2C612C652C662C682C6A2C6C2C712C732C742C76-2C7C2C812C832C852C872C892C8B2C8D2C8F2C912C932C952C972C992C9B2C9D2C9F2CA12CA32CA52CA72CA92CAB2CAD2CAF2CB12CB32CB52CB72CB92CBB2CBD2CBF2CC12CC32CC52CC72CC92CCB2CCD2CCF2CD12CD32CD52CD72CD92CDB2CDD2CDF2CE12CE32CE42CEC2CEE2D00-2D25A641A643A645A647A649A64BA64DA64FA651A653A655A657A659A65BA65DA65FA663A665A667A669A66BA66DA681A683A685A687A689A68BA68DA68FA691A693A695A697A723A725A727A729A72BA72DA72F-A731A733A735A737A739A73BA73DA73FA741A743A745A747A749A74BA74DA74FA751A753A755A757A759A75BA75DA75FA761A763A765A767A769A76BA76DA76FA771-A778A77AA77CA77FA781A783A785A787A78CFB00-FB06FB13-FB17FF41-FF5A", - Lu: "0041-005A00C0-00D600D8-00DE01000102010401060108010A010C010E01100112011401160118011A011C011E01200122012401260128012A012C012E01300132013401360139013B013D013F0141014301450147014A014C014E01500152015401560158015A015C015E01600162016401660168016A016C016E017001720174017601780179017B017D018101820184018601870189-018B018E-0191019301940196-0198019C019D019F01A001A201A401A601A701A901AC01AE01AF01B1-01B301B501B701B801BC01C401C701CA01CD01CF01D101D301D501D701D901DB01DE01E001E201E401E601E801EA01EC01EE01F101F401F6-01F801FA01FC01FE02000202020402060208020A020C020E02100212021402160218021A021C021E02200222022402260228022A022C022E02300232023A023B023D023E02410243-02460248024A024C024E03700372037603860388-038A038C038E038F0391-03A103A3-03AB03CF03D2-03D403D803DA03DC03DE03E003E203E403E603E803EA03EC03EE03F403F703F903FA03FD-042F04600462046404660468046A046C046E04700472047404760478047A047C047E0480048A048C048E04900492049404960498049A049C049E04A004A204A404A604A804AA04AC04AE04B004B204B404B604B804BA04BC04BE04C004C104C304C504C704C904CB04CD04D004D204D404D604D804DA04DC04DE04E004E204E404E604E804EA04EC04EE04F004F204F404F604F804FA04FC04FE05000502050405060508050A050C050E05100512051405160518051A051C051E0520052205240531-055610A0-10C51E001E021E041E061E081E0A1E0C1E0E1E101E121E141E161E181E1A1E1C1E1E1E201E221E241E261E281E2A1E2C1E2E1E301E321E341E361E381E3A1E3C1E3E1E401E421E441E461E481E4A1E4C1E4E1E501E521E541E561E581E5A1E5C1E5E1E601E621E641E661E681E6A1E6C1E6E1E701E721E741E761E781E7A1E7C1E7E1E801E821E841E861E881E8A1E8C1E8E1E901E921E941E9E1EA01EA21EA41EA61EA81EAA1EAC1EAE1EB01EB21EB41EB61EB81EBA1EBC1EBE1EC01EC21EC41EC61EC81ECA1ECC1ECE1ED01ED21ED41ED61ED81EDA1EDC1EDE1EE01EE21EE41EE61EE81EEA1EEC1EEE1EF01EF21EF41EF61EF81EFA1EFC1EFE1F08-1F0F1F18-1F1D1F28-1F2F1F38-1F3F1F48-1F4D1F591F5B1F5D1F5F1F68-1F6F1FB8-1FBB1FC8-1FCB1FD8-1FDB1FE8-1FEC1FF8-1FFB21022107210B-210D2110-211221152119-211D212421262128212A-212D2130-2133213E213F214521832C00-2C2E2C602C62-2C642C672C692C6B2C6D-2C702C722C752C7E-2C802C822C842C862C882C8A2C8C2C8E2C902C922C942C962C982C9A2C9C2C9E2CA02CA22CA42CA62CA82CAA2CAC2CAE2CB02CB22CB42CB62CB82CBA2CBC2CBE2CC02CC22CC42CC62CC82CCA2CCC2CCE2CD02CD22CD42CD62CD82CDA2CDC2CDE2CE02CE22CEB2CEDA640A642A644A646A648A64AA64CA64EA650A652A654A656A658A65AA65CA65EA662A664A666A668A66AA66CA680A682A684A686A688A68AA68CA68EA690A692A694A696A722A724A726A728A72AA72CA72EA732A734A736A738A73AA73CA73EA740A742A744A746A748A74AA74CA74EA750A752A754A756A758A75AA75CA75EA760A762A764A766A768A76AA76CA76EA779A77BA77DA77EA780A782A784A786A78BFF21-FF3A", - Lt: "01C501C801CB01F21F88-1F8F1F98-1F9F1FA8-1FAF1FBC1FCC1FFC", - Lm: "02B0-02C102C6-02D102E0-02E402EC02EE0374037A0559064006E506E607F407F507FA081A0824082809710E460EC610FC17D718431AA71C78-1C7D1D2C-1D611D781D9B-1DBF2071207F2090-20942C7D2D6F2E2F30053031-3035303B309D309E30FC-30FEA015A4F8-A4FDA60CA67FA717-A71FA770A788A9CFAA70AADDFF70FF9EFF9F", - Lo: "01BB01C0-01C3029405D0-05EA05F0-05F20621-063F0641-064A066E066F0671-06D306D506EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA0800-08150904-0939093D09500958-096109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E450E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10D0-10FA1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317DC1820-18421844-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C771CE9-1CEC1CEE-1CF12135-21382D30-2D652D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE3006303C3041-3096309F30A1-30FA30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A014A016-A48CA4D0-A4F7A500-A60BA610-A61FA62AA62BA66EA6A0-A6E5A7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2AA00-AA28AA40-AA42AA44-AA4BAA60-AA6FAA71-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADBAADCABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF66-FF6FFF71-FF9DFFA0-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC", - M: "0300-036F0483-04890591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DE-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0903093C093E-094E0951-0955096209630981-098309BC09BE-09C409C709C809CB-09CD09D709E209E30A01-0A030A3C0A3E-0A420A470A480A4B-0A4D0A510A700A710A750A81-0A830ABC0ABE-0AC50AC7-0AC90ACB-0ACD0AE20AE30B01-0B030B3C0B3E-0B440B470B480B4B-0B4D0B560B570B620B630B820BBE-0BC20BC6-0BC80BCA-0BCD0BD70C01-0C030C3E-0C440C46-0C480C4A-0C4D0C550C560C620C630C820C830CBC0CBE-0CC40CC6-0CC80CCA-0CCD0CD50CD60CE20CE30D020D030D3E-0D440D46-0D480D4A-0D4D0D570D620D630D820D830DCA0DCF-0DD40DD60DD8-0DDF0DF20DF30E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F3E0F3F0F71-0F840F860F870F90-0F970F99-0FBC0FC6102B-103E1056-1059105E-10601062-10641067-106D1071-10741082-108D108F109A-109D135F1712-17141732-1734175217531772177317B6-17D317DD180B-180D18A91920-192B1930-193B19B0-19C019C819C91A17-1A1B1A55-1A5E1A60-1A7C1A7F1B00-1B041B34-1B441B6B-1B731B80-1B821BA1-1BAA1C24-1C371CD0-1CD21CD4-1CE81CED1CF21DC0-1DE61DFD-1DFF20D0-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66F-A672A67CA67DA6F0A6F1A802A806A80BA823-A827A880A881A8B4-A8C4A8E0-A8F1A926-A92DA947-A953A980-A983A9B3-A9C0AA29-AA36AA43AA4CAA4DAA7BAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE3-ABEAABECABEDFB1EFE00-FE0FFE20-FE26", - Mn: "0300-036F0483-04870591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DF-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0902093C0941-0948094D0951-095509620963098109BC09C1-09C409CD09E209E30A010A020A3C0A410A420A470A480A4B-0A4D0A510A700A710A750A810A820ABC0AC1-0AC50AC70AC80ACD0AE20AE30B010B3C0B3F0B41-0B440B4D0B560B620B630B820BC00BCD0C3E-0C400C46-0C480C4A-0C4D0C550C560C620C630CBC0CBF0CC60CCC0CCD0CE20CE30D41-0D440D4D0D620D630DCA0DD2-0DD40DD60E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F71-0F7E0F80-0F840F860F870F90-0F970F99-0FBC0FC6102D-10301032-10371039103A103D103E10581059105E-10601071-1074108210851086108D109D135F1712-17141732-1734175217531772177317B7-17BD17C617C9-17D317DD180B-180D18A91920-19221927192819321939-193B1A171A181A561A58-1A5E1A601A621A65-1A6C1A73-1A7C1A7F1B00-1B031B341B36-1B3A1B3C1B421B6B-1B731B801B811BA2-1BA51BA81BA91C2C-1C331C361C371CD0-1CD21CD4-1CE01CE2-1CE81CED1DC0-1DE61DFD-1DFF20D0-20DC20E120E5-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66FA67CA67DA6F0A6F1A802A806A80BA825A826A8C4A8E0-A8F1A926-A92DA947-A951A980-A982A9B3A9B6-A9B9A9BCAA29-AA2EAA31AA32AA35AA36AA43AA4CAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE5ABE8ABEDFB1EFE00-FE0FFE20-FE26", - Mc: "0903093E-09400949-094C094E0982098309BE-09C009C709C809CB09CC09D70A030A3E-0A400A830ABE-0AC00AC90ACB0ACC0B020B030B3E0B400B470B480B4B0B4C0B570BBE0BBF0BC10BC20BC6-0BC80BCA-0BCC0BD70C01-0C030C41-0C440C820C830CBE0CC0-0CC40CC70CC80CCA0CCB0CD50CD60D020D030D3E-0D400D46-0D480D4A-0D4C0D570D820D830DCF-0DD10DD8-0DDF0DF20DF30F3E0F3F0F7F102B102C10311038103B103C105610571062-10641067-106D108310841087-108C108F109A-109C17B617BE-17C517C717C81923-19261929-192B193019311933-193819B0-19C019C819C91A19-1A1B1A551A571A611A631A641A6D-1A721B041B351B3B1B3D-1B411B431B441B821BA11BA61BA71BAA1C24-1C2B1C341C351CE11CF2A823A824A827A880A881A8B4-A8C3A952A953A983A9B4A9B5A9BAA9BBA9BD-A9C0AA2FAA30AA33AA34AA4DAA7BABE3ABE4ABE6ABE7ABE9ABEAABEC", - Me: "0488048906DE20DD-20E020E2-20E4A670-A672", - N: "0030-003900B200B300B900BC-00BE0660-066906F0-06F907C0-07C90966-096F09E6-09EF09F4-09F90A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BF20C66-0C6F0C78-0C7E0CE6-0CEF0D66-0D750E50-0E590ED0-0ED90F20-0F331040-10491090-10991369-137C16EE-16F017E0-17E917F0-17F91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C5920702074-20792080-20892150-21822185-21892460-249B24EA-24FF2776-27932CFD30073021-30293038-303A3192-31953220-32293251-325F3280-328932B1-32BFA620-A629A6E6-A6EFA830-A835A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19", - Nd: "0030-00390660-066906F0-06F907C0-07C90966-096F09E6-09EF0A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BEF0C66-0C6F0CE6-0CEF0D66-0D6F0E50-0E590ED0-0ED90F20-0F291040-10491090-109917E0-17E91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C59A620-A629A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19", - Nl: "16EE-16F02160-21822185-218830073021-30293038-303AA6E6-A6EF", - No: "00B200B300B900BC-00BE09F4-09F90BF0-0BF20C78-0C7E0D70-0D750F2A-0F331369-137C17F0-17F920702074-20792080-20892150-215F21892460-249B24EA-24FF2776-27932CFD3192-31953220-32293251-325F3280-328932B1-32BFA830-A835", - P: "0021-00230025-002A002C-002F003A003B003F0040005B-005D005F007B007D00A100AB00B700BB00BF037E0387055A-055F0589058A05BE05C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F3A-0F3D0F850FD0-0FD4104A-104F10FB1361-13681400166D166E169B169C16EB-16ED1735173617D4-17D617D8-17DA1800-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD32010-20272030-20432045-20512053-205E207D207E208D208E2329232A2768-277527C527C627E6-27EF2983-299829D8-29DB29FC29FD2CF9-2CFC2CFE2CFF2E00-2E2E2E302E313001-30033008-30113014-301F3030303D30A030FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFD3EFD3FFE10-FE19FE30-FE52FE54-FE61FE63FE68FE6AFE6BFF01-FF03FF05-FF0AFF0C-FF0FFF1AFF1BFF1FFF20FF3B-FF3DFF3FFF5BFF5DFF5F-FF65", - Pd: "002D058A05BE140018062010-20152E172E1A301C303030A0FE31FE32FE58FE63FF0D", - Ps: "0028005B007B0F3A0F3C169B201A201E2045207D208D23292768276A276C276E27702772277427C527E627E827EA27EC27EE2983298529872989298B298D298F299129932995299729D829DA29FC2E222E242E262E283008300A300C300E3010301430163018301A301DFD3EFE17FE35FE37FE39FE3BFE3DFE3FFE41FE43FE47FE59FE5BFE5DFF08FF3BFF5BFF5FFF62", - Pe: "0029005D007D0F3B0F3D169C2046207E208E232A2769276B276D276F27712773277527C627E727E927EB27ED27EF298429862988298A298C298E2990299229942996299829D929DB29FD2E232E252E272E293009300B300D300F3011301530173019301B301E301FFD3FFE18FE36FE38FE3AFE3CFE3EFE40FE42FE44FE48FE5AFE5CFE5EFF09FF3DFF5DFF60FF63", - Pi: "00AB2018201B201C201F20392E022E042E092E0C2E1C2E20", - Pf: "00BB2019201D203A2E032E052E0A2E0D2E1D2E21", - Pc: "005F203F20402054FE33FE34FE4D-FE4FFF3F", - Po: "0021-00230025-0027002A002C002E002F003A003B003F0040005C00A100B700BF037E0387055A-055F058905C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F850FD0-0FD4104A-104F10FB1361-1368166D166E16EB-16ED1735173617D4-17D617D8-17DA1800-18051807-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD3201620172020-20272030-2038203B-203E2041-20432047-205120532055-205E2CF9-2CFC2CFE2CFF2E002E012E06-2E082E0B2E0E-2E162E182E192E1B2E1E2E1F2E2A-2E2E2E302E313001-3003303D30FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFE10-FE16FE19FE30FE45FE46FE49-FE4CFE50-FE52FE54-FE57FE5F-FE61FE68FE6AFE6BFF01-FF03FF05-FF07FF0AFF0CFF0EFF0FFF1AFF1BFF1FFF20FF3CFF61FF64FF65", - S: "0024002B003C-003E005E0060007C007E00A2-00A900AC00AE-00B100B400B600B800D700F702C2-02C502D2-02DF02E5-02EB02ED02EF-02FF03750384038503F604820606-0608060B060E060F06E906FD06FE07F609F209F309FA09FB0AF10B700BF3-0BFA0C7F0CF10CF20D790E3F0F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-139917DB194019E0-19FF1B61-1B6A1B74-1B7C1FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE20442052207A-207C208A-208C20A0-20B8210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B2140-2144214A-214D214F2190-2328232B-23E82400-24262440-244A249C-24E92500-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE27C0-27C427C7-27CA27CC27D0-27E527F0-29822999-29D729DC-29FB29FE-2B4C2B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F309B309C319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A700-A716A720A721A789A78AA828-A82BA836-A839AA77-AA79FB29FDFCFDFDFE62FE64-FE66FE69FF04FF0BFF1C-FF1EFF3EFF40FF5CFF5EFFE0-FFE6FFE8-FFEEFFFCFFFD", - Sm: "002B003C-003E007C007E00AC00B100D700F703F60606-060820442052207A-207C208A-208C2140-2144214B2190-2194219A219B21A021A321A621AE21CE21CF21D221D421F4-22FF2308-230B23202321237C239B-23B323DC-23E125B725C125F8-25FF266F27C0-27C427C7-27CA27CC27D0-27E527F0-27FF2900-29822999-29D729DC-29FB29FE-2AFF2B30-2B442B47-2B4CFB29FE62FE64-FE66FF0BFF1C-FF1EFF5CFF5EFFE2FFE9-FFEC", - Sc: "002400A2-00A5060B09F209F309FB0AF10BF90E3F17DB20A0-20B8A838FDFCFE69FF04FFE0FFE1FFE5FFE6", - Sk: "005E006000A800AF00B400B802C2-02C502D2-02DF02E5-02EB02ED02EF-02FF0375038403851FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE309B309CA700-A716A720A721A789A78AFF3EFF40FFE3", - So: "00A600A700A900AE00B000B60482060E060F06E906FD06FE07F609FA0B700BF3-0BF80BFA0C7F0CF10CF20D790F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-1399194019E0-19FF1B61-1B6A1B74-1B7C210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B214A214C214D214F2195-2199219C-219F21A121A221A421A521A7-21AD21AF-21CD21D021D121D321D5-21F32300-2307230C-231F2322-2328232B-237B237D-239A23B4-23DB23E2-23E82400-24262440-244A249C-24E92500-25B625B8-25C025C2-25F72600-266E2670-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE2800-28FF2B00-2B2F2B452B462B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A828-A82BA836A837A839AA77-AA79FDFDFFE4FFE8FFEDFFEEFFFCFFFD", - Z: "002000A01680180E2000-200A20282029202F205F3000", - Zs: "002000A01680180E2000-200A202F205F3000", - Zl: "2028", - Zp: "2029", - C: "0000-001F007F-009F00AD03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-0605061C061D0620065F06DD070E070F074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17B417B517DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF200B-200F202A-202E2060-206F20722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-F8FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFD-FF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFFBFFFEFFFF", - Cc: "0000-001F007F-009F", - Cf: "00AD0600-060306DD070F17B417B5200B-200F202A-202E2060-2064206A-206FFEFFFFF9-FFFB", - Co: "E000-F8FF", - Cs: "D800-DFFF", - Cn: "03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-05FF06040605061C061D0620065F070E074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF2065-206920722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-D7FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFDFEFEFF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFF8FFFEFFFF" -}); - -function addUnicodePackage (pack) { - var codePoint = /\w{4}/g; - for (var name in pack) - exports.packages[name] = pack[name].replace(codePoint, "\\u$&"); -}; - -}); - -define("ace/anchor",[], function(require, exports, module) { - -var oop = require("ace/lib/oop"); -var EventEmitter = require("ace/lib/event_emitter").EventEmitter; - -/** - * An Anchor is a floating pointer in the document. Whenever text is inserted or - * deleted before the cursor, the position of the cursor is updated - */ -var Anchor = exports.Anchor = function(doc, row, column) { - this.document = doc; - - if (typeof column == "undefined") - this.setPosition(row.row, row.column); - else - this.setPosition(row, column); - - this.$onChange = this.onChange.bind(this); - doc.on("change", this.$onChange); -}; - -(function() { - - oop.implement(this, EventEmitter); - - this.getPosition = function() { - return this.$clipPositionToDocument(this.row, this.column); - }; - - this.getDocument = function() { - return this.document; - }; - - this.onChange = function(e) { - var delta = e.data; - var range = delta.range; - - if (range.start.row == range.end.row && range.start.row != this.row) - return; - - if (range.start.row > this.row) - return; - - if (range.start.row == this.row && range.start.column > this.column) - return; - - var row = this.row; - var column = this.column; - - if (delta.action === "insertText") { - if (range.start.row === row && range.start.column <= column) { - if (range.start.row === range.end.row) { - column += range.end.column - range.start.column; - } - else { - column -= range.start.column; - row += range.end.row - range.start.row; - } - } - else if (range.start.row !== range.end.row && range.start.row < row) { - row += range.end.row - range.start.row; - } - } else if (delta.action === "insertLines") { - if (range.start.row <= row) { - row += range.end.row - range.start.row; - } - } - else if (delta.action == "removeText") { - if (range.start.row == row && range.start.column < column) { - if (range.end.column >= column) - column = range.start.column; - else - column = Math.max(0, column - (range.end.column - range.start.column)); - - } else if (range.start.row !== range.end.row && range.start.row < row) { - if (range.end.row == row) { - column = Math.max(0, column - range.end.column) + range.start.column; - } - row -= (range.end.row - range.start.row); - } - else if (range.end.row == row) { - row -= range.end.row - range.start.row; - column = Math.max(0, column - range.end.column) + range.start.column; - } - } else if (delta.action == "removeLines") { - if (range.start.row <= row) { - if (range.end.row <= row) - row -= range.end.row - range.start.row; - else { - row = range.start.row; - column = 0; - } - } - } - - this.setPosition(row, column, true); - }; - - this.setPosition = function(row, column, noClip) { - var pos; - if (noClip) { - pos = { - row: row, - column: column - }; - } - else { - pos = this.$clipPositionToDocument(row, column); - } - - if (this.row == pos.row && this.column == pos.column) - return; - - var old = { - row: this.row, - column: this.column - }; - - this.row = pos.row; - this.column = pos.column; - this._dispatchEvent("change", { - old: old, - value: pos - }); - }; - - this.detach = function() { - this.document.removeEventListener("change", this.$onChange); - }; - - this.$clipPositionToDocument = function(row, column) { - var pos = {}; - - if (row >= this.document.getLength()) { - pos.row = Math.max(0, this.document.getLength() - 1); - pos.column = this.document.getLine(pos.row).length; - } - else if (row < 0) { - pos.row = 0; - pos.column = 0; - } - else { - pos.row = row; - pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column)); - } - - if (column < 0) - pos.column = 0; - - return pos; - }; - -}).call(Anchor.prototype); - -}); - - -define("ace/edit_session/fold_line",[], function(require, exports, module) { - -var Range = require("ace/range").Range; - -/** - * If the an array is passed in, the folds are expected to be sorted already. - */ -function FoldLine(foldData, folds) { - this.foldData = foldData; - if (Array.isArray(folds)) { - this.folds = folds; - } else { - folds = this.folds = [ folds ]; - } - - var last = folds[folds.length - 1] - this.range = new Range(folds[0].start.row, folds[0].start.column, - last.end.row, last.end.column); - this.start = this.range.start; - this.end = this.range.end; - - this.folds.forEach(function(fold) { - fold.setFoldLine(this); - }, this); -} - -(function() { - /** - * Note: This doesn't update wrapData! - */ - this.shiftRow = function(shift) { - this.start.row += shift; - this.end.row += shift; - this.folds.forEach(function(fold) { - fold.start.row += shift; - fold.end.row += shift; - }); - } - - this.addFold = function(fold) { - if (fold.sameRow) { - if (fold.start.row < this.startRow || fold.endRow > this.endRow) { - throw "Can't add a fold to this FoldLine as it has no connection"; - } - this.folds.push(fold); - this.folds.sort(function(a, b) { - return -a.range.compareEnd(b.start.row, b.start.column); - }); - if (this.range.compareEnd(fold.start.row, fold.start.column) > 0) { - this.end.row = fold.end.row; - this.end.column = fold.end.column; - } else if (this.range.compareStart(fold.end.row, fold.end.column) < 0) { - this.start.row = fold.start.row; - this.start.column = fold.start.column; - } - } else if (fold.start.row == this.end.row) { - this.folds.push(fold); - this.end.row = fold.end.row; - this.end.column = fold.end.column; - } else if (fold.end.row == this.start.row) { - this.folds.unshift(fold); - this.start.row = fold.start.row; - this.start.column = fold.start.column; - } else { - throw "Trying to add fold to FoldRow that doesn't have a matching row"; - } - fold.foldLine = this; - } - - this.containsRow = function(row) { - return row >= this.start.row && row <= this.end.row; - } - - this.walk = function(callback, endRow, endColumn) { - var lastEnd = 0, - folds = this.folds, - fold, - comp, stop, isNewRow = true; - - if (endRow == null) { - endRow = this.end.row; - endColumn = this.end.column; - } - - for (var i = 0; i < folds.length; i++) { - fold = folds[i]; - - comp = fold.range.compareStart(endRow, endColumn); - // This fold is after the endRow/Column. - if (comp == -1) { - callback(null, endRow, endColumn, lastEnd, isNewRow); - return; - } - - stop = callback(null, fold.start.row, fold.start.column, lastEnd, isNewRow); - stop = !stop && callback(fold.placeholder, fold.start.row, fold.start.column, lastEnd); - - // If the user requested to stop the walk or endRow/endColumn is - // inside of this fold (comp == 0), then end here. - if (stop || comp == 0) { - return; - } - - // Note the new lastEnd might not be on the same line. However, - // it's the callback's job to recognize this. - isNewRow = !fold.sameRow; - lastEnd = fold.end.column; - } - callback(null, endRow, endColumn, lastEnd, isNewRow); - } - - this.getNextFoldTo = function(row, column) { - var fold, cmp; - for (var i = 0; i < this.folds.length; i++) { - fold = this.folds[i]; - cmp = fold.range.compareEnd(row, column); - if (cmp == -1) { - return { - fold: fold, - kind: "after" - }; - } else if (cmp == 0) { - return { - fold: fold, - kind: "inside" - } - } - } - return null; - } - - this.addRemoveChars = function(row, column, len) { - var ret = this.getNextFoldTo(row, column), - fold, folds; - if (ret) { - fold = ret.fold; - if (ret.kind == "inside" - && fold.start.column != column - && fold.start.row != row) - { - throw "Moving characters inside of a fold should never be reached"; - } else if (fold.start.row == row) { - folds = this.folds; - var i = folds.indexOf(fold); - if (i == 0) { - this.start.column += len; - } - for (i; i < folds.length; i++) { - fold = folds[i]; - fold.start.column += len; - if (!fold.sameRow) { - return; - } - fold.end.column += len; - } - this.end.column += len; - } - } - } - - this.split = function(row, column) { - var fold = this.getNextFoldTo(row, column).fold, - folds = this.folds; - var foldData = this.foldData; - - if (!fold) { - return null; - } - var i = folds.indexOf(fold); - var foldBefore = folds[i - 1]; - this.end.row = foldBefore.end.row; - this.end.column = foldBefore.end.column; - - // Remove the folds after row/column and create a new FoldLine - // containing these removed folds. - folds = folds.splice(i, folds.length - i); - - var newFoldLine = new FoldLine(foldData, folds); - foldData.splice(foldData.indexOf(this) + 1, 0, newFoldLine); - return newFoldLine; - } - - this.merge = function(foldLineNext) { - var folds = foldLineNext.folds; - for (var i = 0; i < folds.length; i++) { - this.addFold(folds[i]); - } - // Remove the foldLineNext - no longer needed, as - // it's merged now with foldLineNext. - var foldData = this.foldData; - foldData.splice(foldData.indexOf(foldLineNext), 1); - } - - this.toString = function() { - var ret = [this.range.toString() + ": [" ]; - - this.folds.forEach(function(fold) { - ret.push(" " + fold.toString()); - }); - ret.push("]") - return ret.join("\n"); - } - - this.idxToPosition = function(idx) { - var lastFoldEndColumn = 0; - var fold; - - for (var i = 0; i < this.folds.length; i++) { - var fold = this.folds[i]; - - idx -= fold.start.column - lastFoldEndColumn; - if (idx < 0) { - return { - row: fold.start.row, - column: fold.start.column + idx - }; - } - - idx -= fold.placeholder.length; - if (idx < 0) { - return fold.start; - } - - lastFoldEndColumn = fold.end.column; - } - - return { - row: this.end.row, - column: this.end.column + idx - }; - } -}).call(FoldLine.prototype); - -exports.FoldLine = FoldLine; -}); - -define("ace/edit_session/fold",[], function(require, exports, module) { - -/** - * Simple fold-data struct. - **/ -var Fold = exports.Fold = function(range, placeholder) { - this.foldLine = null; - this.placeholder = placeholder; - this.range = range; - this.start = range.start; - this.end = range.end; - - this.sameRow = range.start.row == range.end.row; - this.subFolds = []; -}; - -(function() { - - this.toString = function() { - return '"' + this.placeholder + '" ' + this.range.toString(); - }; - - this.setFoldLine = function(foldLine) { - this.foldLine = foldLine; - this.subFolds.forEach(function(fold) { - fold.setFoldLine(foldLine); - }); - }; - - this.clone = function() { - var range = this.range.clone(); - var fold = new Fold(range, this.placeholder); - this.subFolds.forEach(function(subFold) { - fold.subFolds.push(subFold.clone()); - }); - return fold; - }; - -}).call(Fold.prototype); - -}); - -define("ace/token_iterator",[], function(require, exports, module) { - -var TokenIterator = function(session, initialRow, initialColumn) { - this.$session = session; - this.$row = initialRow; - this.$rowTokens = session.getTokens(initialRow, initialRow)[0].tokens; - - var token = session.getTokenAt(initialRow, initialColumn); - this.$tokenIndex = token ? token.index : -1; -}; - -(function() { - - this.stepBackward = function() { - this.$tokenIndex -= 1; - - while (this.$tokenIndex < 0) { - this.$row -= 1; - if (this.$row < 0) - return null; - - this.$rowTokens = this.$session.getTokens(this.$row, this.$row)[0].tokens; - this.$tokenIndex = this.$rowTokens.length - 1; - } - - return this.$rowTokens[this.$tokenIndex]; - } - - this.stepForward = function() { - var rowCount = this.$session.getLength(); - this.$tokenIndex += 1; - - while (this.$tokenIndex >= this.$rowTokens.length) { - this.$row += 1; - if (this.$row >= rowCount) - return null; - - this.$rowTokens = this.$session.getTokens(this.$row, this.$row)[0].tokens; - this.$tokenIndex = 0; - } - - return this.$rowTokens[this.$tokenIndex]; - } - - this.getCurrentToken = function () { - return this.$rowTokens[this.$tokenIndex]; - } - - this.getCurrentTokenRow = function () { - return this.$row; - } - - this.getCurrentTokenColumn = function() { - var rowTokens = this.$rowTokens; - var tokenIndex = this.$tokenIndex; - - // If a column was cached by EditSession.getTokenAt, then use it - var column = rowTokens[tokenIndex].start; - if (column !== undefined) - return column; - - column = 0; - while (tokenIndex > 0) { - tokenIndex -= 1; - column += rowTokens[tokenIndex].value.length; - } - - return column; - } - -}).call(TokenIterator.prototype); - -exports.TokenIterator = TokenIterator; -}); diff --git a/chrome/content/ace++/res/ace/keybinding-emacs.js b/chrome/content/ace++/res/ace/keybinding-emacs.js index 17c61c9..aa14745 100644 --- a/chrome/content/ace++/res/ace/keybinding-emacs.js +++ b/chrome/content/ace++/res/ace/keybinding-emacs.js @@ -1 +1,331 @@ -define("ace/keyboard/keybinding/emacs",["require","exports","module","ace/keyboard/state_handler"],function(a,b,c){var d=a("../state_handler").StateHandler,e=a("../state_handler").matchCharacterOnly,f={start:[{key:"ctrl-x",then:"c-x"},{regex:["(?:command-([0-9]*))*","(down|ctrl-n)"],exec:"golinedown",params:[{name:"times",match:1,type:"number",defaultValue:1}]},{regex:["(?:command-([0-9]*))*","(right|ctrl-f)"],exec:"gotoright",params:[{name:"times",match:1,type:"number",defaultValue:1}]},{regex:["(?:command-([0-9]*))*","(up|ctrl-p)"],exec:"golineup",params:[{name:"times",match:1,type:"number",defaultValue:1}]},{regex:["(?:command-([0-9]*))*","(left|ctrl-b)"],exec:"gotoleft",params:[{name:"times",match:1,type:"number",defaultValue:1}]},{comment:"This binding matches all printable characters except numbers as long as they are no numbers and print them n times.",regex:["(?:command-([0-9]*))","([^0-9]+)*"],match:e,exec:"inserttext",params:[{name:"times",match:1,type:"number",defaultValue:"1"},{name:"text",match:2}]},{comment:"This binding matches numbers as long as there is no meta_number in the buffer.",regex:["(command-[0-9]*)*","([0-9]+)"],match:e,disallowMatches:[1],exec:"inserttext",params:[{name:"text",match:2,type:"text"}]},{regex:["command-([0-9]*)","(command-[0-9]|[0-9])"],comment:"Stops execution if the regex /meta_[0-9]+/ matches to avoid resetting the buffer."}],"c-x":[{key:"ctrl-g",then:"start"},{key:"ctrl-s",exec:"save",then:"start"}]};b.Emacs=new d(f)}),define("ace/keyboard/state_handler",["require","exports","module"],function(a,b,c){function e(a){this.keymapping=this.$buildKeymappingRegex(a)}var d=!1;e.prototype={$buildKeymappingRegex:function(a){for(var b in a)this.$buildBindingsRegex(a[b]);return a},$buildBindingsRegex:function(a){a.forEach(function(a){a.key?a.key=new RegExp("^"+a.key+"$"):Array.isArray(a.regex)?("key"in a||(a.key=new RegExp("^"+a.regex[1]+"$")),a.regex=new RegExp(a.regex.join("")+"$")):a.regex&&(a.regex=new RegExp(a.regex+"$"))})},$composeBuffer:function(a,b,c){if(a.state==null||a.buffer==null)a.state="start",a.buffer="";var d=[];b&1&&d.push("ctrl"),b&8&&d.push("command"),b&2&&d.push("option"),b&4&&d.push("shift"),c&&d.push(c);var e=d.join("-"),f=a.buffer+e;return b!=2&&(a.buffer=f),{bufferToUse:f,symbolicName:e}},$find:function(a,b,c,e,f){var g={};return this.keymapping[a.state].some(function(h){var i;if(h.key&&!h.key.test(c))return!1;if(h.regex&&!(i=h.regex.exec(b)))return!1;if(h.match&&!h.match(b,e,f,c))return!1;if(h.disallowMatches)for(var j=0;j editor.getCursorPosition().row + 1) + editor.navigateUp(); + + editor.navigateLineEnd(); + editor.insert(" " + (cleanLine || "")); + editor.moveCursorTo(pos.row, pos.column); + + } + }, + "u": { + fn: function(editor, range, count, param) { + count = parseInt(count || 1, 10); + for (var i = 0; i < count; i++) { + editor.undo(); + } + editor.selection.clearSelection(); + } + }, + "ctrl-r": { + fn: function(editor, range, count, param) { + count = parseInt(count || 1, 10); + for (var i = 0; i < count; i++) { + editor.redo(); + } + editor.selection.clearSelection(); + } + }, + ":": { + fn: function(editor, range, count, param) { + editor.blur(); + txtConsoleInput.focus(); + txtConsoleInput.setValue(":"); + } + }, + "/": { + fn: function(editor, range, count, param) { + editor.blur(); + txtConsoleInput.focus(); + txtConsoleInput.setValue("/"); + } + }, + ".": { + fn: function(editor, range, count, param) { + var previous = inputBuffer.previous; + util.onInsertReplaySequence = inputBuffer.lastInsertCommands; + inputBuffer.exec(editor, previous.action, previous.param); + } + } +}; + +var inputBuffer = exports.inputBuffer = { + accepting: [NUMBER, OPERATOR, MOTION, ACTION], + currentCmd: null, + //currentMode: 0, + currentCount: "", + + // Types + operator: null, + motion: null, + + lastInsertCommands: [], + + push: function(editor, char, keyId) { + if (char && char.length > 1) { // There is a modifier key + if (!char[char.length - 1].match(/[A-za-z]/) && keyId) // It is a letter + char = keyId; + } + + this.idle = false; + var wObj = this.waitingForParam; + if (wObj) { + this.exec(editor, wObj, char); + } + // If input is a number (that doesn't start with 0) + else if (!(char === "0" && !this.currentCount.length) && + (char.match(/^\d+$/) && this.isAccepting(NUMBER))) { + // Assuming that char is always of type String, and not Number + this.currentCount += char; + this.currentCmd = NUMBER; + this.accepting = [NUMBER, OPERATOR, MOTION, ACTION]; + } + else if (!this.operator && this.isAccepting(OPERATOR) && operators[char]) { + this.operator = { + char: char, + count: this.getCount() + }; + this.currentCmd = OPERATOR; + this.accepting = [NUMBER, MOTION, ACTION]; + this.exec(editor, { operator: this.operator }); + } + else if (motions[char] && this.isAccepting(MOTION)) { + this.currentCmd = MOTION; + + var ctx = { + operator: this.operator, + motion: { + char: char, + count: this.getCount() + } + }; + + if (motions[char].param) + this.waitForParam(ctx); + else + this.exec(editor, ctx); + } + else if (alias[char] && this.isAccepting(MOTION)) { + alias[char].operator.count = this.getCount(); + this.exec(editor, alias[char]); + } + else if (actions[char] && this.isAccepting(ACTION)) { + var actionObj = { + action: { + fn: actions[char].fn, + count: this.getCount() + } + }; + + if (actions[char].param) { + this.waitForParam(actionObj); + } + else { + this.exec(editor, actionObj); + } + } + else if (this.operator) { + this.exec(editor, { operator: this.operator }, char); + } + else { + this.reset(); + } + }, + + waitForParam: function(cmd) { + this.waitingForParam = cmd; + }, + + getCount: function() { + var count = this.currentCount; + this.currentCount = ""; + return count; + }, + + exec: function(editor, action, param) { + var m = action.motion; + var o = action.operator; + var a = action.action; + + if(o) { + this.previous = { + action: action, + param: param + }; + } + + if (o && !editor.selection.isEmpty()) { + if (operators[o.char].selFn) { + operators[o.char].selFn(editor, editor.getSelectionRange(), o.count, param); + this.reset(); + } + return; + } + + // There is an operator, but no motion or action. We try to pass the + // current char to the operator to see if it responds to it (an example + // of this is the 'dd' operator). + else if (!m && !a && o && param) { + operators[o.char].fn(editor, null, o.count, param); + this.reset(); + } + else if (m) { + var run = function(fn) { + if (fn && typeof fn === "function") { // There should always be a motion + if (m.count) + repeat(fn, m.count, [editor, null, m.count, param]); + else + fn(editor, null, m.count, param); + } + }; + + var motionObj = motions[m.char]; + var selectable = motionObj.sel; + + if (!o) { + if ((util.onVisualMode || util.onVisualLineMode) && selectable) + run(motionObj.sel); + else + run(motionObj.nav); + } + else if (selectable) { + repeat(function() { + run(motionObj.sel); + operators[o.char].fn(editor, editor.getSelectionRange(), o.count, param); + }, o.count || 1); + } + this.reset(); + } + else if (a) { + a.fn(editor, editor.getSelectionRange(), a.count, param); + this.reset(); + } + handleCursorMove(editor); + }, + + isAccepting: function(type) { + return this.accepting.indexOf(type) !== -1; + }, + + reset: function() { + this.operator = null; + this.motion = null; + this.currentCount = ""; + this.accepting = [NUMBER, OPERATOR, MOTION, ACTION]; + this.idle = true; + this.waitingForParam = null; + } +}; + +function setPreviousCommand(fn) { + inputBuffer.previous = { action: { action: { fn: fn } } }; +} + +exports.coreCommands = { + start: { + exec: function start(editor) { + util.insertMode(editor); + setPreviousCommand(start); + } + }, + startBeginning: { + exec: function startBeginning(editor) { + editor.navigateLineStart(); + util.insertMode(editor); + setPreviousCommand(startBeginning); + } + }, + // Stop Insert mode as soon as possible. Works like typing in + // insert mode. + stop: { + exec: function stop(editor) { + inputBuffer.reset(); + util.onVisualMode = false; + util.onVisualLineMode = false; + inputBuffer.lastInsertCommands = util.normalMode(editor); + } + }, + append: { + exec: function append(editor) { + var pos = editor.getCursorPosition(); + var lineLen = editor.session.getLine(pos.row).length; + if (lineLen) + editor.navigateRight(); + util.insertMode(editor); + setPreviousCommand(append); + } + }, + appendEnd: { + exec: function appendEnd(editor) { + editor.navigateLineEnd(); + util.insertMode(editor); + setPreviousCommand(appendEnd); + } + }, + builder: { + exec: function builder(editor) {} + } +}; + +var handleCursorMove = exports.onCursorMove = function(editor) { + if(util.currentMode === 'insert' || handleCursorMove.running) + return; + else if(!editor.selection.isEmpty()) { + handleCursorMove.running = true; + if(util.onVisualLineMode) { + var originRow = editor.selection.visualLineStart; + var cursorRow = editor.getCursorPosition().row; + if(originRow <= cursorRow) { + var endLine = editor.session.getLine(cursorRow); + editor.selection.clearSelection(); + editor.selection.moveCursorTo(originRow, 0); + editor.selection.selectTo(cursorRow, endLine.length); + } else { + var endLine = editor.session.getLine(originRow); + editor.selection.clearSelection(); + editor.selection.moveCursorTo(originRow, endLine.length); + editor.selection.selectTo(cursorRow, 0); + } + } + handleCursorMove.running = false; + return; + } + else { + handleCursorMove.running = true; + var pos = editor.getCursorPosition(); + var lineLen = editor.session.getLine(pos.row).length; + + if (lineLen && pos.column === lineLen) + editor.navigateLeft(); + handleCursorMove.running = false; + } +}; + +function toggleCase(ch) { + if(ch.toUpperCase() === ch) + return ch.toLowerCase(); + else + return ch.toUpperCase(); +} + +}); + +define("ace/keyboard/vim/maps/util",[], function(require, exports, module) { +var registers = require("ace/keyboard/vim/registers"); + +module.exports = { + onVisualMode: false, + onVisualLineMode: false, + currentMode: 'normal', + insertMode: function(editor) { + var _self = this; + var theme = editor && editor.getTheme() || "ace/theme/textmate"; + + require(["require", theme], function (require) { + var isDarkTheme = require(theme).isDark; + + _self.currentMode = 'insert'; + // Switch editor to insert mode + editor.unsetStyle('insert-mode'); + + var cursor = document.getElementsByClassName("ace_cursor")[0]; + if (cursor) { + cursor.style.display = null; + cursor.style.backgroundColor = null; + cursor.style.opacity = null; + cursor.style.border = null; + cursor.style.borderLeftColor = isDarkTheme? "#eeeeee" : "#333333"; + cursor.style.borderLeftStyle = "solid"; + cursor.style.borderLeftWidth = "2px"; + } + + editor.setOverwrite(false); + editor.keyBinding.$data.buffer = ""; + editor.keyBinding.$data.state = "insertMode"; + _self.onVisualMode = false; + _self.onVisualLineMode = false; + if(_self.onInsertReplaySequence) { + // Ok, we're apparently replaying ("."), so let's do it + editor.commands.macro = _self.onInsertReplaySequence; + editor.commands.replay(editor); + _self.onInsertReplaySequence = null; + _self.normalMode(editor); + } else { + // Record any movements, insertions in insert mode + if(!editor.commands.recording) + editor.commands.toggleRecording(); + } + }); + }, + normalMode: function(editor) { + // Switch editor to normal mode + this.currentMode = 'normal'; + + editor.setStyle('normal-mode'); + editor.clearSelection(); + + var cursor = document.getElementsByClassName("ace_cursor")[0]; + if (cursor) { + cursor.style.display = null; + cursor.style.backgroundColor = "red"; + cursor.style.opacity = ".5"; + cursor.style.border = "0"; + } + + var pos; + if (!editor.getOverwrite()) { + pos = editor.getCursorPosition(); + if (pos.column > 0) + editor.navigateLeft(); + } + editor.setOverwrite(true); + editor.keyBinding.$data.buffer = ""; + editor.keyBinding.$data.state = "start"; + this.onVisualMode = false; + this.onVisualLineMode = false; + // Save recorded keystrokes + if(editor.commands.recording) { + editor.commands.toggleRecording(); + return editor.commands.macro; + } + else { + return []; + } + }, + getRightNthChar: function(editor, cursor, char, n) { + var line = editor.getSession().getLine(cursor.row); + var matches = line.substr(cursor.column + 1).split(char); + + return n < matches.length ? matches.slice(0, n).join(char).length : 0; + }, + getLeftNthChar: function(editor, cursor, char, n) { + var line = editor.getSession().getLine(cursor.row); + var matches = line.substr(0, cursor.column + 1).split(char); + + return n < matches.length ? matches.slice(-1 * n).join(char).length + 1: 0; + }, + toRealChar: function(char) { + if (char.length === 1) + return char; + + if (/^shift-./.test(char)) + return char[char.length - 1].toUpperCase(); + else + return ""; + }, + copyLine: function(editor) { + var pos = editor.getCursorPosition(); + editor.selection.clearSelection(); + editor.moveCursorTo(pos.row, pos.column); + editor.selection.selectLine(); + registers._default.isLine = true; + registers._default.text = editor.getCopyText().replace(/\n$/, ""); + editor.selection.clearSelection(); + editor.moveCursorTo(pos.row, pos.column); + } +}; +}); + +define("ace/keyboard/vim/keyboard",[], function(require, exports, module) { + +"never use strict"; + +var StateHandler = require("ace/keyboard/state_handler").StateHandler; +var cmds = require("ace/keyboard/vim/commands"); +var coreCommands = cmds.coreCommands; + +var matchChar = function(buffer, hashId, key, symbolicName, keyId) { + // If no command keys are pressed, then catch the input. + // If only the shift key is pressed and a character key, then + // catch that input as well. + // Otherwise, we let the input got through. + var matched = ((hashId === 0) || (((hashId === 1) || (hashId === 4)) && key.length === 1)); + //console.log("INFO", arguments) + + if (matched) { + if (keyId) { + keyId = String.fromCharCode(parseInt(keyId.replace("U+", "0x"), 10)); + } + + coreCommands.builder.exec = function(editor) { + cmds.inputBuffer.push.call(cmds.inputBuffer, editor, symbolicName, keyId); + } + } + return matched; +}; + +var inIdleState = function() { + if (cmds.inputBuffer.idle) { + return true; + } + return false; +}; + +var states = exports.states = { + start: [ // normal mode + { + key: "esc", + exec: coreCommands.stop, + then: "start" + }, + { + regex: "^i$", + match: inIdleState, + exec: coreCommands.start, + then: "insertMode" + }, + { + regex: "^shift-i$", + match: inIdleState, + exec: coreCommands.startBeginning, + then: "insertMode" + }, + { + regex: "^a$", + match: inIdleState, + exec: coreCommands.append, + then: "insertMode" + }, + { + regex: "^shift-a$", + match: inIdleState, + exec: coreCommands.appendEnd, + then: "insertMode" + }, + { + // The rest of input will be processed here + match: matchChar, + exec: coreCommands.builder + } + ], + insertMode: [ + { + key: "esc", + exec: coreCommands.stop, + then: "start" + }, + { + key: "backspace", + exec: "backspace" + } + ] +}; + +exports.handler = new StateHandler(states); +}); + +"never use strict" + +define("ace/keyboard/vim/maps/motions",[], function(require, exports, module) { + +var util = require("ace/keyboard/vim/maps/util"); + +var keepScrollPosition = function(editor, fn) { + var scrollTopRow = editor.renderer.getScrollTopRow(); + var initialRow = editor.getCursorPosition().row; + var diff = initialRow - scrollTopRow; + fn && fn.call(editor); + editor.renderer.scrollToRow(editor.getCursorPosition().row - diff); +}; + +module.exports = { + "w": { + nav: function(editor) { + editor.navigateWordRight(); + }, + sel: function(editor) { + editor.selection.selectWordRight(); + } + }, + "b": { + nav: function(editor) { + editor.navigateWordLeft(); + }, + sel: function(editor) { + editor.selection.selectWordLeft(); + } + }, + "l": { + nav: function(editor) { + editor.navigateRight(); + }, + sel: function(editor) { + var pos = editor.getCursorPosition(); + var col = pos.column; + var lineLen = editor.session.getLine(pos.row).length; + + // Solving the behavior at the end of the line due to the + // different 0 index-based colum positions in ACE. + if (lineLen && col !== lineLen) //In selection mode you can select the newline + editor.selection.selectRight(); + } + }, + "h": { + nav: function(editor) { + var pos = editor.getCursorPosition(); + if (pos.column > 0) + editor.navigateLeft(); + }, + sel: function(editor) { + var pos = editor.getCursorPosition(); + if (pos.column > 0) + editor.selection.selectLeft(); + } + }, + "k": { + nav: function(editor) { + editor.navigateUp(); + }, + sel: function(editor) { + editor.selection.selectUp(); + } + }, + "j": { + nav: function(editor) { + editor.navigateDown(); + }, + sel: function(editor) { + editor.selection.selectDown(); + } + }, + "i": { + param: true, + sel: function(editor, range, count, param) { + switch (param) { + case "w": + editor.selection.selectWord(); + } + } + }, + "a": { + param: true, + sel: function(editor, range, count, param) { + switch (param) { + case "w": + editor.selection.selectAWord(); + } + } + }, + "f": { + param: true, + nav: function(editor, range, count, param) { + count = parseInt(count, 10) || 1; + var ed = editor; + var cursor = ed.getCursorPosition(); + var column = util.getRightNthChar(editor, cursor, param, count); + + if (typeof column === "number") { + ed.selection.clearSelection(); // Why does it select in the first place? + ed.moveCursorTo(cursor.row, column + cursor.column + 1); + } + }, + sel: function(editor, range, count, param) { + count = parseInt(count, 10) || 1; + var ed = editor; + var cursor = ed.getCursorPosition(); + var column = util.getRightNthChar(editor, cursor, param, count); + + if (typeof column === "number") { + ed.moveCursorTo(cursor.row, column + cursor.column + 1); + } + } + }, + "t": { + param: true, + nav: function(editor, range, count, param) { + count = parseInt(count, 10) || 1; + var ed = editor; + var cursor = ed.getCursorPosition(); + var column = util.getRightNthChar(editor, cursor, param, count); + + if (typeof column === "number") { + ed.selection.clearSelection(); // Why does it select in the first place? + ed.moveCursorTo(cursor.row, column + cursor.column); + } + }, + sel: function(editor, range, count, param) { + count = parseInt(count, 10) || 1; + var ed = editor; + var cursor = ed.getCursorPosition(); + var column = util.getRightNthChar(editor, cursor, param, count); + + if (typeof column === "number") { + ed.moveCursorTo(cursor.row, column + cursor.column); + } + } + }, + "^": { + nav: function(editor) { + editor.navigateLineStart(); + }, + sel: function(editor) { + editor.selection.selectLineStart(); + } + }, + "$": { + nav: function(editor) { + editor.navigateLineEnd(); + }, + sel: function(editor) { + editor.selection.selectLineEnd(); + } + }, + "0": { + nav: function(editor) { + var ed = editor; + ed.navigateTo(ed.selection.selectionLead.row, 0); + }, + sel: function(editor) { + var ed = editor; + ed.selectTo(ed.selection.selectionLead.row, 0); + } + }, + "shift-g": { + nav: function(editor, range, count, param) { + count = parseInt(count, 10); + if (!count && count !== 0) { // Stupid JS + count = editor.session.getLength(); + } + editor.gotoLine(count); + }, + sel: function(editor, range, count, param) { + count = parseInt(count, 10); + if (!count && count !== 0) { // Stupid JS + count = editor.session.getLength(); + } + editor.selection.selectTo(count, 0); + } + }, + "ctrl-d": { + nav: function(editor, range, count, param) { + editor.selection.clearSelection(); + keepScrollPosition(editor, editor.gotoPageDown); + }, + sel: function(editor, range, count, param) { + keepScrollPosition(editor, editor.selectPageDown); + } + }, + "ctrl-u": { + nav: function(editor, range, count, param) { + editor.selection.clearSelection(); + keepScrollPosition(editor, editor.gotoPageUp); + + }, + sel: function(editor, range, count, param) { + keepScrollPosition(editor, editor.selectPageUp); + } + }, + "g": { + param: true, + nav: function(editor, range, count, param) { + switch(param) { + case "m": + console.log("Middle line"); + break; + case "e": + console.log("End of prev word"); + break; + case "g": + editor.gotoLine(count || 0); + } + }, + sel: function(editor, range, count, param) { + switch(param) { + case "m": + console.log("Middle line"); + break; + case "e": + console.log("End of prev word"); + break; + case "g": + editor.selection.selectTo(count || 0, 0); + } + } + }, + "o": { + nav: function(editor, range, count, param) { + count = count || 1; + var content = ""; + while (0 < count--) + content += "\n"; + + if (content.length) { + editor.navigateLineEnd() + editor.insert(content); + util.insertMode(editor); + } + } + }, + "shift-o": { + nav: function(editor, range, count, param) { + var row = editor.getCursorPosition().row; + count = count || 1; + var content = ""; + while (0 < count--) + content += "\n"; + + if (content.length) { + if(row > 0) { + editor.navigateUp(); + editor.navigateLineEnd() + editor.insert(content); + } else { + editor.session.insert({row: 0, column: 0}, content); + editor.navigateUp(); + } + util.insertMode(editor); + } + } + }, + "%": { + nav: function(editor, range, count, param) { + var cursor = editor.getCursorPosition(); + var match = editor.session.findMatchingBracket({ + row: cursor.row, + column: cursor.column + 1 + }); + + if (match) + editor.moveCursorTo(match.row, match.column); + } + } +}; + +module.exports.backspace = module.exports.left = module.exports.h; +module.exports.right = module.exports.l; +module.exports.up = module.exports.k; +module.exports.down = module.exports.j; +module.exports.pagedown = module.exports["ctrl-d"]; +module.exports.pageup = module.exports["ctrl-u"]; + +}); + +define("ace/keyboard/vim/maps/operators",[], function(require, exports, module) { + +"never use strict"; + +var util = require("ace/keyboard/vim/maps/util"); +var registers = require("ace/keyboard/vim/registers"); + +module.exports = { + "d": { + selFn: function(editor, range, count, param) { + registers._default.text = editor.getCopyText(); + registers._default.isLine = util.onVisualLineMode; + if(util.onVisualLineMode) + editor.removeLines(); + else + editor.session.remove(range); + util.normalMode(editor); + }, + fn: function(editor, range, count, param) { + count = parseInt(count || 1, 10); + switch (param) { + case "d": + registers._default.text = ""; + registers._default.isLine = true; + for (var i=0; i": { + selFn: function(editor, range, count, param) { + count = parseInt(count || 1, 10); + for (var i = 0; i < count; i++) { + editor.indent(); + } + util.normalMode(editor); + }, + fn: function(editor, range, count, param) { + count = parseInt(count || 1, 10); + switch (param) { + case ">": + var pos = editor.getCursorPosition(); + editor.selection.selectLine(); + for (var i = 0; i < count - 1; i++) { + editor.selection.moveCursorDown(); + } + editor.indent(); + editor.selection.clearSelection(); + editor.moveCursorToPosition(pos); + editor.navigateLineEnd(); + editor.navigateLineStart(); + break; + } + } + }, + "<": { + selFn: function(editor, range, count, param) { + count = parseInt(count || 1, 10); + for (var i = 0; i < count; i++) { + editor.blockOutdent(); + } + util.normalMode(editor); + }, + fn: function(editor, range, count, param) { + count = parseInt(count || 1, 10); + switch (param) { + case "<": + var pos = editor.getCursorPosition(); + editor.selection.selectLine(); + for (var i = 0; i < count - 1; i++) { + editor.selection.moveCursorDown(); + } + editor.blockOutdent(); + editor.selection.clearSelection(); + editor.moveCursorToPosition(pos); + editor.navigateLineEnd(); + editor.navigateLineStart(); + break; + } + } + } +}; +}); + +"never use strict" + +define("ace/keyboard/vim/maps/aliases",[], function(require, exports, module) { +module.exports = { + "x": { + operator: { + char: "d", + count: 1 + }, + motion: { + char: "l", + count: 1 + } + }, + "shift-x": { + operator: { + char: "d", + count: 1 + }, + motion: { + char: "h", + count: 1 + } + }, + "shift-d": { + operator: { + char: "d", + count: 1 + }, + motion: { + char: "$", + count: 1 + } + }, + "shift-c": { + operator: { + char: "c", + count: 1 + }, + motion: { + char: "$", + count: 1 + } + }, + "s": { + operator: { + char: "c", + count: 1 + }, + motion: { + char: "l", + count: 1 + } + }, + "shift-s": { + operator: { + char: "c", + count: 1 + }, + motion: { + char: "l", + count: 1 + } + } +}; +}); + +define("ace/keyboard/vim/registers",[], function(require, exports, module) { + +"never use strict"; + +module.exports = { + _default: { + text: "", + isLine: false + } +}; + +}); + diff --git a/chrome/content/ace++/res/ace/mode-c_cpp.js b/chrome/content/ace++/res/ace/mode-c_cpp.js index 8c0166c..90d37f8 100644 --- a/chrome/content/ace++/res/ace/mode-c_cpp.js +++ b/chrome/content/ace++/res/ace/mode-c_cpp.js @@ -1 +1,234 @@ -define("ace/mode/c_cpp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/c_cpp_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle"],function(a,b,c){var d=a("../lib/oop"),e=a("./text").Mode,f=a("../tokenizer").Tokenizer,g=a("./c_cpp_highlight_rules").c_cppHighlightRules,h=a("./matching_brace_outdent").MatchingBraceOutdent,i=a("../range").Range,j=a("./behaviour/cstyle").CstyleBehaviour,k=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h,this.$behaviour=new j};d.inherits(k,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)\/\//;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=!1;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h),l=k.match(g);j.start.row=h,j.end.row=h,j.end.column=l[0].length,b.replace(j,l[1])}}else b.indentRows(c,d,"//")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[]\s*$/);h&&(d+=c)}else if(a=="doc-start"){if(g=="start")return"";var h=b.match(/^\s*(\/?)\*/);h&&(h[1]&&(d+=" "),d+="* ")}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)}}.call(k.prototype),b.Mode=k}),define("ace/mode/c_cpp_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(a,b,c){var d=a("../lib/oop"),e=a("../lib/lang"),f=a("./doc_comment_highlight_rules").DocCommentHighlightRules,g=a("./text_highlight_rules").TextHighlightRules,h=function(){var a=e.arrayToMap("and|double|not_eq|throw|and_eq|dynamic_cast|operator|true|asm|else|or|try|auto|enum|or_eq|typedef|bitand|explicit|private|typeid|bitor|extern|protected|typename|bool|false|public|union|break|float|register|unsigned|case|fro|reinterpret-cast|using|catch|friend|return|virtual|char|goto|short|void|class|if|signed|volatile|compl|inline|sizeof|wchar_t|const|int|static|while|const-cast|long|static_cast|xor|continue|mutable|struct|xor_eq|default|namespace|switch|delete|new|template|do|not|this|for".split("|")),b=e.arrayToMap("NULL".split("|"));this.$rules={start:[{token:"comment",regex:"\\/\\/.*$"},(new f).getStartRule("doc-start"),{token:"comment",merge:!0,regex:"\\/\\*",next:"comment"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",merge:!0,regex:'["].*\\\\$',next:"qqstring"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"string",merge:!0,regex:"['].*\\\\$",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant",regex:"<[a-zA-Z0-9.]+>"},{token:"keyword",regex:"(?:#include|#pragma|#line|#define|#undef|#ifdef|#else|#elif|#endif|#ifndef)"},{token:function(c){return c=="this"?"variable.language":a.hasOwnProperty(c)?"keyword":b.hasOwnProperty(c)?"constant.language":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|new|delete|typeof|void)"},{token:"punctuation.operator",regex:"\\?|\\:|\\,|\\;|\\."},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",merge:!0,regex:".+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",merge:!0,regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",merge:!0,regex:".+"}]},this.embedRules(f,"doc-",[(new f).getEndRule("start")])};d.inherits(h,g),b.c_cppHighlightRules=h}),define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(a,b,c){var d=a("../lib/oop"),e=a("./text_highlight_rules").TextHighlightRules,f=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc",merge:!0,regex:"\\s+"},{token:"comment.doc",merge:!0,regex:"TODO"},{token:"comment.doc",merge:!0,regex:"[^@\\*]+"},{token:"comment.doc",merge:!0,regex:"."}]}};d.inherits(f,e),function(){this.getStartRule=function(a){return{token:"comment.doc",merge:!0,regex:"\\/\\*(?=\\*)",next:a}},this.getEndRule=function(a){return{token:"comment.doc",merge:!0,regex:"\\*\\/",next:a}}}.call(f.prototype),b.DocCommentHighlightRules=f}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(a,b,c){var d=a("../range").Range,e=function(){};((function(){this.checkOutdent=function(a,b){return/^\s+$/.test(a)?/^\s*\}/.test(b):!1},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);return b?b[1]:""}})).call(e.prototype),b.MatchingBraceOutdent=e}),define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour"],function(a,b,c){var d=a("../../lib/oop"),e=a("../behaviour").Behaviour,f=function(){this.add("braces","insertion",function(a,b,c,d,e){if(e=="{"){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);return g!==""?{text:"{"+g+"}",selection:!1}:{text:"{}",selection:[1,1]}}if(e=="}"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j=="}"){var k=d.$findOpeningBracket("}",{column:h.column+1,row:h.row});if(k!==null)return{text:"",selection:[1,1]}}}else if(e=="\n"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j=="}"){var l=d.findMatchingBracket({row:h.row,column:h.column+1});if(!l)return null;var m=this.getNextLineIndent(a,i.substring(0,i.length-1),d.getTabString()),n=this.$getIndent(d.doc.getLine(l.row));return{text:"\n"+m+"\n"+n,selection:[1,m.length,1,m.length]}}}}),this.add("braces","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=="{"){var g=d.doc.getLine(e.start.row),h=g.substring(e.end.column,e.end.column+1);if(h=="}")return e.end.column++,e}}),this.add("parens","insertion",function(a,b,c,d,e){if(e=="("){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);return g!==""?{text:"("+g+")",selection:!1}:{text:"()",selection:[1,1]}}if(e==")"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j==")"){var k=d.$findOpeningBracket(")",{column:h.column+1,row:h.row});if(k!==null)return{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=="("){var g=d.doc.getLine(e.start.row),h=g.substring(e.start.column+1,e.start.column+2);if(h==")")return e.end.column++,e}}),this.add("string_dquotes","insertion",function(a,b,c,d,e){if(e=='"'){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);if(g!=="")return{text:'"'+g+'"',selection:!1};var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column-1,h.column);if(j=="\\")return null;var k=d.getTokens(f.start.row,f.start.row)[0].tokens,l=0,m,n=-1;for(var o=0;of.start.column)break;l+=k[o].value.length}if(!m||n<0&&m.type!=="comment"&&(m.type!=="string"||f.start.column!==m.value.length+l-1&&m.value.lastIndexOf('"')===m.value.length-1))return{text:'""',selection:[1,1]};if(m&&m.type==="string"){var p=i.substring(h.column,h.column+1);if(p=='"')return{text:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=='"'){var g=d.doc.getLine(e.start.row),h=g.substring(e.start.column+1,e.start.column+2);if(h=='"')return e.end.column++,e}})};d.inherits(f,e),b.CstyleBehaviour=f}) \ No newline at end of file +define("ace/mode/c_cpp",[], function(require, exports, module) { + +var oop = require("ace/lib/oop"); +var TextMode = require("ace/mode/text").Mode; +var Tokenizer = require("ace/tokenizer").Tokenizer; +var c_cppHighlightRules = require("ace/mode/c_cpp_highlight_rules").c_cppHighlightRules; +var MatchingBraceOutdent = require("ace/mode/matching_brace_outdent").MatchingBraceOutdent; +var Range = require("ace/range").Range; +var CstyleBehaviour = require("ace/mode/behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("ace/mode/folding/cstyle").FoldMode; + +var Mode = function() { + this.$tokenizer = new Tokenizer(new c_cppHighlightRules().getRules()); + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.toggleCommentLines = function(state, doc, startRow, endRow) { + var outdent = true; + var re = /^(\s*)\/\//; + + for (var i=startRow; i<= endRow; i++) { + if (!re.test(doc.getLine(i))) { + outdent = false; + break; + } + } + + if (outdent) { + var deleteRange = new Range(0, 0, 0, 0); + for (var i=startRow; i<= endRow; i++) + { + var line = doc.getLine(i); + var m = line.match(re); + deleteRange.start.row = i; + deleteRange.end.row = i; + deleteRange.end.column = m[0].length; + doc.replace(deleteRange, m[1]); + } + } + else { + doc.indentRows(startRow, endRow, "//"); + } + }; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.$tokenizer.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; + } + } else if (state == "doc-start") { + if (endState == "start") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + 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; +}); + +define("ace/mode/c_cpp_highlight_rules",[], function(require, exports, module) { + +var oop = require("ace/lib/oop"); +var lang = require("ace/lib/lang"); +var DocCommentHighlightRules = require("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules; + +var c_cppHighlightRules = function() { + + var keywords = lang.arrayToMap( + ("and|double|not_eq|throw|and_eq|dynamic_cast|operator|true|" + + "asm|else|or|try|auto|enum|or_eq|typedef|bitand|explicit|private|" + + "typeid|bitor|extern|protected|typename|bool|false|public|union|" + + "break|float|register|unsigned|case|fro|reinterpret-cast|using|catch|" + + "friend|return|virtual|char|goto|short|void|class|if|signed|volatile|" + + "compl|inline|sizeof|wchar_t|const|int|static|while|const-cast|long|" + + "static_cast|xor|continue|mutable|struct|xor_eq|default|namespace|" + + "switch|delete|new|template|do|not|this|for").split("|") + ); + + var buildinConstants = lang.arrayToMap( + ("NULL").split("|") + ); + + // regexp must not have capturing parentheses. Use (?:) instead. + // regexps are ordered -> the first match is used + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "\\/\\/.*$" + }, + new DocCommentHighlightRules().getStartRule("doc-start"), + { + token : "comment", // multi line comment + merge : true, + regex : "\\/\\*", + next : "comment" + }, { + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, { + token : "string", // multi line string start + merge : true, + regex : '["].*\\\\$', + next : "qqstring" + }, { + token : "string", // single line + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : "string", // multi line string start + merge : true, + regex : "['].*\\\\$", + next : "qstring" + }, { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : "constant", // + regex : "<[a-zA-Z0-9.]+>" + }, { + token : "keyword", // pre-compiler directivs + regex : "(?:#include|#pragma|#line|#define|#undef|#ifdef|#else|#elif|#endif|#ifndef)" + }, { + token : function(value) { + if (value == "this") + return "variable.language"; + else if (keywords.hasOwnProperty(value)) + return "keyword"; + else if (buildinConstants.hasOwnProperty(value)) + return "constant.language"; + else + return "identifier"; + }, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "keyword.operator", + regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|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 + merge : true, + regex : ".+" + } + ], + "qqstring" : [ + { + token : "string", + regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', + next : "start" + }, { + token : "string", + merge : true, + regex : '.+' + } + ], + "qstring" : [ + { + token : "string", + regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", + next : "start" + }, { + token : "string", + merge : true, + regex : '.+' + } + ] + }; + + this.embedRules(DocCommentHighlightRules, "doc-", + [ new DocCommentHighlightRules().getEndRule("start") ]); +}; + +oop.inherits(c_cppHighlightRules, TextHighlightRules); + +exports.c_cppHighlightRules = c_cppHighlightRules; +}); + diff --git a/chrome/content/ace++/res/ace/mode-coffee.js b/chrome/content/ace++/res/ace/mode-coffee.js index 1c32adc..88ae270 100644 --- a/chrome/content/ace++/res/ace/mode-coffee.js +++ b/chrome/content/ace++/res/ace/mode-coffee.js @@ -1,3 +1,288 @@ -define("ace/mode/coffee",["require","exports","module","ace/tokenizer","ace/mode/coffee_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/text","ace/worker/worker_client","ace/lib/oop"],function(a,b,c){function k(){this.$tokenizer=new d((new e).getRules()),this.$outdent=new f}var d=a("ace/tokenizer").Tokenizer,e=a("ace/mode/coffee_highlight_rules").CoffeeHighlightRules,f=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,g=a("ace/range").Range,h=a("ace/mode/text").Mode,i=a("ace/worker/worker_client").WorkerClient,j=a("ace/lib/oop");j.inherits(k,h),function(){var a=/(?:[({[=:]|[-=]>|\b(?:else|switch|try|catch(?:\s*[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)?|finally))\s*$/,b=/^(\s*)#/,c=/^\s*###(?!#)/,d=/^\s*/;this.getNextLineIndent=function(b,c,d){var e=this.$getIndent(c),f=this.$tokenizer.getLineTokens(c,b).tokens;return(!f.length||f[f.length-1].type!=="comment")&&b==="start"&&a.test(c)&&(e+=d),e},this.toggleCommentLines=function(a,e,f,h){console.log("toggle");var i=new g(0,0,0,0);for(var j=f;j<=h;++j){var k=e.getLine(j);if(c.test(k))continue;b.test(k)?k=k.replace(b,"$1"):k=k.replace(d,"$&#"),i.end.row=i.start.row=j,i.end.column=k.length+1,e.replace(i,k)}},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)},this.createWorker=function(a){var b=new i(["ace"],"worker-coffee.js","ace/mode/coffee_worker","Worker");b.attachToDocument(a.getDocument()),b.on("error",function(b){a.setAnnotations([b.data])}),b.on("ok",function(b){a.clearAnnotations()})}}.call(k.prototype),b.Mode=k}), -define("ace/mode/coffee_highlight_rules",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/mode/text_highlight_rules"],function(a,b,c){function g(){var a="[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*",b={token:"string",merge:!0,regex:".+"},c=d.arrayToMap("this|throw|then|try|typeof|super|switch|return|break|by)|continue|catch|class|in|instanceof|is|isnt|if|else|extends|for|forown|finally|function|while|when|new|no|not|delete|debugger|do|loop|of|off|or|on|unless|until|and|yes".split("|")),e=d.arrayToMap("true|false|null|undefined".split("|")),f=d.arrayToMap("case|const|default|function|var|void|with|enum|export|implements|interface|let|package|private|protected|public|static|yield|__hasProp|extends|slice|bind|indexOf".split("|")),g=d.arrayToMap("Array|Boolean|Date|Function|Number|Object|RegExp|ReferenceError|RangeError|String|SyntaxError|Error|EvalError|TypeError|URIError".split("|")),h=d.arrayToMap("Math|JSON|isNaN|isFinite|parseInt|parseFloat|encodeURI|encodeURIComponent|decodeURI|decodeURIComponent|RangeError|String|SyntaxError|Error|EvalError|TypeError|URIError".split("|"));this.$rules={start:[{token:"identifier",regex:"(?:(?:\\.|::)\\s*)"+a},{token:"variable",regex:"@"+a},{token:function(a){return c.hasOwnProperty(a)?"keyword":e.hasOwnProperty(a)?"constant.language":f.hasOwnProperty(a)?"invalid.illegal":g.hasOwnProperty(a)?"language.support.class":h.hasOwnProperty(a)?"language.support.function":"identifier"},regex:a},{token:"constant.numeric",regex:"(?:0x[\\da-fA-F]+|(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?)"},{token:"string",merge:!0,regex:"'''",next:"qdoc"},{token:"string",merge:!0,regex:'"""',next:"qqdoc"},{token:"string",merge:!0,regex:"'",next:"qstring"},{token:"string",merge:!0,regex:'"',next:"qqstring"},{token:"string",merge:!0,regex:"`",next:"js"},{token:"string.regex",merge:!0,regex:"///",next:"heregex"},{token:"string.regex",regex:"/(?!\\s)[^[/\\n\\\\]*(?: (?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[/\\n\\\\]*)*/[imgy]{0,4}(?!\\w)"},{token:"comment",merge:!0,regex:"###(?!#)",next:"comment"},{token:"comment",regex:"#.*"},{token:"punctuation.operator",regex:"\\?|\\:|\\,|\\."},{token:"paren.lparen",regex:"[({[]"},{token:"paren.rparen",regex:"[\\]})]"},{token:"keyword.operator",regex:"\\S+"},{token:"text",regex:"\\s+"}],qdoc:[{token:"string",regex:".*?'''",next:"start"},b],qqdoc:[{token:"string",regex:'.*?"""',next:"start"},b],qstring:[{token:"string",regex:"[^\\\\']*(?:\\\\.[^\\\\']*)*'",next:"start"},b],qqstring:[{token:"string",regex:'[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',next:"start"},b],js:[{token:"string",merge:!0,regex:"[^\\\\`]*(?:\\\\.[^\\\\`]*)*`",next:"start"},b],heregex:[{token:"string.regex",regex:".*?///[imgy]{0,4}",next:"start"},{token:"comment.regex",regex:"\\s+(?:#.*)?"},{token:"string.regex",merge:!0,regex:"\\S+"}],comment:[{token:"comment",regex:".*?###",next:"start"},{token:"comment",merge:!0,regex:".+"}]}}var d=a("ace/lib/lang"),e=a("ace/lib/oop"),f=a("ace/mode/text_highlight_rules").TextHighlightRules;e.inherits(g,f),b.CoffeeHighlightRules=g}), -define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(a,b,c){var d=a("ace/range").Range,e=function(){};((function(){this.checkOutdent=function(a,b){return/^\s+$/.test(a)?/^\s*\}/.test(b):!1},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);return b?b[1]:""}})).call(e.prototype),b.MatchingBraceOutdent=e}) \ No newline at end of file +define("ace/mode/coffee",[], function(require, exports, module) { + +var Tokenizer = require("ace/tokenizer").Tokenizer; +var Rules = require("ace/mode/coffee_highlight_rules").CoffeeHighlightRules; +var Outdent = require("ace/mode/matching_brace_outdent").MatchingBraceOutdent; +var PythonFoldMode = require("ace/mode/folding/pythonic").FoldMode; +var Range = require("ace/range").Range; +var TextMode = require("ace/mode/text").Mode; +var oop = require("ace/lib/oop"); + +function Mode() { + this.$tokenizer = new Tokenizer(new Rules().getRules()); + this.$outdent = new Outdent(); + this.foldingRules = new PythonFoldMode("=|=>|->|\\s*class [^#]*"); +} + +oop.inherits(Mode, TextMode); + +(function() { + + this.foldingType = "indentation"; + + var indenter = /(?:[({[=:]|[-=]>|\b(?:else|switch|try|catch(?:\s*[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)?|finally))\s*$/; + var commentLine = /^(\s*)#/; + var hereComment = /^\s*###(?!#)/; + var indentation = /^\s*/; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + var tokens = this.$tokenizer.getLineTokens(line, state).tokens; + + if (!(tokens.length && tokens[tokens.length - 1].type === 'comment') && + state === 'start' && indenter.test(line)) + indent += tab; + return indent; + }; + + this.toggleCommentLines = function(state, doc, startRow, endRow){ + console.log("toggle"); + var range = new Range(0, 0, 0, 0); + for (var i = startRow; i <= endRow; ++i) { + var line = doc.getLine(i); + if (hereComment.test(line)) + continue; + + if (commentLine.test(line)) + line = line.replace(commentLine, '$1'); + else + line = line.replace(indentation, '$&#'); + + range.end.row = range.start.row = i; + range.end.column = line.length + 1; + doc.replace(range, line); + } + }; + + 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; + +}); + +define("ace/mode/coffee_highlight_rules",[], function(require, exports, module) { + + var lang = require("ace/lib/lang"); + var oop = require("ace/lib/oop"); + var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules; + + oop.inherits(CoffeeHighlightRules, TextHighlightRules); + + function CoffeeHighlightRules() { + var identifier = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*"; + var stringfill = { + token : "string", + merge : true, + regex : ".+" + }; + + var keywords = lang.arrayToMap(( + "this|throw|then|try|typeof|super|switch|return|break|by)|continue|" + + "catch|class|in|instanceof|is|isnt|if|else|extends|for|forown|" + + "finally|function|while|when|new|no|not|delete|debugger|do|loop|of|off|" + + "or|on|unless|until|and|yes").split("|") + ); + + var langConstant = lang.arrayToMap(( + "true|false|null|undefined").split("|") + ); + + var illegal = lang.arrayToMap(( + "case|const|default|function|var|void|with|enum|export|implements|" + + "interface|let|package|private|protected|public|static|yield|" + + "__hasProp|extends|slice|bind|indexOf").split("|") + ); + + var supportClass = lang.arrayToMap(( + "Array|Boolean|Date|Function|Number|Object|RegExp|ReferenceError|" + + "RangeError|String|SyntaxError|Error|EvalError|TypeError|URIError").split("|") + ); + + var supportFunction = lang.arrayToMap(( + "Math|JSON|isNaN|isFinite|parseInt|parseFloat|encodeURI|" + + "encodeURIComponent|decodeURI|decodeURIComponent|RangeError|String|" + + "SyntaxError|Error|EvalError|TypeError|URIError").split("|") + ); + + this.$rules = { + start : [ + { + token : "identifier", + regex : "(?:(?:\\.|::)\\s*)" + identifier + }, { + token : "variable", + regex : "@(?:" + identifier + ")?" + }, { + token: function(value) { + if (keywords.hasOwnProperty(value)) + return "keyword"; + else if (langConstant.hasOwnProperty(value)) + return "constant.language"; + else if (illegal.hasOwnProperty(value)) + return "invalid.illegal"; + else if (supportClass.hasOwnProperty(value)) + return "language.support.class"; + else if (supportFunction.hasOwnProperty(value)) + return "language.support.function"; + else + return "identifier"; + }, + regex : identifier + }, { + token : "constant.numeric", + regex : "(?:0x[\\da-fA-F]+|(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?)" + }, { + token : "string", + merge : true, + regex : "'''", + next : "qdoc" + }, { + token : "string", + merge : true, + regex : '"""', + next : "qqdoc" + }, { + token : "string", + merge : true, + regex : "'", + next : "qstring" + }, { + token : "string", + merge : true, + regex : '"', + next : "qqstring" + }, { + token : "string", + merge : true, + regex : "`", + next : "js" + }, { + token : "string.regex", + merge : true, + regex : "///", + next : "heregex" + }, { + token : "string.regex", + regex : "/(?!\\s)[^[/\\n\\\\]*(?: (?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[/\\n\\\\]*)*/[imgy]{0,4}(?!\\w)" + }, { + token : "comment", + merge : true, + regex : "###(?!#)", + next : "comment" + }, { + token : "comment", + regex : "#.*" + }, { + token : "punctuation.operator", + regex : "\\?|\\:|\\,|\\." + }, { + token : "keyword.operator", + regex : "(?:[\\-=]>|[-+*/%<>&|^!?=]=|>>>=?|\\-\\-|\\+\\+|::|&&=|\\|\\|=|<<=|>>=|\\?\\.|\\.{2,3}|\\!)" + }, { + token : "paren.lparen", + regex : "[({[]" + }, { + token : "paren.rparen", + regex : "[\\]})]" + }, { + token : "text", + regex : "\\s+" + }], + + qdoc : [{ + token : "string", + regex : ".*?'''", + next : "start" + }, stringfill], + + qqdoc : [{ + token : "string", + regex : '.*?"""', + next : "start" + }, stringfill], + + qstring : [{ + token : "string", + regex : "[^\\\\']*(?:\\\\.[^\\\\']*)*'", + merge : true, + next : "start" + }, stringfill], + + qqstring : [{ + token : "string", + regex : '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"', + merge : true, + next : "start" + }, stringfill], + + js : [{ + token : "string", + merge : true, + regex : "[^\\\\`]*(?:\\\\.[^\\\\`]*)*`", + next : "start" + }, stringfill], + + heregex : [{ + token : "string.regex", + regex : '.*?///[imgy]{0,4}', + next : "start" + }, { + token : "comment.regex", + regex : "\\s+(?:#.*)?" + }, { + token : "string.regex", + merge : true, + regex : "\\S+" + }], + + comment : [{ + token : "comment", + regex : '.*?###', + next : "start" + }, { + token : "comment", + merge : true, + regex : ".+" + }] + }; + } + + exports.CoffeeHighlightRules = CoffeeHighlightRules; +}); + +define("ace/mode/folding/pythonic",[], function(require, exports, module) { + +var oop = require("ace/lib/oop"); +var BaseFoldMode = require("ace/mode/folding/fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(markers) { + this.foldingStartMarker = new RegExp("(?:([\\[{])|(" + markers + "))(?:\\s*)(?:#.*)?$"); +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var line = session.getLine(row); + var match = line.match(this.foldingStartMarker); + if (match) { + if (match[1]) + return this.openingBracketBlock(session, match[1], row, match.index); + if (match[2]) + return this.indentationBlock(session, row, match.index + match[2].length); + return this.indentationBlock(session, row); + } + } + +}).call(FoldMode.prototype); + +}); + diff --git a/chrome/content/ace++/res/ace/mode-html.js b/chrome/content/ace++/res/ace/mode-html.js index be0459a..2d00c01 100644 --- a/chrome/content/ace++/res/ace/mode-html.js +++ b/chrome/content/ace++/res/ace/mode-html.js @@ -1 +1,1715 @@ -define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/tokenizer","ace/mode/html_highlight_rules","ace/mode/behaviour/xml"],function(a,b,c){var d=a("ace/lib/oop"),e=a("ace/mode/text").Mode,f=a("ace/mode/javascript").Mode,g=a("ace/mode/css").Mode,h=a("ace/tokenizer").Tokenizer,i=a("ace/mode/html_highlight_rules").HtmlHighlightRules,j=a("ace/mode/behaviour/xml").XmlBehaviour,k=function(){var a=new i;this.$tokenizer=new h(a.getRules()),this.$behaviour=new j,this.$embeds=a.getEmbeds(),this.createModeDelegates({"js-":f,"css-":g})};d.inherits(k,e),function(){this.toggleCommentLines=function(a,b,c,d){return 0},this.getNextLineIndent=function(a,b,c){return this.$getIndent(b)},this.checkOutdent=function(a,b,c){return!1}}.call(k.prototype),b.Mode=k}),define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/worker/worker_client","ace/mode/behaviour/cstyle"],function(a,b,c){var d=a("ace/lib/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/range").Range,j=a("ace/worker/worker_client").WorkerClient,k=a("ace/mode/behaviour/cstyle").CstyleBehaviour,l=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h,this.$behaviour=new k};d.inherits(l,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)\/\//;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=!1;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h),l=k.match(g);j.start.row=h,j.end.row=h,j.end.column=l[0].length,b.replace(j,l[1])}}else b.indentRows(c,d,"//")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"||a=="regex_allowed"){var h=b.match(/^.*[\{\(\[\:]\s*$/);h&&(d+=c)}else if(a=="doc-start"){if(g=="start"||a=="regex_allowed")return"";var h=b.match(/^\s*(\/?)\*/);h&&(h[1]&&(d+=" "),d+="* ")}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)},this.createWorker=function(a){var b=new j(["ace"],"worker-javascript.js","ace/mode/javascript_worker","JavaScriptWorker");return b.attachToDocument(a.getDocument()),b.on("jslint",function(b){var c=[];for(var d=0;d=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)",next:"regex_allowed"},{token:"punctuation.operator",regex:"\\?|\\:|\\,|\\;|\\.",next:"regex_allowed"},{token:"paren.lparen",regex:"[[({]",next:"regex_allowed"},{token:"paren.rparen",regex:"[\\])}]"},{token:"keyword.operator",regex:"\\/=?",next:"regex_allowed"},{token:"comment",regex:"^#!.*$"},{token:"text",regex:"\\s+"}],regex_allowed:[{token:"comment",merge:!0,regex:"\\/\\*",next:"comment_regex_allowed"},{token:"comment",regex:"\\/\\/.*$"},{token:"string.regexp",regex:"\\/(?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*",next:"start"},{token:"text",regex:"\\s+"},{token:"empty",regex:"",next:"start"}],comment_regex_allowed:[{token:"comment",regex:".*?\\*\\/",merge:!0,next:"regex_allowed"},{token:"comment",merge:!0,regex:".+"}],comment:[{token:"comment",regex:".*?\\*\\/",merge:!0,next:"start"},{token:"comment",merge:!0,regex:".+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",merge:!0,regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",merge:!0,regex:".+"}]},this.embedRules(g,"doc-",[(new g).getEndRule("start")])};d.inherits(i,h),b.JavaScriptHighlightRules=i}),define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(a,b,c){var d=a("ace/lib/oop"),e=a("ace/mode/text_highlight_rules").TextHighlightRules,f=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc",merge:!0,regex:"\\s+"},{token:"comment.doc",merge:!0,regex:"TODO"},{token:"comment.doc",merge:!0,regex:"[^@\\*]+"},{token:"comment.doc",merge:!0,regex:"."}]}};d.inherits(f,e),function(){this.getStartRule=function(a){return{token:"comment.doc",merge:!0,regex:"\\/\\*(?=\\*)",next:a}},this.getEndRule=function(a){return{token:"comment.doc",merge:!0,regex:"\\*\\/",next:a}}}.call(f.prototype),b.DocCommentHighlightRules=f}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(a,b,c){var d=a("ace/range").Range,e=function(){};((function(){this.checkOutdent=function(a,b){return/^\s+$/.test(a)?/^\s*\}/.test(b):!1},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);return b?b[1]:""}})).call(e.prototype),b.MatchingBraceOutdent=e}),define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(a,b,c){var d=a("ace/lib/oop"),e=a("ace/lib/event_emitter").EventEmitter,f=function(b,c,d,e){this.changeListener=this.changeListener.bind(this);if(window.require.packaged)var f=this.$guessBasePath(),g=this.$worker=new Worker(f+c);else{var h=this.$normalizePath(a.nameToUrl("ace/worker/worker",null,"_")),g=this.$worker=new Worker(h),i={};for(var j=0;jf.start.column)break;l+=k[o].value.length}if(!m||n<0&&m.type!=="comment"&&(m.type!=="string"||f.start.column!==m.value.length+l-1&&m.value.lastIndexOf('"')===m.value.length-1))return{text:'""',selection:[1,1]};if(m&&m.type==="string"){var p=i.substring(h.column,h.column+1);if(p=='"')return{text:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=='"'){var g=d.doc.getLine(e.start.row),h=g.substring(e.start.column+1,e.start.column+2);if(h=='"')return e.end.column++,e}})};d.inherits(f,e),b.CstyleBehaviour=f}),define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client"],function(a,b,c){var d=a("ace/lib/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/css_highlight_rules").CssHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/worker/worker_client").WorkerClient,j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a).tokens;if(e.length&&e[e.length-1].type=="comment")return d;var f=b.match(/^.*\{\s*$/);return f&&(d+=c),d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)},this.createWorker=function(a){var b=new i(["ace"],"worker-css.js","ace/mode/css_worker","Worker");b.attachToDocument(a.getDocument()),b.on("csslint",function(b){var c=[];b.data.forEach(function(a){c.push({row:a.line-1,column:a.col-1,text:a.message,type:a.type,lint:a})}),a.setAnnotations(c)})}}.call(j.prototype),b.Mode=j}),define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(a,b,c){var d=a("ace/lib/oop"),e=a("ace/lib/lang"),f=a("ace/mode/text_highlight_rules").TextHighlightRules,g=function(){function g(a){var b=[],c=a.split("");for(var d=0;d",next:e},{token:"entity.other.attribute-name",regex:"[-_a-zA-Z0-9:]+"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"text",regex:"\\s+"}].concat(a(d))}this.$rules={start:[{token:"text",merge:!0,regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:"xml_pe",regex:"<\\?.*?\\?>"},{token:"comment",merge:!0,regex:"<\\!--",next:"comment"},{token:"text",regex:"<(?=s*script)",next:"script"},{token:"text",regex:"<(?=s*style)",next:"css"},{token:"text",regex:"<\\/?",next:"tag"},{token:"text",regex:"\\s+"},{token:"text",regex:"[^<]+"}],cdata:[{token:"text",regex:"\\]\\]>",next:"start"},{token:"text",merge:!0,regex:"\\s+"},{token:"text",merge:!0,regex:".+"}],comment:[{token:"comment",regex:".*?-->",next:"start"},{token:"comment",merge:!0,regex:".+"}]},c(this.$rules,"tag","start"),c(this.$rules,"css","css-start"),c(this.$rules,"script","js-start"),this.embedRules(f,"js-",[{token:"comment",regex:"\\/\\/.*(?=<\\/script>)",next:"tag"},{token:"text",regex:"<\\/(?=script)",next:"tag"}]),this.embedRules(e,"css-",[{token:"text",regex:"<\\/(?=style)",next:"tag"}])};d.inherits(h,g),b.HtmlHighlightRules=h}),define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle"],function(a,b,c){var d=a("ace/lib/oop"),e=a("ace/mode/behaviour").Behaviour,f=a("ace/mode/behaviour/cstyle").CstyleBehaviour,g=function(){this.inherit(f,["string_dquotes"]),this.add("brackets","insertion",function(a,b,c,d,e){if(e=="<"){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);return g!==""?!1:{text:"<>",selection:[1,1]}}if(e==">"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j==">")return{text:"",selection:[1,1]}}else if(e=="\n"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),k=i.substring(h.column,h.column+2);if(k==" the first match is used + this.$rules = { + start : [{ + token : "text", + merge : true, + regex : "<\\!\\[CDATA\\[", + next : "cdata" + }, { + token : "xml_pe", + regex : "<\\?.*?\\?>" + }, { + token : "comment", + merge : true, + regex : "<\\!--", + next : "comment" + }, { + token : "meta.tag", + regex : "<(?=\s*script\\b)", + next : "script" + }, { + token : "meta.tag", + regex : "<(?=\s*style\\b)", + next : "css" + }, { + token : "meta.tag", // opening tag + regex : "<\\/?", + next : "tag" + }, { + token : "text", + regex : "\\s+" + }, { + token : "text", + regex : "[^<]+" + } ], + + cdata : [ { + token : "text", + regex : "\\]\\]>", + next : "start" + }, { + token : "text", + merge : true, + regex : "\\s+" + }, { + token : "text", + merge : true, + regex : ".+" + } ], + + comment : [ { + token : "comment", + regex : ".*?-->", + next : "start" + }, { + token : "comment", + merge : true, + regex : ".+" + } ] + }; + + xmlUtil.tag(this.$rules, "tag", "start"); + xmlUtil.tag(this.$rules, "css", "css-start"); + xmlUtil.tag(this.$rules, "script", "js-start"); + + this.embedRules(JavaScriptHighlightRules, "js-", [{ + token: "comment", + regex: "\\/\\/.*(?=<\\/script>)", + next: "tag" + }, { + token: "meta.tag", + regex: "<\\/(?=script)", + next: "tag" + }]); + + this.embedRules(CssHighlightRules, "css-", [{ + token: "meta.tag", + regex: "<\\/(?=style)", + next: "tag" + }]); +}; + +oop.inherits(HtmlHighlightRules, TextHighlightRules); + +exports.HtmlHighlightRules = HtmlHighlightRules; +}); + +define("ace/mode/behaviour/xml",[], function(require, exports, module) { + +var oop = require("ace/lib/oop"); +var Behaviour = require("ace/mode/behaviour").Behaviour; +var CstyleBehaviour = require("ace/mode/behaviour/cstyle").CstyleBehaviour; + +var XmlBehaviour = function () { + + this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour + + this.add("brackets", "insertion", function (state, action, editor, session, text) { + if (text == '<') { + var selection = editor.getSelectionRange(); + var selected = session.doc.getTextRange(selection); + if (selected !== "") { + return false; + } else { + return { + text: '<>', + selection: [1, 1] + } + } + } else if (text == '>') { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar == '>') { // need some kind of matching check here + return { + text: '', + selection: [1, 1] + } + } + } else if (text == "\n") { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChars = line.substring(cursor.column, cursor.column + 2); + if (rightChars == ' the first match is used + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "\\/\\/.*$" + }, + new DocCommentHighlightRules().getStartRule("doc-start"), + { + token : "comment", // multi line comment + merge : true, + regex : "\\/\\*", + next : "comment" + }, { + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, { + token : "string", // multi line string start + merge : true, + regex : '["].*\\\\$', + next : "qqstring" + }, { + token : "string", // single line + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : "string", // multi line string start + merge : true, + regex : "['].*\\\\$", + next : "qstring" + }, { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : ["keyword.definition", "text", "entity.name.function"], + regex : "(function)(\\s+)(" + identifierRe + ")" + }, { + token : "constant.language.boolean", + regex : "(?:true|false)\\b" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "regex_allowed" + }, { + token : function(value) { + if (globals.hasOwnProperty(value)) + return "variable.language"; + else if (deprecated.hasOwnProperty(value)) + return "invalid.deprecated"; + else if (definitions.hasOwnProperty(value)) + return "keyword.definition"; + else if (keywords.hasOwnProperty(value)) + return "keyword"; + else if (buildinConstants.hasOwnProperty(value)) + return "constant.language"; + else if (futureReserved.hasOwnProperty(value)) + return "invalid.illegal"; + else if (value == "debugger") + return "invalid.deprecated"; + else + return "identifier"; + }, + regex : identifierRe + }, { + token : "keyword.operator", + regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)", + next : "regex_allowed" + }, { + token : "punctuation.operator", + regex : "\\?|\\:|\\,|\\;|\\.", + next : "regex_allowed" + }, { + token : "paren.lparen", + regex : "[[({]", + next : "regex_allowed" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "keyword.operator", + regex : "\\/=?", + next : "regex_allowed" + }, { + token: "comment", + regex: "^#!.*$" + }, { + token : "text", + regex : "\\s+" + } + ], + // regular expressions are only allowed after certain tokens. This + // makes sure we don't mix up regexps with the divison operator + "regex_allowed": [ + { + token : "comment", // multi line comment + merge : true, + regex : "\\/\\*", + next : "comment_regex_allowed" + }, { + token : "comment", + regex : "\\/\\/.*$" + }, { + token: "string.regexp", + regex: "\\/", + next: "regex", + merge: true + }, { + token : "text", + regex : "\\s+" + }, { + // immediately return to the start mode without matching + // anything + token: "empty", + regex: "", + next: "start" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)", + next: "regex" + }, { + // flag + token: "string.regexp", + regex: "/\\w*", + next: "start", + merge: true + }, { + token: "string.regexp", + regex: "[^\\\\/\\[]+", + next: "regex", + merge: true + }, { + token: "string.regexp.charachterclass", + regex: "\\[", + next: "regex_character_class", + merge: true + }, { + token: "empty", + regex: "", + next: "start" + } + ], + "regex_character_class": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)", + next: "regex_character_class" + }, { + token: "string.regexp.charachterclass", + regex: "]", + next: "regex", + merge: true + }, { + token: "string.regexp.charachterclass", + regex: "[^\\\\\\]]+", + next: "regex_character_class", + merge: true + }, { + token: "empty", + regex: "", + next: "start" + } + ], + "comment_regex_allowed" : [ + { + token : "comment", // closing comment + regex : ".*?\\*\\/", + merge : true, + next : "regex_allowed" + }, { + token : "comment", // comment spanning whole line + merge : true, + regex : ".+" + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : ".*?\\*\\/", + merge : true, + next : "start" + }, { + token : "comment", // comment spanning whole line + merge : true, + regex : ".+" + } + ], + "qqstring" : [ + { + token : "string", + regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', + next : "start" + }, { + token : "string", + merge : true, + regex : '.+' + } + ], + "qstring" : [ + { + token : "string", + regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", + next : "start" + }, { + token : "string", + merge : true, + regex : '.+' + } + ] + }; + + this.embedRules(DocCommentHighlightRules, "doc-", + [ new DocCommentHighlightRules().getEndRule("start") ]); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +define("ace/mode/matching_brace_outdent",[], function(require, exports, module) { + +var Range = require("ace/range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + var match = line.match(/^(\s+)/); + if (match) { + return match[1]; + } + + return ""; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +define("ace/mode/behaviour/cstyle",[], function(require, exports, module) { + +var oop = require("ace/lib/oop"); +var Behaviour = require("ace/mode/behaviour").Behaviour; + +var CstyleBehaviour = function () { + + this.add("braces", "insertion", function (state, action, editor, session, text) { + if (text == '{') { + var selection = editor.getSelectionRange(); + var selected = session.doc.getTextRange(selection); + if (selected !== "") { + return { + text: '{' + selected + '}', + selection: false + } + } else { + return { + text: '{}', + selection: [1, 1] + } + } + } else if (text == '}') { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar == '}') { + var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); + if (matching !== null) { + return { + text: '', + selection: [1, 1] + } + } + } + } else if (text == "\n") { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar == '}') { + var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1}); + if (!openBracePos) + return null; + + var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString()); + var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row)); + + return { + text: '\n' + indent + '\n' + next_indent, + selection: [1, indent.length, 1, indent.length] + } + } + } + }); + + this.add("braces", "deletion", function (state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected == '{') { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.end.column, range.end.column + 1); + if (rightChar == '}') { + range.end.column++; + return range; + } + } + }); + + this.add("parens", "insertion", function (state, action, editor, session, text) { + if (text == '(') { + var selection = editor.getSelectionRange(); + var selected = session.doc.getTextRange(selection); + if (selected !== "") { + return { + text: '(' + selected + ')', + selection: false + } + } else { + return { + text: '()', + selection: [1, 1] + } + } + } else if (text == ')') { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar == ')') { + var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); + if (matching !== null) { + return { + text: '', + selection: [1, 1] + } + } + } + } + }); + + this.add("parens", "deletion", function (state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected == '(') { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == ')') { + range.end.column++; + return range; + } + } + }); + + this.add("string_dquotes", "insertion", function (state, action, editor, session, text) { + if (text == '"') { + var selection = editor.getSelectionRange(); + var selected = session.doc.getTextRange(selection); + if (selected !== "") { + return { + text: '"' + selected + '"', + selection: false + } + } else { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var leftChar = line.substring(cursor.column-1, cursor.column); + + // We're escaped. + if (leftChar == '\\') { + return null; + } + + // Find what token we're inside. + var tokens = session.getTokens(selection.start.row, selection.start.row)[0].tokens; + var col = 0, token; + var quotepos = -1; // Track whether we're inside an open quote. + + for (var x = 0; x < tokens.length; x++) { + token = tokens[x]; + if (token.type == "string") { + quotepos = -1; + } else if (quotepos < 0) { + quotepos = token.value.indexOf('"'); + } + if ((token.value.length + col) > selection.start.column) { + break; + } + col += tokens[x].value.length; + } + + // Try and be smart about when we auto insert. + if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf('"') === token.value.length-1)))) { + return { + text: '""', + selection: [1,1] + } + } else if (token && token.type === "string") { + // Ignore input and move right one if we're typing over the closing quote. + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar == '"') { + return { + text: '', + selection: [1, 1] + } + } + } + } + } + }); + + this.add("string_dquotes", "deletion", function (state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected == '"') { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == '"') { + range.end.column++; + return range; + } + } + }); + +} +oop.inherits(CstyleBehaviour, Behaviour); + +exports.CstyleBehaviour = CstyleBehaviour; +}); + +define("ace/mode/folding/cstyle",[], function(require, exports, module) { + +var oop = require("ace/lib/oop"); +var Range = require("ace/range").Range; +var BaseFoldMode = require("ace/mode/folding/fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function() {}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var line = session.getLine(row); + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length); + range.end.column -= 2; + return range; + } + + if (foldStyle !== "markbeginend") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[2]) { + var range = session.getCommentFoldRange(row, i); + range.end.column -= 2; + return range; + } + + var end = {row: row, column: i}; + var start = session.$findOpeningBracket(match[1], end); + + if (!start) + return; + + start.column++; + end.column--; + + return Range.fromPoints(start, end); + } + }; + +}).call(FoldMode.prototype); + +}); + +define("ace/mode/css_highlight_rules",[], function(require, exports, module) { + +var oop = require("ace/lib/oop"); +var lang = require("ace/lib/lang"); +var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules; + +var CssHighlightRules = function() { + + var properties = lang.arrayToMap( + ("-moz-appearance|-moz-box-sizing|-webkit-box-sizing|-moz-outline-radius|-moz-transform|-webkit-transform|" + + "appearance|azimuth|background-attachment|background-color|background-image|" + + "background-origin|background-position|background-repeat|background|border-bottom-color|" + + "border-bottom-style|border-bottom-width|border-bottom|border-collapse|" + + "border-color|border-left-color|border-left-style|border-left-width|" + + "border-left|border-right-color|border-right-style|border-right-width|" + + "border-right|border-spacing|border-style|border-top-color|" + + "border-top-style|border-top-width|border-top|border-width|border|" + + "bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|" + + "counter-reset|cue-after|cue-before|cue|cursor|direction|display|" + + "elevation|empty-cells|float|font-family|font-size-adjust|font-size|" + + "font-stretch|font-style|font-variant|font-weight|font|height|left|" + + "letter-spacing|line-height|list-style-image|list-style-position|" + + "list-style-type|list-style|margin-bottom|margin-left|margin-right|" + + "margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" + + "min-width|-moz-border-radius|opacity|orphans|outline-color|outline-offset|outline-radius|" + + "outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" + + "padding-left|padding-right|padding-top|padding|page-break-after|" + + "page-break-before|page-break-inside|page|pause-after|pause-before|" + + "pause|pitch-range|pitch|play-during|pointer-events|position|quotes|resize|richness|right|" + + "size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" + + "stress|table-layout|text-align|text-decoration|text-indent|" + + "text-shadow|text-transform|top|transform|unicode-bidi|vertical-align|" + + "visibility|voice-family|volume|white-space|widows|width|word-spacing|" + + "z-index").split("|") + ); + + var functions = lang.arrayToMap( + ("rgb|rgba|url|attr|counter|counters").split("|") + ); + + var constants = lang.arrayToMap( + ("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" + + "block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" + + "char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" + + "decimal-leading-zero|decimal|default|disabled|disc|" + + "distribute-all-lines|distribute-letter|distribute-space|" + + "distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" + + "hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" + + "ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" + + "ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" + + "inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" + + "keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" + + "lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" + + "medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" + + "nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" + + "overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" + + "ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" + + "solid|square|static|strict|super|sw-resize|table-footer-group|" + + "table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" + + "transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" + + "vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" + + "zero").split("|") + ); + + var colors = lang.arrayToMap( + ("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|" + + "purple|red|silver|teal|white|yellow").split("|") + ); + + // regexp must not have capturing parentheses. Use (?:) instead. + // regexps are ordered -> the first match is used + + var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; + + var base_ruleset = [ + { + token : "comment", // multi line comment + merge : true, + regex : "\\/\\*", + next : "ruleset_comment" + },{ + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, { + token : "string", // single line + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : "constant.numeric", + regex : numRe + "(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)" + }, { + token : "constant.numeric", // hex6 color + regex : "#[a-f0-9]{6}" + }, { + token : "constant.numeric", // hex3 color + regex : "#[a-f0-9]{3}" + }, { + token : function(value) { + if (properties.hasOwnProperty(value.toLowerCase())) { + return "support.type"; + } + else if (functions.hasOwnProperty(value.toLowerCase())) { + return "support.function"; + } + else if (constants.hasOwnProperty(value.toLowerCase())) { + return "support.constant"; + } + else if (colors.hasOwnProperty(value.toLowerCase())) { + return "support.constant.color"; + } + else { + return "text"; + } + }, + regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" + } + ]; + + var ruleset = lang.copyArray(base_ruleset); + ruleset.unshift({ + token : "paren.rparen", + regex : "\\}", + next: "start" + }); + + var media_ruleset = lang.copyArray( base_ruleset ); + media_ruleset.unshift({ + token : "paren.rparen", + regex : "\\}", + next: "media" + }); + + var base_comment = [{ + token : "comment", // comment spanning whole line + merge : true, + regex : ".+" + }]; + + var comment = lang.copyArray(base_comment); + comment.unshift({ + token : "comment", // closing comment + regex : ".*?\\*\\/", + next : "start" + }); + + var media_comment = lang.copyArray(base_comment); + media_comment.unshift({ + token : "comment", // closing comment + regex : ".*?\\*\\/", + next : "media" + }); + + var ruleset_comment = lang.copyArray(base_comment); + ruleset_comment.unshift({ + token : "comment", // closing comment + regex : ".*?\\*\\/", + next : "ruleset" + }); + + this.$rules = { + "start" : [{ + token : "comment", // multi line comment + merge : true, + regex : "\\/\\*", + next : "comment" + }, { + token: "paren.lparen", + regex: "\\{", + next: "ruleset" + }, { + token: "string", + regex: "@.*?{", + next: "media" + },{ + token: "keyword", + regex: "#[a-z0-9-_]+" + },{ + token: "variable", + regex: "\\.[a-z0-9-_]+" + },{ + token: "string", + regex: ":[a-z0-9-_]+" + },{ + token: "constant", + regex: "[a-z0-9-_]+" + }], + + "media" : [ { + token : "comment", // multi line comment + merge : true, + regex : "\\/\\*", + next : "media_comment" + }, { + token: "paren.lparen", + regex: "\\{", + next: "media_ruleset" + },{ + token: "string", + regex: "\\}", + next: "start" + },{ + token: "keyword", + regex: "#[a-z0-9-_]+" + },{ + token: "variable", + regex: "\\.[a-z0-9-_]+" + },{ + token: "string", + regex: ":[a-z0-9-_]+" + },{ + token: "constant", + regex: "[a-z0-9-_]+" + }], + + "comment" : comment, + + "ruleset" : ruleset, + "ruleset_comment" : ruleset_comment, + + "media_ruleset" : media_ruleset, + "media_comment" : media_comment + }; +}; + +oop.inherits(CssHighlightRules, TextHighlightRules); + +exports.CssHighlightRules = CssHighlightRules; + +}); + +define("ace/mode/xml_util",[], function(require, exports, module) { +var lang = require("ace/lib/lang"); + +var formTags = lang.arrayToMap( + ("button|form|input|label|select|textarea").split("|") +); + +var tableTags = lang.arrayToMap( + ("table|tbody|td|tfoot|th|tr").split("|") +); + +function string(state) { + return [{ + token : "string", + regex : '".*?"' + }, { + token : "string", // multi line string start + merge : true, + regex : '["].*', + next : state + "-qqstring" + }, { + token : "string", + regex : "'.*?'" + }, { + token : "string", // multi line string start + merge : true, + regex : "['].*", + next : state + "-qstring" + }]; +} + +function multiLineString(quote, state) { + return [{ + token : "string", + merge : true, + regex : ".*?" + quote, + next : state + }, { + token : "string", + merge : true, + regex : '.+' + }]; +} + +exports.tag = function(states, name, nextState) { + states[name] = [{ + token : "text", + regex : "\\s+" + }, { + //token : "meta.tag", + + token : function(value) { + if ( value==='a' ) { + return "meta.tag.anchor"; + } + else if ( value==='img' ) { + return "meta.tag.image"; + } + else if ( value==='script' ) { + return "meta.tag.script"; + } + else if ( value==='style' ) { + return "meta.tag.style"; + } + else if (formTags.hasOwnProperty(value.toLowerCase())) { + return "meta.tag.form"; + } + else if (tableTags.hasOwnProperty(value.toLowerCase())) { + return "meta.tag.table"; + } + else { + return "meta.tag"; + } + }, + merge : true, + regex : "[-_a-zA-Z0-9:!]+", + next : name + "embed-attribute-list" + }, { + token: "empty", + regex: "", + next : name + "embed-attribute-list" + }]; + + states[name + "-qstring"] = multiLineString("'", name + "embed-attribute-list"); + states[name + "-qqstring"] = multiLineString("\"", name + "embed-attribute-list"); + + states[name + "embed-attribute-list"] = [{ + token : "meta.tag", + merge : true, + regex : "\/?>", + next : nextState + }, { + token : "keyword.operator", + regex : "=" + }, { + token : "entity.other.attribute-name", + regex : "[-_a-zA-Z0-9:]+" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : "text", + regex : "\\s+" + }].concat(string(name)); +}; + +}); + +define("ace/mode/folding/mixed",[], function(require, exports, module) { + +var oop = require("ace/lib/oop"); +var BaseFoldMode = require("ace/mode/folding/fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(defaultMode, subModes) { + this.defaultMode = defaultMode; + this.subModes = subModes; +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + + this.$getMode = function(state) { + for (var key in this.subModes) { + if (state.indexOf(key) === 0) + return this.subModes[key]; + } + return null; + }; + + this.$tryMode = function(state, session, foldStyle, row) { + var mode = this.$getMode(state); + return (mode ? mode.getFoldWidget(session, foldStyle, row) : ""); + }; + + this.getFoldWidget = function(session, foldStyle, row) { + return ( + this.$tryMode(session.getState(row-1), session, foldStyle, row) || + this.$tryMode(session.getState(row), session, foldStyle, row) || + this.defaultMode.getFoldWidget(session, foldStyle, row) + ); + }; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var mode = this.$getMode(session.getState(row-1)); + + if (!mode || !mode.getFoldWidget(session, foldStyle, row)) + mode = this.$getMode(session.getState(row)); + + if (!mode || !mode.getFoldWidget(session, foldStyle, row)) + mode = this.defaultMode; + + return mode.getFoldWidgetRange(session, foldStyle, row); + }; + +}).call(FoldMode.prototype); + +}); + +define("ace/mode/folding/xml",[], function(require, exports, module) { + +var oop = require("ace/lib/oop"); +var lang = require("ace/lib/lang"); +var Range = require("ace/range").Range; +var BaseFoldMode = require("ace/mode/folding/fold_mode").FoldMode; +var TokenIterator = require("ace/token_iterator").TokenIterator; + +var FoldMode = exports.FoldMode = function(voidElements) { + BaseFoldMode.call(this); + this.voidElements = voidElements || {}; +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.getFoldWidget = function(session, foldStyle, row) { + var tag = this._getFirstTagInLine(session, row); + + if (tag.closing) + return foldStyle == "markbeginend" ? "end" : ""; + + if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()]) + return ""; + + if (tag.selfClosing) + return ""; + + if (tag.value.indexOf("/" + tag.tagName) !== -1) + return ""; + + return "start"; + }; + + this._getFirstTagInLine = function(session, row) { + var tokens = session.getTokens(row, row)[0].tokens; + var value = ""; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + if (token.type.indexOf("meta.tag") === 0) + value += token.value; + else + value += lang.stringRepeat(" ", token.value.length); + } + + return this._parseTag(value); + }; + + this.tagRe = /^(\s*)(?)/; + this._parseTag = function(tag) { + + var match = this.tagRe.exec(tag); + var column = this.tagRe.lastIndex || 0; + this.tagRe.lastIndex = 0; + + return { + value: tag, + match: match ? match[2] : "", + closing: match ? !!match[3] : false, + selfClosing: match ? !!match[5] || match[2] == "/>" : false, + tagName: match ? match[4] : "", + column: match[1] ? column + match[1].length : column + }; + }; + + /** + * reads a full tag and places the iterator after the tag + */ + this._readTagForward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var value = ""; + var start; + + do { + if (token.type.indexOf("meta.tag") === 0) { + if (!start) { + var start = { + row: iterator.getCurrentTokenRow(), + column: iterator.getCurrentTokenColumn() + }; + } + value += token.value; + if (value.indexOf(">") !== -1) { + var tag = this._parseTag(value); + tag.start = start; + tag.end = { + row: iterator.getCurrentTokenRow(), + column: iterator.getCurrentTokenColumn() + token.value.length + }; + iterator.stepForward(); + return tag; + } + } + } while(token = iterator.stepForward()); + + return null; + }; + + this._readTagBackward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var value = ""; + var end; + + do { + if (token.type.indexOf("meta.tag") === 0) { + if (!end) { + end = { + row: iterator.getCurrentTokenRow(), + column: iterator.getCurrentTokenColumn() + token.value.length + }; + } + value = token.value + value; + if (value.indexOf("<") !== -1) { + var tag = this._parseTag(value); + tag.end = end; + tag.start = { + row: iterator.getCurrentTokenRow(), + column: iterator.getCurrentTokenColumn() + }; + iterator.stepBackward(); + return tag; + } + } + } while(token = iterator.stepBackward()); + + return null; + }; + + this._pop = function(stack, tag) { + while (stack.length) { + + var top = stack[stack.length-1]; + if (!tag || top.tagName == tag.tagName) { + return stack.pop(); + } + else if (this.voidElements[tag.tagName]) { + return; + } + else if (this.voidElements[top.tagName]) { + stack.pop(); + continue; + } else { + return null; + } + } + }; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var firstTag = this._getFirstTagInLine(session, row); + + if (!firstTag.match) + return null; + + var isBackward = firstTag.closing || firstTag.selfClosing; + var stack = []; + var tag; + + if (!isBackward) { + var iterator = new TokenIterator(session, row, firstTag.column); + var start = { + row: row, + column: firstTag.column + firstTag.tagName.length + 2 + }; + while (tag = this._readTagForward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) + return Range.fromPoints(start, tag.start); + } + else { + stack.push(tag) + } + } + } + else { + var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length); + var end = { + row: row, + column: firstTag.column + }; + + while (tag = this._readTagBackward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (!tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) { + tag.start.column += tag.tagName.length + 2; + return Range.fromPoints(tag.start, end); + } + } + else { + stack.push(tag) + } + } + } + + }; + +}).call(FoldMode.prototype); + +}); + +define("ace/mode/doc_comment_highlight_rules",[], function(require, exports, module) { + +var oop = require("ace/lib/oop"); +var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, { + token : "comment.doc", + merge : true, + regex : "\\s+" + }, { + token : "comment.doc", + merge : true, + regex : "TODO" + }, { + token : "comment.doc", + merge : true, + regex : "[^@\\*]+" + }, { + token : "comment.doc", + merge : true, + regex : "." + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +(function() { + + this.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + merge : true, + regex : "\\/\\*(?=\\*)", + next : start + }; + }; + + this.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + merge : true, + regex : "\\*\\/", + next : start + }; + }; + +}).call(DocCommentHighlightRules.prototype); + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +define("ace/mode/folding/fold_mode",[], function(require, exports, module) { + +var Range = require("ace/range").Range; + +var FoldMode = exports.FoldMode = function() {}; + +(function() { + + this.foldingStartMarker = null; + this.foldingStopMarker = null; + + // must return "" if there's no fold, to enable caching + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + if (this.foldingStartMarker.test(line)) + return "start"; + if (foldStyle == "markbeginend" + && this.foldingStopMarker + && this.foldingStopMarker.test(line)) + return "end"; + return ""; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + return null; + }; + + this.indentationBlock = function(session, row, column) { + var re = /^\s*/; + var startRow = row; + var endRow = row; + var line = session.getLine(row); + var startColumn = column || line.length; + var startLevel = line.match(re)[0].length; + var maxRow = session.getLength() + + while (++row < maxRow) { + line = session.getLine(row); + var level = line.match(re)[0].length; + + if (level == line.length) + continue; + + if (level <= startLevel) + break; + + endRow = row; + } + + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); + } + }; + + this.openingBracketBlock = function(session, bracket, row, column) { + var start = {row: row, column: column + 1}; + var end = session.$findClosingBracket(bracket, start); + if (!end) + return; + + var fw = session.foldWidgets[end.row]; + if (fw == null) + fw = this.getFoldWidget(session, end.row); + + if (fw == "start") { + end.row --; + end.column = session.getLine(end.row).length; + } + return Range.fromPoints(start, end); + }; + +}).call(FoldMode.prototype); + +}); + diff --git a/chrome/content/ace++/res/ace/mode-json.js b/chrome/content/ace++/res/ace/mode-json.js index 58ca145..57ba187 100644 --- a/chrome/content/ace++/res/ace/mode-json.js +++ b/chrome/content/ace++/res/ace/mode-json.js @@ -1 +1,96 @@ -define("ace/mode/json",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/json_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle"],function(a,b,c){var d=a("../lib/oop"),e=a("./text").Mode,f=a("../tokenizer").Tokenizer,g=a("./json_highlight_rules").JsonHighlightRules,h=a("./matching_brace_outdent").MatchingBraceOutdent,i=a("../range").Range,j=a("./behaviour/cstyle").CstyleBehaviour,k=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h,this.$behaviour=new j};d.inherits(k,e),function(){this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(a=="start"){var h=b.match(/^.*[\{\(\[]\s*$/);h&&(d+=c)}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)}}.call(k.prototype),b.Mode=k}),define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(a,b,c){var d=a("../lib/oop"),e=a("../lib/lang"),f=a("./text_highlight_rules").TextHighlightRules,g=function(){this.$rules={start:[{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:"invalid.illegal",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"invalid.illegal",regex:"\\/\\/.*$"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}]}};d.inherits(g,f),b.JsonHighlightRules=g}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(a,b,c){var d=a("../range").Range,e=function(){};((function(){this.checkOutdent=function(a,b){return/^\s+$/.test(a)?/^\s*\}/.test(b):!1},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);return b?b[1]:""}})).call(e.prototype),b.MatchingBraceOutdent=e}),define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour"],function(a,b,c){var d=a("../../lib/oop"),e=a("../behaviour").Behaviour,f=function(){this.add("braces","insertion",function(a,b,c,d,e){if(e=="{"){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);return g!==""?{text:"{"+g+"}",selection:!1}:{text:"{}",selection:[1,1]}}if(e=="}"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j=="}"){var k=d.$findOpeningBracket("}",{column:h.column+1,row:h.row});if(k!==null)return{text:"",selection:[1,1]}}}else if(e=="\n"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j=="}"){var l=d.findMatchingBracket({row:h.row,column:h.column+1});if(!l)return null;var m=this.getNextLineIndent(a,i.substring(0,i.length-1),d.getTabString()),n=this.$getIndent(d.doc.getLine(l.row));return{text:"\n"+m+"\n"+n,selection:[1,m.length,1,m.length]}}}}),this.add("braces","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=="{"){var g=d.doc.getLine(e.start.row),h=g.substring(e.end.column,e.end.column+1);if(h=="}")return e.end.column++,e}}),this.add("parens","insertion",function(a,b,c,d,e){if(e=="("){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);return g!==""?{text:"("+g+")",selection:!1}:{text:"()",selection:[1,1]}}if(e==")"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j==")"){var k=d.$findOpeningBracket(")",{column:h.column+1,row:h.row});if(k!==null)return{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=="("){var g=d.doc.getLine(e.start.row),h=g.substring(e.start.column+1,e.start.column+2);if(h==")")return e.end.column++,e}}),this.add("string_dquotes","insertion",function(a,b,c,d,e){if(e=='"'){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);if(g!=="")return{text:'"'+g+'"',selection:!1};var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column-1,h.column);if(j=="\\")return null;var k=d.getTokens(f.start.row,f.start.row)[0].tokens,l=0,m,n=-1;for(var o=0;of.start.column)break;l+=k[o].value.length}if(!m||n<0&&m.type!=="comment"&&(m.type!=="string"||f.start.column!==m.value.length+l-1&&m.value.lastIndexOf('"')===m.value.length-1))return{text:'""',selection:[1,1]};if(m&&m.type==="string"){var p=i.substring(h.column,h.column+1);if(p=='"')return{text:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=='"'){var g=d.doc.getLine(e.start.row),h=g.substring(e.start.column+1,e.start.column+2);if(h=='"')return e.end.column++,e}})};d.inherits(f,e),b.CstyleBehaviour=f}) \ No newline at end of file +define("ace/mode/json",[], function(require, exports, module) { + +var oop = require("ace/lib/oop"); +var TextMode = require("ace/mode/text").Mode; +var Tokenizer = require("ace/tokenizer").Tokenizer; +var HighlightRules = require("ace/mode/json_highlight_rules").JsonHighlightRules; +var MatchingBraceOutdent = require("ace/mode/matching_brace_outdent").MatchingBraceOutdent; +var CstyleBehaviour = require("ace/mode/behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("ace/mode/folding/cstyle").FoldMode; + +var Mode = function() { + this.$tokenizer = new Tokenizer(new HighlightRules().getRules()); + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + 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; +}); + +define("ace/mode/json_highlight_rules",[], function(require, exports, module) { + +var oop = require("ace/lib/oop"); +var lang = require("ace/lib/lang"); +var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules; + +var JsonHighlightRules = function() { + + // regexp must not have capturing parentheses. Use (?:) instead. + // regexps are ordered -> the first match is used + this.$rules = { + "start" : [ + { + 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 : "invalid.illegal", // single quoted strings are not allowed + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : "invalid.illegal", // comments are not allowed + regex : "\\/\\/.*$" + }, { + token : "paren.lparen", + regex : "[[({]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ] + }; + +}; + +oop.inherits(JsonHighlightRules, TextHighlightRules); + +exports.JsonHighlightRules = JsonHighlightRules; +}); + diff --git a/chrome/content/ace++/res/ace/mode-xml.js b/chrome/content/ace++/res/ace/mode-xml.js index 91c6a5d..fd54c28 100644 --- a/chrome/content/ace++/res/ace/mode-xml.js +++ b/chrome/content/ace++/res/ace/mode-xml.js @@ -1 +1,94 @@ -define("ace/mode/xml",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/xml_highlight_rules","ace/mode/behaviour/xml"],function(a,b,c){var d=a("ace/lib/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/xml_highlight_rules").XmlHighlightRules,h=a("ace/mode/behaviour/xml").XmlBehaviour,i=function(){this.$tokenizer=new f((new g).getRules()),this.$behaviour=new h};d.inherits(i,e),function(){this.getNextLineIndent=function(a,b,c){return this.$getIndent(b)}}.call(i.prototype),b.Mode=i}),define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(a,b,c){var d=a("ace/lib/oop"),e=a("ace/mode/text_highlight_rules").TextHighlightRules,f=function(){this.$rules={start:[{token:"text",regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:"xml_pe",regex:"<\\?.*?\\?>"},{token:"comment",merge:!0,regex:"<\\!--",next:"comment"},{token:"text",regex:"<\\/?",next:"tag"},{token:"text",regex:"\\s+"},{token:"text",regex:"[^<]+"}],tag:[{token:"text",regex:">",next:"start"},{token:"keyword",regex:"[-_a-zA-Z0-9:]+"},{token:"text",regex:"\\s+"},{token:"string",regex:'".*?"'},{token:"string",merge:!0,regex:'["].*$',next:"qqstring"},{token:"string",regex:"'.*?'"},{token:"string",merge:!0,regex:"['].*$",next:"qstring"}],qstring:[{token:"string",regex:".*'",next:"tag"},{token:"string",merge:!0,regex:".+"}],qqstring:[{token:"string",regex:'.*"',next:"tag"},{token:"string",merge:!0,regex:".+"}],cdata:[{token:"text",regex:"\\]\\]>",next:"start"},{token:"text",regex:"\\s+"},{token:"text",regex:"(?:[^\\]]|\\](?!\\]>))+"}],comment:[{token:"comment",regex:".*?-->",next:"start"},{token:"comment",merge:!0,regex:".+"}]}};d.inherits(f,e),b.XmlHighlightRules=f}),define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle"],function(a,b,c){var d=a("ace/lib/oop"),e=a("ace/mode/behaviour").Behaviour,f=a("ace/mode/behaviour/cstyle").CstyleBehaviour,g=function(){this.inherit(f,["string_dquotes"]),this.add("brackets","insertion",function(a,b,c,d,e){if(e=="<"){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);return g!==""?!1:{text:"<>",selection:[1,1]}}if(e==">"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j==">")return{text:"",selection:[1,1]}}else if(e=="\n"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),k=i.substring(h.column,h.column+2);if(k=="f.start.column)break;l+=k[o].value.length}if(!m||n<0&&m.type!=="comment"&&(m.type!=="string"||f.start.column!==m.value.length+l-1&&m.value.lastIndexOf('"')===m.value.length-1))return{text:'""',selection:[1,1]};if(m&&m.type==="string"){var p=i.substring(h.column,h.column+1);if(p=='"')return{text:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=='"'){var g=d.doc.getLine(e.start.row),h=g.substring(e.start.column+1,e.start.column+2);if(h=='"')return e.end.column++,e}})};d.inherits(f,e),b.CstyleBehaviour=f}) \ No newline at end of file +define("ace/mode/xml",[], function(require, exports, module) { + +var oop = require("ace/lib/oop"); +var TextMode = require("ace/mode/text").Mode; +var Tokenizer = require("ace/tokenizer").Tokenizer; +var XmlHighlightRules = require("ace/mode/xml_highlight_rules").XmlHighlightRules; +var XmlBehaviour = require("ace/mode/behaviour/xml").XmlBehaviour; +var XmlFoldMode = require("ace/mode/folding/xml").FoldMode; + +var Mode = function() { + this.$tokenizer = new Tokenizer(new XmlHighlightRules().getRules()); + this.$behaviour = new XmlBehaviour(); + this.foldingRules = new XmlFoldMode(); +}; + +oop.inherits(Mode, TextMode); + +(function() { + + this.getNextLineIndent = function(state, line, tab) { + return this.$getIndent(line); + }; + +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +define("ace/mode/xml_highlight_rules",[], function(require, exports, module) { + +var oop = require("ace/lib/oop"); +var xmlUtil = require("ace/mode/xml_util"); +var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules; + +var XmlHighlightRules = function() { + + // regexp must not have capturing parentheses + // regexps are ordered -> the first match is used + this.$rules = { + start : [{ + token : "text", + regex : "<\\!\\[CDATA\\[", + next : "cdata" + }, { + token : "xml_pe", + regex : "<\\?.*?\\?>" + }, { + token : "comment", + merge : true, + regex : "<\\!--", + next : "comment" + }, { + token : "meta.tag", // opening tag + regex : "<\\/?", + next : "tag" + }, { + token : "text", + regex : "\\s+" + }, { + token : "text", + regex : "[^<]+" + }], + + cdata : [{ + token : "text", + regex : "\\]\\]>", + next : "start" + }, { + token : "text", + regex : "\\s+" + }, { + token : "text", + regex : "(?:[^\\]]|\\](?!\\]>))+" + }], + + comment : [{ + token : "comment", + regex : ".*?-->", + next : "start" + }, { + token : "comment", + merge : true, + regex : ".+" + }] + }; + + xmlUtil.tag(this.$rules, "tag", "start"); +}; + +oop.inherits(XmlHighlightRules, TextHighlightRules); + +exports.XmlHighlightRules = XmlHighlightRules; +}); + diff --git a/chrome/content/ace++/res/ace/theme-clouds.js b/chrome/content/ace++/res/ace/theme-clouds.js index 725c2bc..cbc163f 100644 --- a/chrome/content/ace++/res/ace/theme-clouds.js +++ b/chrome/content/ace++/res/ace/theme-clouds.js @@ -1 +1,115 @@ -define("ace/theme/clouds",["require","exports","module"],function(a,b,c){b.cssClass="ace-clouds",b.cssText=".ace-clouds .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-clouds .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-clouds .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-clouds .ace_gutter-layer { width: 100%; text-align: right;}.ace-clouds .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-clouds .ace_print_margin { width: 1px; background: #e8e8e8;}.ace-clouds .ace_scroller { background-color: #FFFFFF;}.ace-clouds .ace_text-layer { cursor: text; color: #000000;}.ace-clouds .ace_cursor { border-left: 2px solid #000000;}.ace-clouds .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #000000;} .ace-clouds .ace_marker-layer .ace_selection { background: #BDD5FC;}.ace-clouds .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-clouds .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid #BFBFBF;}.ace-clouds .ace_marker-layer .ace_active_line { background: #FFFBD1;} .ace-clouds .ace_invisible { color: #BFBFBF;}.ace-clouds .ace_keyword { color:#AF956F;}.ace-clouds .ace_keyword.ace_operator { color:#484848;}.ace-clouds .ace_constant { }.ace-clouds .ace_constant.ace_language { color:#39946A;}.ace-clouds .ace_constant.ace_library { }.ace-clouds .ace_constant.ace_numeric { color:#46A609;}.ace-clouds .ace_invalid { background-color:#FF002A;}.ace-clouds .ace_invalid.ace_illegal { }.ace-clouds .ace_invalid.ace_deprecated { }.ace-clouds .ace_support { }.ace-clouds .ace_support.ace_function { color:#C52727;}.ace-clouds .ace_function.ace_buildin { }.ace-clouds .ace_string { color:#5D90CD;}.ace-clouds .ace_string.ace_regexp { }.ace-clouds .ace_comment { color:#BCC8BA;}.ace-clouds .ace_comment.ace_doc { }.ace-clouds .ace_comment.ace_doc.ace_tag { }.ace-clouds .ace_variable { }.ace-clouds .ace_variable.ace_language { }.ace-clouds .ace_xml_pe { }.ace-clouds .ace_meta { }.ace-clouds .ace_meta.ace_tag { }.ace-clouds .ace_meta.ace_tag.ace_input { }.ace-clouds .ace_entity.ace_other.ace_attribute-name { color:#606060;}.ace-clouds .ace_entity.ace_name { }.ace-clouds .ace_entity.ace_name.ace_function { }.ace-clouds .ace_markup.ace_underline { text-decoration:underline;}.ace-clouds .ace_markup.ace_heading { }.ace-clouds .ace_markup.ace_heading.ace_1 { }.ace-clouds .ace_markup.ace_heading.ace_2 { }.ace-clouds .ace_markup.ace_heading.ace_3 { }.ace-clouds .ace_markup.ace_heading.ace_4 { }.ace-clouds .ace_markup.ace_heading.ace_5 { }.ace-clouds .ace_markup.ace_heading.ace_6 { }.ace-clouds .ace_markup.ace_list { }.ace-clouds .ace_collab.ace_user1 { }"}) \ No newline at end of file +define("ace/theme/clouds",[], function(require, exports, module) { + +exports.isDark = false; +exports.cssClass = "ace-clouds"; +exports.cssText = "\ +.ace-clouds .ace_editor {\ + border: 2px solid rgb(159, 159, 159);\ +}\ +\ +.ace-clouds .ace_editor.ace_focus {\ + border: 2px solid #327fbd;\ +}\ +\ +.ace-clouds .ace_gutter {\ + background: #e8e8e8;\ + color: #333;\ +}\ +\ +.ace-clouds .ace_print_margin {\ + width: 1px;\ + background: #e8e8e8;\ +}\ +\ +.ace-clouds .ace_scroller {\ + background-color: #FFFFFF;\ +}\ +\ +.ace-clouds .ace_text-layer {\ + cursor: text;\ + color: #000000;\ +}\ +\ +.ace-clouds .ace_cursor {\ + border-left: 2px solid #000000;\ +}\ +\ +.ace-clouds .ace_cursor.ace_overwrite {\ + border-left: 0px;\ + border-bottom: 1px solid #000000;\ +}\ + \ +.ace-clouds .ace_marker-layer .ace_selection {\ + background: #BDD5FC;\ +}\ +\ +.ace-clouds .ace_marker-layer .ace_step {\ + background: rgb(198, 219, 174);\ +}\ +\ +.ace-clouds .ace_marker-layer .ace_bracket {\ + margin: -1px 0 0 -1px;\ + border: 1px solid #BFBFBF;\ +}\ +\ +.ace-clouds .ace_marker-layer .ace_active_line {\ + background: #FFFBD1;\ +}\ +\ +.ace-clouds .ace_marker-layer .ace_selected_word {\ + border: 1px solid #BDD5FC;\ +}\ + \ +.ace-clouds .ace_invisible {\ + color: #BFBFBF;\ +}\ +\ +.ace-clouds .ace_keyword {\ + color:#AF956F;\ +}\ +\ +.ace-clouds .ace_keyword.ace_operator {\ + color:#484848;\ +}\ +\ +.ace-clouds .ace_constant.ace_language {\ + color:#39946A;\ +}\ +\ +.ace-clouds .ace_constant.ace_numeric {\ + color:#46A609;\ +}\ +\ +.ace-clouds .ace_invalid {\ + background-color:#FF002A;\ +}\ +\ +.ace-clouds .ace_fold {\ + background-color: #AF956F;\ + border-color: #000000;\ +}\ +\ +.ace-clouds .ace_support.ace_function {\ + color:#C52727;\ +}\ +\ +.ace-clouds .ace_string {\ + color:#5D90CD;\ +}\ +\ +.ace-clouds .ace_comment {\ + color:#BCC8BA;\ +}\ +\ +.ace-clouds .ace_entity.ace_other.ace_attribute-name {\ + color:#606060;\ +}\ +\ +.ace-clouds .ace_markup.ace_underline {\ + text-decoration:underline;\ +}"; + + var dom = require("ace/lib/dom"); + dom.importCssString(exports.cssText); +}); + diff --git a/chrome/content/ace++/res/ace/theme-clouds_midnight.js b/chrome/content/ace++/res/ace/theme-clouds_midnight.js index cb314df..e73d9f7 100644 --- a/chrome/content/ace++/res/ace/theme-clouds_midnight.js +++ b/chrome/content/ace++/res/ace/theme-clouds_midnight.js @@ -1 +1,116 @@ -define("ace/theme/clouds_midnight",["require","exports","module"],function(a,b,c){b.cssClass="ace-clouds-midnight",b.cssText=".ace-clouds-midnight .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-clouds-midnight .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-clouds-midnight .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-clouds-midnight .ace_gutter-layer { width: 100%; text-align: right;}.ace-clouds-midnight .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-clouds-midnight .ace_print_margin { width: 1px; background: #e8e8e8;}.ace-clouds-midnight .ace_scroller { background-color: #191919;}.ace-clouds-midnight .ace_text-layer { cursor: text; color: #929292;}.ace-clouds-midnight .ace_cursor { border-left: 2px solid #7DA5DC;}.ace-clouds-midnight .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #7DA5DC;} .ace-clouds-midnight .ace_marker-layer .ace_selection { background: #000000;}.ace-clouds-midnight .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-clouds-midnight .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid #BFBFBF;}.ace-clouds-midnight .ace_marker-layer .ace_active_line { background: rgba(215, 215, 215, 0.031);} .ace-clouds-midnight .ace_invisible { color: #BFBFBF;}.ace-clouds-midnight .ace_keyword { color:#927C5D;}.ace-clouds-midnight .ace_keyword.ace_operator { color:#4B4B4B;}.ace-clouds-midnight .ace_constant { }.ace-clouds-midnight .ace_constant.ace_language { color:#39946A;}.ace-clouds-midnight .ace_constant.ace_library { }.ace-clouds-midnight .ace_constant.ace_numeric { color:#46A609;}.ace-clouds-midnight .ace_invalid { color:#FFFFFF;background-color:#E92E2E;}.ace-clouds-midnight .ace_invalid.ace_illegal { }.ace-clouds-midnight .ace_invalid.ace_deprecated { }.ace-clouds-midnight .ace_support { }.ace-clouds-midnight .ace_support.ace_function { color:#E92E2E;}.ace-clouds-midnight .ace_function.ace_buildin { }.ace-clouds-midnight .ace_string { color:#5D90CD;}.ace-clouds-midnight .ace_string.ace_regexp { }.ace-clouds-midnight .ace_comment { color:#3C403B;}.ace-clouds-midnight .ace_comment.ace_doc { }.ace-clouds-midnight .ace_comment.ace_doc.ace_tag { }.ace-clouds-midnight .ace_variable { }.ace-clouds-midnight .ace_variable.ace_language { }.ace-clouds-midnight .ace_xml_pe { }.ace-clouds-midnight .ace_meta { }.ace-clouds-midnight .ace_meta.ace_tag { }.ace-clouds-midnight .ace_meta.ace_tag.ace_input { }.ace-clouds-midnight .ace_entity.ace_other.ace_attribute-name { color:#606060;}.ace-clouds-midnight .ace_entity.ace_name { }.ace-clouds-midnight .ace_entity.ace_name.ace_function { }.ace-clouds-midnight .ace_markup.ace_underline { text-decoration:underline;}.ace-clouds-midnight .ace_markup.ace_heading { }.ace-clouds-midnight .ace_markup.ace_heading.ace_1 { }.ace-clouds-midnight .ace_markup.ace_heading.ace_2 { }.ace-clouds-midnight .ace_markup.ace_heading.ace_3 { }.ace-clouds-midnight .ace_markup.ace_heading.ace_4 { }.ace-clouds-midnight .ace_markup.ace_heading.ace_5 { }.ace-clouds-midnight .ace_markup.ace_heading.ace_6 { }.ace-clouds-midnight .ace_markup.ace_list { }.ace-clouds-midnight .ace_collab.ace_user1 { }"}) \ No newline at end of file +define("ace/theme/clouds_midnight",[], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-clouds-midnight"; +exports.cssText = "\ +.ace-clouds-midnight .ace_editor {\ + border: 2px solid rgb(159, 159, 159);\ +}\ +\ +.ace-clouds-midnight .ace_editor.ace_focus {\ + border: 2px solid #327fbd;\ +}\ +\ +.ace-clouds-midnight .ace_gutter {\ + background: #e8e8e8;\ + color: #333;\ +}\ +\ +.ace-clouds-midnight .ace_print_margin {\ + width: 1px;\ + background: #e8e8e8;\ +}\ +\ +.ace-clouds-midnight .ace_scroller {\ + background-color: #191919;\ +}\ +\ +.ace-clouds-midnight .ace_text-layer {\ + cursor: text;\ + color: #929292;\ +}\ +\ +.ace-clouds-midnight .ace_cursor {\ + border-left: 2px solid #7DA5DC;\ +}\ +\ +.ace-clouds-midnight .ace_cursor.ace_overwrite {\ + border-left: 0px;\ + border-bottom: 1px solid #7DA5DC;\ +}\ + \ +.ace-clouds-midnight .ace_marker-layer .ace_selection {\ + background: #000000;\ +}\ +\ +.ace-clouds-midnight .ace_marker-layer .ace_step {\ + background: rgb(198, 219, 174);\ +}\ +\ +.ace-clouds-midnight .ace_marker-layer .ace_bracket {\ + margin: -1px 0 0 -1px;\ + border: 1px solid #BFBFBF;\ +}\ +\ +.ace-clouds-midnight .ace_marker-layer .ace_active_line {\ + background: rgba(215, 215, 215, 0.031);\ +}\ +\ +.ace-clouds-midnight .ace_marker-layer .ace_selected_word {\ + border: 1px solid #000000;\ +}\ + \ +.ace-clouds-midnight .ace_invisible {\ + color: #BFBFBF;\ +}\ +\ +.ace-clouds-midnight .ace_keyword {\ + color:#927C5D;\ +}\ +\ +.ace-clouds-midnight .ace_keyword.ace_operator {\ + color:#4B4B4B;\ +}\ +\ +.ace-clouds-midnight .ace_constant.ace_language {\ + color:#39946A;\ +}\ +\ +.ace-clouds-midnight .ace_constant.ace_numeric {\ + color:#46A609;\ +}\ +\ +.ace-clouds-midnight .ace_invalid {\ + color:#FFFFFF;\ +background-color:#E92E2E;\ +}\ +\ +.ace-clouds-midnight .ace_fold {\ + background-color: #927C5D;\ + border-color: #929292;\ +}\ +\ +.ace-clouds-midnight .ace_support.ace_function {\ + color:#E92E2E;\ +}\ +\ +.ace-clouds-midnight .ace_string {\ + color:#5D90CD;\ +}\ +\ +.ace-clouds-midnight .ace_comment {\ + color:#3C403B;\ +}\ +\ +.ace-clouds-midnight .ace_entity.ace_other.ace_attribute-name {\ + color:#606060;\ +}\ +\ +.ace-clouds-midnight .ace_markup.ace_underline {\ + text-decoration:underline;\ +}"; + + var dom = require("ace/lib/dom"); + dom.importCssString(exports.cssText); +}); + diff --git a/chrome/content/ace++/res/ace/theme-cobalt.js b/chrome/content/ace++/res/ace/theme-cobalt.js index 4c5dc14..c1020f6 100644 --- a/chrome/content/ace++/res/ace/theme-cobalt.js +++ b/chrome/content/ace++/res/ace/theme-cobalt.js @@ -1 +1,130 @@ -define("ace/theme/cobalt",["require","exports","module"],function(a,b,c){b.cssClass="ace-cobalt",b.cssText=".ace-cobalt .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-cobalt .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-cobalt .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-cobalt .ace_gutter-layer { width: 100%; text-align: right;}.ace-cobalt .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-cobalt .ace_print_margin { width: 1px; background: #e8e8e8;}.ace-cobalt .ace_scroller { background-color: #002240;}.ace-cobalt .ace_text-layer { cursor: text; color: #FFFFFF;}.ace-cobalt .ace_cursor { border-left: 2px solid #FFFFFF;}.ace-cobalt .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #FFFFFF;} .ace-cobalt .ace_marker-layer .ace_selection { background: rgba(179, 101, 57, 0.75);}.ace-cobalt .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-cobalt .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgba(255, 255, 255, 0.15);}.ace-cobalt .ace_marker-layer .ace_active_line { background: rgba(0, 0, 0, 0.35);} .ace-cobalt .ace_invisible { color: rgba(255, 255, 255, 0.15);}.ace-cobalt .ace_keyword { color:#FF9D00;}.ace-cobalt .ace_keyword.ace_operator { }.ace-cobalt .ace_constant { color:#FF628C;}.ace-cobalt .ace_constant.ace_language { }.ace-cobalt .ace_constant.ace_library { }.ace-cobalt .ace_constant.ace_numeric { }.ace-cobalt .ace_invalid { color:#F8F8F8;background-color:#800F00;}.ace-cobalt .ace_invalid.ace_illegal { }.ace-cobalt .ace_invalid.ace_deprecated { }.ace-cobalt .ace_support { color:#80FFBB;}.ace-cobalt .ace_support.ace_function { color:#FFB054;}.ace-cobalt .ace_function.ace_buildin { }.ace-cobalt .ace_string { }.ace-cobalt .ace_string.ace_regexp { color:#80FFC2;}.ace-cobalt .ace_comment { font-style:italic;color:#0088FF;}.ace-cobalt .ace_comment.ace_doc { }.ace-cobalt .ace_comment.ace_doc.ace_tag { }.ace-cobalt .ace_variable { color:#CCCCCC;}.ace-cobalt .ace_variable.ace_language { color:#FF80E1;}.ace-cobalt .ace_xml_pe { }.ace-cobalt .ace_meta { }.ace-cobalt .ace_meta.ace_tag { color:#9EFFFF;}.ace-cobalt .ace_meta.ace_tag.ace_input { }.ace-cobalt .ace_entity.ace_other.ace_attribute-name { }.ace-cobalt .ace_entity.ace_name { }.ace-cobalt .ace_entity.ace_name.ace_function { }.ace-cobalt .ace_markup.ace_underline { text-decoration:underline;}.ace-cobalt .ace_markup.ace_heading { color:#C8E4FD;background-color:#001221;}.ace-cobalt .ace_markup.ace_heading.ace_1 { }.ace-cobalt .ace_markup.ace_heading.ace_2 { }.ace-cobalt .ace_markup.ace_heading.ace_3 { }.ace-cobalt .ace_markup.ace_heading.ace_4 { }.ace-cobalt .ace_markup.ace_heading.ace_5 { }.ace-cobalt .ace_markup.ace_heading.ace_6 { }.ace-cobalt .ace_markup.ace_list { background-color:#130D26;}.ace-cobalt .ace_collab.ace_user1 { }"}) \ No newline at end of file +define("ace/theme/cobalt",[], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-cobalt"; +exports.cssText = "\ +.ace-cobalt .ace_editor {\ + border: 2px solid rgb(159, 159, 159);\ +}\ +\ +.ace-cobalt .ace_editor.ace_focus {\ + border: 2px solid #327fbd;\ +}\ +\ +.ace-cobalt .ace_gutter {\ + background: #e8e8e8;\ + color: #333;\ +}\ +\ +.ace-cobalt .ace_print_margin {\ + width: 1px;\ + background: #e8e8e8;\ +}\ +\ +.ace-cobalt .ace_scroller {\ + background-color: #002240;\ +}\ +\ +.ace-cobalt .ace_text-layer {\ + cursor: text;\ + color: #FFFFFF;\ +}\ +\ +.ace-cobalt .ace_cursor {\ + border-left: 2px solid #FFFFFF;\ +}\ +\ +.ace-cobalt .ace_cursor.ace_overwrite {\ + border-left: 0px;\ + border-bottom: 1px solid #FFFFFF;\ +}\ + \ +.ace-cobalt .ace_marker-layer .ace_selection {\ + background: rgba(179, 101, 57, 0.75);\ +}\ +\ +.ace-cobalt .ace_marker-layer .ace_step {\ + background: rgb(198, 219, 174);\ +}\ +\ +.ace-cobalt .ace_marker-layer .ace_bracket {\ + margin: -1px 0 0 -1px;\ + border: 1px solid rgba(255, 255, 255, 0.15);\ +}\ +\ +.ace-cobalt .ace_marker-layer .ace_active_line {\ + background: rgba(0, 0, 0, 0.35);\ +}\ +\ +.ace-cobalt .ace_marker-layer .ace_selected_word {\ + border: 1px solid rgba(179, 101, 57, 0.75);\ +}\ + \ +.ace-cobalt .ace_invisible {\ + color: rgba(255, 255, 255, 0.15);\ +}\ +\ +.ace-cobalt .ace_keyword {\ + color:#FF9D00;\ +}\ +\ +.ace-cobalt .ace_constant {\ + color:#FF628C;\ +}\ +\ +.ace-cobalt .ace_invalid {\ + color:#F8F8F8;\ +background-color:#800F00;\ +}\ +\ +.ace-cobalt .ace_support {\ + color:#80FFBB;\ +}\ +\ +.ace-cobalt .ace_fold {\ + background-color: #FF9D00;\ + border-color: #FFFFFF;\ +}\ +\ +.ace-cobalt .ace_support.ace_function {\ + color:#FFB054;\ +}\ +\ +.ace-cobalt .ace_string.ace_regexp {\ + color:#80FFC2;\ +}\ +\ +.ace-cobalt .ace_comment {\ + font-style:italic;\ +color:#0088FF;\ +}\ +\ +.ace-cobalt .ace_variable {\ + color:#CCCCCC;\ +}\ +\ +.ace-cobalt .ace_variable.ace_language {\ + color:#FF80E1;\ +}\ +\ +.ace-cobalt .ace_meta.ace_tag {\ + color:#9EFFFF;\ +}\ +\ +.ace-cobalt .ace_markup.ace_underline {\ + text-decoration:underline;\ +}\ +\ +.ace-cobalt .ace_markup.ace_heading {\ + color:#C8E4FD;\ +background-color:#001221;\ +}\ +\ +.ace-cobalt .ace_markup.ace_list {\ + background-color:#130D26;\ +}"; + + var dom = require("ace/lib/dom"); + dom.importCssString(exports.cssText); +}); + diff --git a/chrome/content/ace++/res/ace/theme-crimson_editor.js b/chrome/content/ace++/res/ace/theme-crimson_editor.js index d12c5f3..4ef3a95 100644 --- a/chrome/content/ace++/res/ace/theme-crimson_editor.js +++ b/chrome/content/ace++/res/ace/theme-crimson_editor.js @@ -1 +1,163 @@ -define("ace/theme/crimson_editor",["require","exports","module"],function(a,b,c){b.cssText=".ace-crimson-editor .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-crimson-editor .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-crimson-editor .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-crimson-editor .ace_gutter-layer { width: 100%; text-align: right;}.ace-crimson-editor .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-crimson-editor .ace_print_margin { width: 1px; background: #e8e8e8;}.ace-crimson-editor .ace_text-layer { cursor: text; color: rgb(64, 64, 64);}.ace-crimson-editor .ace_cursor { border-left: 2px solid black;}.ace-crimson-editor .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid black;}.ace-crimson-editor .ace_line .ace_invisible { color: rgb(191, 191, 191);}.ace-crimson-editor .ace_line .ace_identifier { color: black;}.ace-crimson-editor .ace_line .ace_keyword { color: blue;}.ace-crimson-editor .ace_line .ace_constant.ace_buildin { color: rgb(88, 72, 246);}.ace-crimson-editor .ace_line .ace_constant.ace_language { color: rgb(255, 156, 0);}.ace-crimson-editor .ace_line .ace_constant.ace_library { color: rgb(6, 150, 14);}.ace-crimson-editor .ace_line .ace_invalid { text-decoration: line-through; color: rgb(224, 0, 0);}.ace-crimson-editor .ace_line .ace_fold { background-color: #E4E4E4; border-radius: 3px;}.ace-crimson-editor .ace_line .ace_support.ace_function { color: rgb(192, 0, 0);}.ace-crimson-editor .ace_line .ace_support.ace_constant { color: rgb(6, 150, 14);}.ace-crimson-editor .ace_line .ace_support.ace_type,.ace-crimson-editor .ace_line .ace_support.ace_class { color: rgb(109, 121, 222);}.ace-crimson-editor .ace_line .ace_keyword.ace_operator { color: rgb(49, 132, 149);}.ace-crimson-editor .ace_line .ace_string { color: rgb(128, 0, 128);}.ace-crimson-editor .ace_line .ace_comment { color: rgb(76, 136, 107);}.ace-crimson-editor .ace_line .ace_comment.ace_doc { color: rgb(0, 102, 255);}.ace-crimson-editor .ace_line .ace_comment.ace_doc.ace_tag { color: rgb(128, 159, 191);}.ace-crimson-editor .ace_line .ace_constant.ace_numeric { color: rgb(0, 0, 64);}.ace-crimson-editor .ace_line .ace_variable { color: rgb(0, 64, 128);}.ace-crimson-editor .ace_line .ace_xml_pe { color: rgb(104, 104, 91);}.ace-crimson-editor .ace_marker-layer .ace_selection { background: rgb(181, 213, 255);}.ace-crimson-editor .ace_marker-layer .ace_step { background: rgb(252, 255, 0);}.ace-crimson-editor .ace_marker-layer .ace_stack { background: rgb(164, 229, 101);}.ace-crimson-editor .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgb(192, 192, 192);}.ace-crimson-editor .ace_marker-layer .ace_active_line { background: rgb(232, 242, 254);}.ace-crimson-editor .ace_meta.ace_tag { color:rgb(28, 2, 255);}.ace-crimson-editor .ace_marker-layer .ace_selected_word { background: rgb(250, 250, 255); border: 1px solid rgb(200, 200, 250);}.ace-crimson-editor .ace_string.ace_regex { color: rgb(192, 0, 192);}",b.cssClass="ace-crimson-editor"}) \ No newline at end of file +define("ace/theme/crimson_editor",[], function(require, exports, module) { +exports.isDark = false; +exports.cssText = ".ace-crimson-editor .ace_editor {\ + border: 2px solid rgb(159, 159, 159);\ +}\ +\ +.ace-crimson-editor .ace_editor.ace_focus {\ + border: 2px solid #327fbd;\ +}\ +\ +.ace-crimson-editor .ace_gutter {\ + width: 50px;\ + background: #e8e8e8;\ + color: #333;\ + overflow : hidden;\ +}\ +\ +.ace-crimson-editor .ace_gutter-layer {\ + width: 100%;\ + text-align: right;\ +}\ +\ +.ace-crimson-editor .ace_gutter-layer .ace_gutter-cell {\ + padding-right: 6px;\ +}\ +\ +.ace-crimson-editor .ace_print_margin {\ + width: 1px;\ + background: #e8e8e8;\ +}\ +\ +.ace-crimson-editor .ace_text-layer {\ + cursor: text;\ + color: rgb(64, 64, 64);\ +}\ +\ +.ace-crimson-editor .ace_cursor {\ + border-left: 2px solid black;\ +}\ +\ +.ace-crimson-editor .ace_cursor.ace_overwrite {\ + border-left: 0px;\ + border-bottom: 1px solid black;\ +}\ +\ +.ace-crimson-editor .ace_line .ace_invisible {\ + color: rgb(191, 191, 191);\ +}\ +\ +.ace-crimson-editor .ace_line .ace_identifier {\ + color: black;\ +}\ +\ +.ace-crimson-editor .ace_line .ace_keyword {\ + color: blue;\ +}\ +\ +.ace-crimson-editor .ace_line .ace_constant.ace_buildin {\ + color: rgb(88, 72, 246);\ +}\ +\ +.ace-crimson-editor .ace_line .ace_constant.ace_language {\ + color: rgb(255, 156, 0);\ +}\ +\ +.ace-crimson-editor .ace_line .ace_constant.ace_library {\ + color: rgb(6, 150, 14);\ +}\ +\ +.ace-crimson-editor .ace_line .ace_invalid {\ + text-decoration: line-through;\ + color: rgb(224, 0, 0);\ +}\ +\ +.ace-crimson-editor .ace_line .ace_fold {\ +}\ +\ +.ace-crimson-editor .ace_line .ace_support.ace_function {\ + color: rgb(192, 0, 0);\ +}\ +\ +.ace-crimson-editor .ace_line .ace_support.ace_constant {\ + color: rgb(6, 150, 14);\ +}\ +\ +.ace-crimson-editor .ace_line .ace_support.ace_type,\ +.ace-crimson-editor .ace_line .ace_support.ace_class {\ + color: rgb(109, 121, 222);\ +}\ +\ +.ace-crimson-editor .ace_line .ace_keyword.ace_operator {\ + color: rgb(49, 132, 149);\ +}\ +\ +.ace-crimson-editor .ace_line .ace_string {\ + color: rgb(128, 0, 128);\ +}\ +\ +.ace-crimson-editor .ace_line .ace_comment {\ + color: rgb(76, 136, 107);\ +}\ +\ +.ace-crimson-editor .ace_line .ace_comment.ace_doc {\ + color: rgb(0, 102, 255);\ +}\ +\ +.ace-crimson-editor .ace_line .ace_comment.ace_doc.ace_tag {\ + color: rgb(128, 159, 191);\ +}\ +\ +.ace-crimson-editor .ace_line .ace_constant.ace_numeric {\ + color: rgb(0, 0, 64);\ +}\ +\ +.ace-crimson-editor .ace_line .ace_variable {\ + color: rgb(0, 64, 128);\ +}\ +\ +.ace-crimson-editor .ace_line .ace_xml_pe {\ + color: rgb(104, 104, 91);\ +}\ +\ +.ace-crimson-editor .ace_marker-layer .ace_selection {\ + background: rgb(181, 213, 255);\ +}\ +\ +.ace-crimson-editor .ace_marker-layer .ace_step {\ + background: rgb(252, 255, 0);\ +}\ +\ +.ace-crimson-editor .ace_marker-layer .ace_stack {\ + background: rgb(164, 229, 101);\ +}\ +\ +.ace-crimson-editor .ace_marker-layer .ace_bracket {\ + margin: -1px 0 0 -1px;\ + border: 1px solid rgb(192, 192, 192);\ +}\ +\ +.ace-crimson-editor .ace_marker-layer .ace_active_line {\ + background: rgb(232, 242, 254);\ +}\ +\ +.ace-crimson-editor .ace_meta.ace_tag {\ + color:rgb(28, 2, 255);\ +}\ +\ +.ace-crimson-editor .ace_marker-layer .ace_selected_word {\ + background: rgb(250, 250, 255);\ + border: 1px solid rgb(200, 200, 250);\ +}\ +\ +.ace-crimson-editor .ace_string.ace_regex {\ + color: rgb(192, 0, 192);\ +}"; + +exports.cssClass = "ace-crimson-editor"; + + var dom = require("ace/lib/dom"); + dom.importCssString(exports.cssText); + +}); + diff --git a/chrome/content/ace++/res/ace/theme-dawn.js b/chrome/content/ace++/res/ace/theme-dawn.js index e0c14a8..1480158 100644 --- a/chrome/content/ace++/res/ace/theme-dawn.js +++ b/chrome/content/ace++/res/ace/theme-dawn.js @@ -1 +1,133 @@ -define("ace/theme/dawn",["require","exports","module"],function(a,b,c){b.cssText=".ace-dawn .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-dawn .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-dawn .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-dawn .ace_gutter-layer { width: 100%; text-align: right;}.ace-dawn .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-dawn .ace_print_margin { width: 1px; background: #e8e8e8;}.ace-dawn .ace_scroller { background-color: #F9F9F9;}.ace-dawn .ace_text-layer { cursor: text; color: #080808;}.ace-dawn .ace_cursor { border-left: 2px solid #000000;}.ace-dawn .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #000000;} .ace-dawn .ace_marker-layer .ace_selection { background: rgba(39, 95, 255, 0.30);}.ace-dawn .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-dawn .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgba(75, 75, 126, 0.50);}.ace-dawn .ace_marker-layer .ace_active_line { background: rgba(36, 99, 180, 0.12);} .ace-dawn .ace_invisible { color: rgba(75, 75, 126, 0.50);}.ace-dawn .ace_keyword { color:#794938;}.ace-dawn .ace_keyword.ace_operator { }.ace-dawn .ace_constant { color:#811F24;}.ace-dawn .ace_constant.ace_language { }.ace-dawn .ace_constant.ace_library { }.ace-dawn .ace_constant.ace_numeric { }.ace-dawn .ace_invalid { }.ace-dawn .ace_invalid.ace_illegal { text-decoration:underline;font-style:italic;color:#F8F8F8;background-color:#B52A1D;}.ace-dawn .ace_invalid.ace_deprecated { text-decoration:underline;font-style:italic;color:#B52A1D;}.ace-dawn .ace_support { color:#691C97;}.ace-dawn .ace_support.ace_function { color:#693A17;}.ace-dawn .ace_function.ace_buildin { }.ace-dawn .ace_string { color:#0B6125;}.ace-dawn .ace_string.ace_regexp { color:#CF5628;}.ace-dawn .ace_comment { font-style:italic;color:#5A525F;}.ace-dawn .ace_comment.ace_doc { }.ace-dawn .ace_comment.ace_doc.ace_tag { }.ace-dawn .ace_variable { color:#234A97;}.ace-dawn .ace_variable.ace_language { }.ace-dawn .ace_xml_pe { }.ace-dawn .ace_meta { }.ace-dawn .ace_meta.ace_tag { }.ace-dawn .ace_meta.ace_tag.ace_input { }.ace-dawn .ace_entity.ace_other.ace_attribute-name { }.ace-dawn .ace_entity.ace_name { }.ace-dawn .ace_entity.ace_name.ace_function { }.ace-dawn .ace_markup.ace_underline { text-decoration:underline;}.ace-dawn .ace_markup.ace_heading { color:#19356D;}.ace-dawn .ace_markup.ace_heading.ace_1 { }.ace-dawn .ace_markup.ace_heading.ace_2 { }.ace-dawn .ace_markup.ace_heading.ace_3 { }.ace-dawn .ace_markup.ace_heading.ace_4 { }.ace-dawn .ace_markup.ace_heading.ace_5 { }.ace-dawn .ace_markup.ace_heading.ace_6 { }.ace-dawn .ace_markup.ace_list { color:#693A17;}.ace-dawn .ace_collab.ace_user1 { }",b.cssClass="ace-dawn"}) \ No newline at end of file +define("ace/theme/dawn",[], function(require, exports, module) { + +exports.isDark = false; +exports.cssClass = "ace-dawn"; +exports.cssText = "\ +.ace-dawn .ace_editor {\ + border: 2px solid rgb(159, 159, 159);\ +}\ +\ +.ace-dawn .ace_editor.ace_focus {\ + border: 2px solid #327fbd;\ +}\ +\ +.ace-dawn .ace_gutter {\ + background: #e8e8e8;\ + color: #333;\ +}\ +\ +.ace-dawn .ace_print_margin {\ + width: 1px;\ + background: #e8e8e8;\ +}\ +\ +.ace-dawn .ace_scroller {\ + background-color: #F9F9F9;\ +}\ +\ +.ace-dawn .ace_text-layer {\ + cursor: text;\ + color: #080808;\ +}\ +\ +.ace-dawn .ace_cursor {\ + border-left: 2px solid #000000;\ +}\ +\ +.ace-dawn .ace_cursor.ace_overwrite {\ + border-left: 0px;\ + border-bottom: 1px solid #000000;\ +}\ + \ +.ace-dawn .ace_marker-layer .ace_selection {\ + background: rgba(39, 95, 255, 0.30);\ +}\ +\ +.ace-dawn .ace_marker-layer .ace_step {\ + background: rgb(198, 219, 174);\ +}\ +\ +.ace-dawn .ace_marker-layer .ace_bracket {\ + margin: -1px 0 0 -1px;\ + border: 1px solid rgba(75, 75, 126, 0.50);\ +}\ +\ +.ace-dawn .ace_marker-layer .ace_active_line {\ + background: rgba(36, 99, 180, 0.12);\ +}\ +\ +.ace-dawn .ace_marker-layer .ace_selected_word {\ + border: 1px solid rgba(39, 95, 255, 0.30);\ +}\ + \ +.ace-dawn .ace_invisible {\ + color: rgba(75, 75, 126, 0.50);\ +}\ +\ +.ace-dawn .ace_keyword {\ + color:#794938;\ +}\ +\ +.ace-dawn .ace_constant {\ + color:#811F24;\ +}\ +\ +.ace-dawn .ace_invalid.ace_illegal {\ + text-decoration:underline;\ +font-style:italic;\ +color:#F8F8F8;\ +background-color:#B52A1D;\ +}\ +\ +.ace-dawn .ace_invalid.ace_deprecated {\ + text-decoration:underline;\ +font-style:italic;\ +color:#B52A1D;\ +}\ +\ +.ace-dawn .ace_support {\ + color:#691C97;\ +}\ +\ +.ace-dawn .ace_fold {\ + background-color: #794938;\ + border-color: #080808;\ +}\ +\ +.ace-dawn .ace_support.ace_function {\ + color:#693A17;\ +}\ +\ +.ace-dawn .ace_string {\ + color:#0B6125;\ +}\ +\ +.ace-dawn .ace_string.ace_regexp {\ + color:#CF5628;\ +}\ +\ +.ace-dawn .ace_comment {\ + font-style:italic;\ +color:#5A525F;\ +}\ +\ +.ace-dawn .ace_variable {\ + color:#234A97;\ +}\ +\ +.ace-dawn .ace_markup.ace_underline {\ + text-decoration:underline;\ +}\ +\ +.ace-dawn .ace_markup.ace_heading {\ + color:#19356D;\ +}\ +\ +.ace-dawn .ace_markup.ace_list {\ + color:#693A17;\ +}"; + + var dom = require("ace/lib/dom"); + dom.importCssString(exports.cssText); +}); + diff --git a/chrome/content/ace++/res/ace/theme-eclipse.js b/chrome/content/ace++/res/ace/theme-eclipse.js index b284fc3..b0a4ae1 100644 --- a/chrome/content/ace++/res/ace/theme-eclipse.js +++ b/chrome/content/ace++/res/ace/theme-eclipse.js @@ -1 +1,108 @@ -define("ace/theme/eclipse",["require","exports","module"],function(a,b,c){b.cssText=".ace-eclipse .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-eclipse .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-eclipse .ace_gutter { width: 50px; background: rgb(227, 227, 227); border-right: 1px solid rgb(159, 159, 159);\t color: rgb(136, 136, 136);}.ace-eclipse .ace_gutter-layer { width: 100%; text-align: right;}.ace-eclipse .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-eclipse .ace_print_margin { width: 1px; background: #b1b4ba;}.ace-eclipse .ace_text-layer { cursor: text;}.ace-eclipse .ace_cursor { border-left: 1px solid black;}.ace-eclipse .ace_line .ace_keyword, .ace-eclipse .ace_line .ace_variable { color: rgb(127, 0, 85);}.ace-eclipse .ace_line .ace_constant.ace_buildin { color: rgb(88, 72, 246);}.ace-eclipse .ace_line .ace_constant.ace_library { color: rgb(6, 150, 14);}.ace-eclipse .ace_line .ace_function { color: rgb(60, 76, 114);}.ace-eclipse .ace_line .ace_string { color: rgb(42, 0, 255);}.ace-eclipse .ace_line .ace_comment { color: rgb(63, 127, 95);}.ace-eclipse .ace_line .ace_comment.ace_doc { color: rgb(63, 95, 191);}.ace-eclipse .ace_line .ace_comment.ace_doc.ace_tag { color: rgb(127, 159, 191);}.ace-eclipse .ace_line .ace_constant.ace_numeric {}.ace-eclipse .ace_line .ace_tag { color: rgb(63, 127, 127);}.ace-eclipse .ace_line .ace_type { color: rgb(127, 0, 127);}.ace-eclipse .ace_line .ace_xml_pe { color: rgb(104, 104, 91);}.ace-eclipse .ace_marker-layer .ace_selection { background: rgb(181, 213, 255);}.ace-eclipse .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgb(192, 192, 192);}.ace-eclipse .ace_line .ace_meta.ace_tag { color:rgb(63, 127, 127);}.ace-eclipse .ace_entity.ace_other.ace_attribute-name { color:rgb(127, 0, 127);}.ace-eclipse .ace_marker-layer .ace_active_line { background: rgb(232, 242, 254);}",b.cssClass="ace-eclipse"}) \ No newline at end of file +define("ace/theme/eclipse",[], function(require, exports, module) { +exports.isDark = false; +exports.cssText = ".ace-eclipse .ace_editor {\ + border: 2px solid rgb(159, 159, 159);\ +}\ +\ +.ace-eclipse .ace_editor.ace_focus {\ + border: 2px solid #327fbd;\ +}\ +\ +.ace-eclipse .ace_gutter {\ + background: rgb(227, 227, 227);\ + border-right: 1px solid rgb(159, 159, 159);\ + color: rgb(136, 136, 136);\ +}\ +\ +.ace-eclipse .ace_print_margin {\ + width: 1px;\ + background: #b1b4ba;\ +}\ +\ +.ace-eclipse .ace_fold {\ + background-color: rgb(60, 76, 114);\ +}\ +\ +.ace-eclipse .ace_text-layer {\ + cursor: text;\ +}\ +\ +.ace-eclipse .ace_cursor {\ + border-left: 1px solid black;\ +}\ +\ +.ace-eclipse .ace_line .ace_keyword, .ace-eclipse .ace_line .ace_variable {\ + color: rgb(127, 0, 85);\ +}\ +\ +.ace-eclipse .ace_line .ace_constant.ace_buildin {\ + color: rgb(88, 72, 246);\ +}\ +\ +.ace-eclipse .ace_line .ace_constant.ace_library {\ + color: rgb(6, 150, 14);\ +}\ +\ +.ace-eclipse .ace_line .ace_function {\ + color: rgb(60, 76, 114);\ +}\ +\ +.ace-eclipse .ace_line .ace_string {\ + color: rgb(42, 0, 255);\ +}\ +\ +.ace-eclipse .ace_line .ace_comment {\ + color: rgb(63, 127, 95);\ +}\ +\ +.ace-eclipse .ace_line .ace_comment.ace_doc {\ + color: rgb(63, 95, 191);\ +}\ +\ +.ace-eclipse .ace_line .ace_comment.ace_doc.ace_tag {\ + color: rgb(127, 159, 191);\ +}\ +\ +.ace-eclipse .ace_line .ace_constant.ace_numeric {\ +}\ +\ +.ace-eclipse .ace_line .ace_tag {\ + color: rgb(63, 127, 127);\ +}\ +\ +.ace-eclipse .ace_line .ace_type {\ + color: rgb(127, 0, 127);\ +}\ +\ +.ace-eclipse .ace_line .ace_xml_pe {\ + color: rgb(104, 104, 91);\ +}\ +\ +.ace-eclipse .ace_marker-layer .ace_selection {\ + background: rgb(181, 213, 255);\ +}\ +\ +.ace-eclipse .ace_marker-layer .ace_bracket {\ + margin: -1px 0 0 -1px;\ + border: 1px solid rgb(192, 192, 192);\ +}\ +\ +.ace-eclipse .ace_line .ace_meta.ace_tag {\ + color:rgb(63, 127, 127);\ +}\ +\ +.ace-eclipse .ace_entity.ace_other.ace_attribute-name {\ + color:rgb(127, 0, 127);\ +}\ +\ +.ace-eclipse .ace_marker-layer .ace_active_line {\ + background: rgb(232, 242, 254);\ +}"; + +exports.cssClass = "ace-eclipse"; + + var dom = require("ace/lib/dom"); + dom.importCssString(exports.cssText); + +}); + diff --git a/chrome/content/ace++/res/ace/theme-idle_fingers.js b/chrome/content/ace++/res/ace/theme-idle_fingers.js index b106b7d..8ada9de 100644 --- a/chrome/content/ace++/res/ace/theme-idle_fingers.js +++ b/chrome/content/ace++/res/ace/theme-idle_fingers.js @@ -1 +1,122 @@ -define("ace/theme/idle_fingers",["require","exports","module"],function(a,b,c){b.cssText=".ace-idle-fingers .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-idle-fingers .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-idle-fingers .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-idle-fingers .ace_gutter-layer { width: 100%; text-align: right;}.ace-idle-fingers .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-idle-fingers .ace_print_margin { width: 1px; background: #e8e8e8;}.ace-idle-fingers .ace_scroller { background-color: #323232;}.ace-idle-fingers .ace_text-layer { cursor: text; color: #FFFFFF;}.ace-idle-fingers .ace_cursor { border-left: 2px solid #91FF00;}.ace-idle-fingers .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #91FF00;} .ace-idle-fingers .ace_marker-layer .ace_selection { background: rgba(90, 100, 126, 0.88);}.ace-idle-fingers .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-idle-fingers .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid #404040;}.ace-idle-fingers .ace_marker-layer .ace_active_line { background: #353637;} .ace-idle-fingers .ace_invisible { color: #404040;}.ace-idle-fingers .ace_keyword { color:#CC7833;}.ace-idle-fingers .ace_keyword.ace_operator { }.ace-idle-fingers .ace_constant { color:#6C99BB;}.ace-idle-fingers .ace_constant.ace_language { }.ace-idle-fingers .ace_constant.ace_library { }.ace-idle-fingers .ace_constant.ace_numeric { }.ace-idle-fingers .ace_invalid { color:#FFFFFF;background-color:#FF0000;}.ace-idle-fingers .ace_invalid.ace_illegal { }.ace-idle-fingers .ace_invalid.ace_deprecated { }.ace-idle-fingers .ace_support { }.ace-idle-fingers .ace_support.ace_function { color:#B83426;}.ace-idle-fingers .ace_function.ace_buildin { }.ace-idle-fingers .ace_string { color:#A5C261;}.ace-idle-fingers .ace_string.ace_regexp { color:#CCCC33;}.ace-idle-fingers .ace_comment { font-style:italic;color:#BC9458;}.ace-idle-fingers .ace_comment.ace_doc { }.ace-idle-fingers .ace_comment.ace_doc.ace_tag { }.ace-idle-fingers .ace_variable { }.ace-idle-fingers .ace_variable.ace_language { }.ace-idle-fingers .ace_xml_pe { }.ace-idle-fingers .ace_meta { }.ace-idle-fingers .ace_meta.ace_tag { color:#FFE5BB;}.ace-idle-fingers .ace_meta.ace_tag.ace_input { }.ace-idle-fingers .ace_entity.ace_other.ace_attribute-name { }.ace-idle-fingers .ace_entity.ace_name { color:#FFC66D;}.ace-idle-fingers .ace_entity.ace_name.ace_function { }.ace-idle-fingers .ace_markup.ace_underline { text-decoration:underline;}.ace-idle-fingers .ace_markup.ace_heading { }.ace-idle-fingers .ace_markup.ace_heading.ace_1 { }.ace-idle-fingers .ace_markup.ace_heading.ace_2 { }.ace-idle-fingers .ace_markup.ace_heading.ace_3 { }.ace-idle-fingers .ace_markup.ace_heading.ace_4 { }.ace-idle-fingers .ace_markup.ace_heading.ace_5 { }.ace-idle-fingers .ace_markup.ace_heading.ace_6 { }.ace-idle-fingers .ace_markup.ace_list { }.ace-idle-fingers .ace_collab.ace_user1 { color:#323232;background-color:#FFF980; }",b.cssClass="ace-idle-fingers"}) \ No newline at end of file +define("ace/theme/idle_fingers",[], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-idle-fingers"; +exports.cssText = "\ +.ace-idle-fingers .ace_editor {\ + border: 2px solid rgb(159, 159, 159);\ +}\ +\ +.ace-idle-fingers .ace_editor.ace_focus {\ + border: 2px solid #327fbd;\ +}\ +\ +.ace-idle-fingers .ace_gutter {\ + background: #e8e8e8;\ + color: #333;\ +}\ +\ +.ace-idle-fingers .ace_print_margin {\ + width: 1px;\ + background: #e8e8e8;\ +}\ +\ +.ace-idle-fingers .ace_scroller {\ + background-color: #323232;\ +}\ +\ +.ace-idle-fingers .ace_text-layer {\ + cursor: text;\ + color: #FFFFFF;\ +}\ +\ +.ace-idle-fingers .ace_cursor {\ + border-left: 2px solid #91FF00;\ +}\ +\ +.ace-idle-fingers .ace_cursor.ace_overwrite {\ + border-left: 0px;\ + border-bottom: 1px solid #91FF00;\ +}\ + \ +.ace-idle-fingers .ace_marker-layer .ace_selection {\ + background: rgba(90, 100, 126, 0.88);\ +}\ +\ +.ace-idle-fingers .ace_marker-layer .ace_step {\ + background: rgb(198, 219, 174);\ +}\ +\ +.ace-idle-fingers .ace_marker-layer .ace_bracket {\ + margin: -1px 0 0 -1px;\ + border: 1px solid #404040;\ +}\ +\ +.ace-idle-fingers .ace_marker-layer .ace_active_line {\ + background: #353637;\ +}\ +\ +.ace-idle-fingers .ace_marker-layer .ace_selected_word {\ + border: 1px solid rgba(90, 100, 126, 0.88);\ +}\ + \ +.ace-idle-fingers .ace_invisible {\ + color: #404040;\ +}\ +\ +.ace-idle-fingers .ace_keyword {\ + color:#CC7833;\ +}\ +\ +.ace-idle-fingers .ace_constant {\ + color:#6C99BB;\ +}\ +\ +.ace-idle-fingers .ace_invalid {\ + color:#FFFFFF;\ +background-color:#FF0000;\ +}\ +\ +.ace-idle-fingers .ace_fold {\ + background-color: #CC7833;\ + border-color: #FFFFFF;\ +}\ +\ +.ace-idle-fingers .ace_support.ace_function {\ + color:#B83426;\ +}\ +\ +.ace-idle-fingers .ace_string {\ + color:#A5C261;\ +}\ +\ +.ace-idle-fingers .ace_string.ace_regexp {\ + color:#CCCC33;\ +}\ +\ +.ace-idle-fingers .ace_comment {\ + font-style:italic;\ +color:#BC9458;\ +}\ +\ +.ace-idle-fingers .ace_meta.ace_tag {\ + color:#FFE5BB;\ +}\ +\ +.ace-idle-fingers .ace_entity.ace_name {\ + color:#FFC66D;\ +}\ +\ +.ace-idle-fingers .ace_markup.ace_underline {\ + text-decoration:underline;\ +}\ +\ +.ace-idle-fingers .ace_collab.ace_user1 {\ + color:#323232;\ +background-color:#FFF980; \ +}"; + + var dom = require("ace/lib/dom"); + dom.importCssString(exports.cssText); +}); + diff --git a/chrome/content/ace++/res/ace/theme-kr_theme.js b/chrome/content/ace++/res/ace/theme-kr_theme.js index e48346f..37bfbb2 100644 --- a/chrome/content/ace++/res/ace/theme-kr_theme.js +++ b/chrome/content/ace++/res/ace/theme-kr_theme.js @@ -1 +1,125 @@ -define("ace/theme/kr_theme",["require","exports","module"],function(a,b,c){b.cssText=".ace-kr-theme .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-kr-theme .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-kr-theme .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-kr-theme .ace_gutter-layer { width: 100%; text-align: right;}.ace-kr-theme .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-kr-theme .ace_print_margin { width: 1px; background: #e8e8e8;}.ace-kr-theme .ace_scroller { background-color: #0B0A09;}.ace-kr-theme .ace_text-layer { cursor: text; color: #FCFFE0;}.ace-kr-theme .ace_cursor { border-left: 2px solid #FF9900;}.ace-kr-theme .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #FF9900;} .ace-kr-theme .ace_marker-layer .ace_selection { background: rgba(170, 0, 255, 0.45);}.ace-kr-theme .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-kr-theme .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgba(255, 177, 111, 0.32);}.ace-kr-theme .ace_marker-layer .ace_active_line { background: #38403D;} .ace-kr-theme .ace_invisible { color: rgba(255, 177, 111, 0.32);}.ace-kr-theme .ace_keyword { color:#949C8B;}.ace-kr-theme .ace_keyword.ace_operator { }.ace-kr-theme .ace_constant { color:rgba(210, 117, 24, 0.76);}.ace-kr-theme .ace_constant.ace_language { }.ace-kr-theme .ace_constant.ace_library { }.ace-kr-theme .ace_constant.ace_numeric { }.ace-kr-theme .ace_invalid { color:#F8F8F8;background-color:#A41300;}.ace-kr-theme .ace_invalid.ace_illegal { }.ace-kr-theme .ace_invalid.ace_deprecated { }.ace-kr-theme .ace_support { color:#9FC28A;}.ace-kr-theme .ace_support.ace_function { color:#85873A;}.ace-kr-theme .ace_function.ace_buildin { }.ace-kr-theme .ace_string { }.ace-kr-theme .ace_string.ace_regexp { color:rgba(125, 255, 192, 0.65);}.ace-kr-theme .ace_comment { font-style:italic;color:#706D5B;}.ace-kr-theme .ace_comment.ace_doc { }.ace-kr-theme .ace_comment.ace_doc.ace_tag { }.ace-kr-theme .ace_variable { color:#D1A796;}.ace-kr-theme .ace_variable.ace_language { color:#FF80E1;}.ace-kr-theme .ace_xml_pe { }.ace-kr-theme .ace_meta { }.ace-kr-theme .ace_meta.ace_tag { color:#BABD9C;}.ace-kr-theme .ace_meta.ace_tag.ace_input { }.ace-kr-theme .ace_entity.ace_other.ace_attribute-name { }.ace-kr-theme .ace_entity.ace_name { }.ace-kr-theme .ace_entity.ace_name.ace_function { }.ace-kr-theme .ace_markup.ace_underline { text-decoration:underline;}.ace-kr-theme .ace_markup.ace_heading { }.ace-kr-theme .ace_markup.ace_heading.ace_1 { }.ace-kr-theme .ace_markup.ace_heading.ace_2 { }.ace-kr-theme .ace_markup.ace_heading.ace_3 { }.ace-kr-theme .ace_markup.ace_heading.ace_4 { }.ace-kr-theme .ace_markup.ace_heading.ace_5 { }.ace-kr-theme .ace_markup.ace_heading.ace_6 { }.ace-kr-theme .ace_markup.ace_list { background-color:#0F0040;}.ace-kr-theme .ace_collab.ace_user1 { }",b.cssClass="ace-kr-theme"}) \ No newline at end of file +define("ace/theme/kr_theme",[], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-kr-theme"; +exports.cssText = "\ +.ace-kr-theme .ace_editor {\ + border: 2px solid rgb(159, 159, 159);\ +}\ +\ +.ace-kr-theme .ace_editor.ace_focus {\ + border: 2px solid #327fbd;\ +}\ +\ +.ace-kr-theme .ace_gutter {\ + background: #e8e8e8;\ + color: #333;\ +}\ +\ +.ace-kr-theme .ace_print_margin {\ + width: 1px;\ + background: #e8e8e8;\ +}\ +\ +.ace-kr-theme .ace_scroller {\ + background-color: #0B0A09;\ +}\ +\ +.ace-kr-theme .ace_text-layer {\ + cursor: text;\ + color: #FCFFE0;\ +}\ +\ +.ace-kr-theme .ace_cursor {\ + border-left: 2px solid #FF9900;\ +}\ +\ +.ace-kr-theme .ace_cursor.ace_overwrite {\ + border-left: 0px;\ + border-bottom: 1px solid #FF9900;\ +}\ + \ +.ace-kr-theme .ace_marker-layer .ace_selection {\ + background: rgba(170, 0, 255, 0.45);\ +}\ +\ +.ace-kr-theme .ace_marker-layer .ace_step {\ + background: rgb(198, 219, 174);\ +}\ +\ +.ace-kr-theme .ace_marker-layer .ace_bracket {\ + margin: -1px 0 0 -1px;\ + border: 1px solid rgba(255, 177, 111, 0.32);\ +}\ +\ +.ace-kr-theme .ace_marker-layer .ace_active_line {\ + background: #38403D;\ +}\ +\ +.ace-kr-theme .ace_marker-layer .ace_selected_word {\ + border: 1px solid rgba(170, 0, 255, 0.45);\ +}\ + \ +.ace-kr-theme .ace_invisible {\ + color: rgba(255, 177, 111, 0.32);\ +}\ +\ +.ace-kr-theme .ace_keyword {\ + color:#949C8B;\ +}\ +\ +.ace-kr-theme .ace_constant {\ + color:rgba(210, 117, 24, 0.76);\ +}\ +\ +.ace-kr-theme .ace_invalid {\ + color:#F8F8F8;\ +background-color:#A41300;\ +}\ +\ +.ace-kr-theme .ace_support {\ + color:#9FC28A;\ +}\ +\ +.ace-kr-theme .ace_fold {\ + background-color: #949C8B;\ + border-color: #FCFFE0;\ +}\ +\ +.ace-kr-theme .ace_support.ace_function {\ + color:#85873A;\ +}\ +\ +.ace-kr-theme .ace_string.ace_regexp {\ + color:rgba(125, 255, 192, 0.65);\ +}\ +\ +.ace-kr-theme .ace_comment {\ + font-style:italic;\ +color:#706D5B;\ +}\ +\ +.ace-kr-theme .ace_variable {\ + color:#D1A796;\ +}\ +\ +.ace-kr-theme .ace_variable.ace_language {\ + color:#FF80E1;\ +}\ +\ +.ace-kr-theme .ace_meta.ace_tag {\ + color:#BABD9C;\ +}\ +\ +.ace-kr-theme .ace_markup.ace_underline {\ + text-decoration:underline;\ +}\ +\ +.ace-kr-theme .ace_markup.ace_list {\ + background-color:#0F0040;\ +}"; + + var dom = require("ace/lib/dom"); + dom.importCssString(exports.cssText); +}); + diff --git a/chrome/content/ace++/res/ace/theme-merbivore.js b/chrome/content/ace++/res/ace/theme-merbivore.js index e9e8429..7ee92df 100644 --- a/chrome/content/ace++/res/ace/theme-merbivore.js +++ b/chrome/content/ace++/res/ace/theme-merbivore.js @@ -1 +1,125 @@ -define("ace/theme/merbivore",["require","exports","module"],function(a,b,c){b.cssText=".ace-merbivore .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-merbivore .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-merbivore .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-merbivore .ace_gutter-layer { width: 100%; text-align: right;}.ace-merbivore .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-merbivore .ace_print_margin { width: 1px; background: #e8e8e8;}.ace-merbivore .ace_scroller { background-color: #161616;}.ace-merbivore .ace_text-layer { cursor: text; color: #E6E1DC;}.ace-merbivore .ace_cursor { border-left: 2px solid #FFFFFF;}.ace-merbivore .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #FFFFFF;} .ace-merbivore .ace_marker-layer .ace_selection { background: #454545;}.ace-merbivore .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-merbivore .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid #FCE94F;}.ace-merbivore .ace_marker-layer .ace_active_line { background: #333435;} .ace-merbivore .ace_invisible { color: #404040;}.ace-merbivore .ace_keyword { color:#FC6F09;}.ace-merbivore .ace_keyword.ace_operator { }.ace-merbivore .ace_constant { color:#1EDAFB;}.ace-merbivore .ace_constant.ace_language { color:#FDC251;}.ace-merbivore .ace_constant.ace_library { color:#8DFF0A;}.ace-merbivore .ace_constant.ace_numeric { color:#58C554;}.ace-merbivore .ace_invalid { color:#FFFFFF;background-color:#990000;}.ace-merbivore .ace_invalid.ace_illegal { }.ace-merbivore .ace_invalid.ace_deprecated { color:#FFFFFF; background-color:#990000;}.ace-merbivore .ace_support { }.ace-merbivore .ace_support.ace_function { color:#FC6F09;}.ace-merbivore .ace_function.ace_buildin { }.ace-merbivore .ace_string { color:#8DFF0A;}.ace-merbivore .ace_string.ace_regexp { }.ace-merbivore .ace_comment { color:#AD2EA4;}.ace-merbivore .ace_comment.ace_doc { }.ace-merbivore .ace_comment.ace_doc.ace_tag { }.ace-merbivore .ace_variable { }.ace-merbivore .ace_variable.ace_language { }.ace-merbivore .ace_xml_pe { }.ace-merbivore .ace_meta { }.ace-merbivore .ace_meta.ace_tag { color:#FC6F09;}.ace-merbivore .ace_meta.ace_tag.ace_input { }.ace-merbivore .ace_entity.ace_other.ace_attribute-name { color:#FFFF89;}.ace-merbivore .ace_markup.ace_underline { text-decoration:underline;}.ace-merbivore .ace_markup.ace_heading { }.ace-merbivore .ace_markup.ace_heading.ace_1 { }.ace-merbivore .ace_markup.ace_heading.ace_2 { }.ace-merbivore .ace_markup.ace_heading.ace_3 { }.ace-merbivore .ace_markup.ace_heading.ace_4 { }.ace-merbivore .ace_markup.ace_heading.ace_5 { }.ace-merbivore .ace_markup.ace_heading.ace_6 { }.ace-merbivore .ace_markup.ace_list { }.ace-merbivore .ace_collab.ace_user1 { }",b.cssClass="ace-merbivore"}) \ No newline at end of file +define("ace/theme/merbivore",[], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-merbivore"; +exports.cssText = "\ +.ace-merbivore .ace_editor {\ + border: 2px solid rgb(159, 159, 159);\ +}\ +\ +.ace-merbivore .ace_editor.ace_focus {\ + border: 2px solid #327fbd;\ +}\ +\ +.ace-merbivore .ace_gutter {\ + background: #e8e8e8;\ + color: #333;\ +}\ +\ +.ace-merbivore .ace_print_margin {\ + width: 1px;\ + background: #e8e8e8;\ +}\ +\ +.ace-merbivore .ace_scroller {\ + background-color: #161616;\ +}\ +\ +.ace-merbivore .ace_text-layer {\ + cursor: text;\ + color: #E6E1DC;\ +}\ +\ +.ace-merbivore .ace_cursor {\ + border-left: 2px solid #FFFFFF;\ +}\ +\ +.ace-merbivore .ace_cursor.ace_overwrite {\ + border-left: 0px;\ + border-bottom: 1px solid #FFFFFF;\ +}\ + \ +.ace-merbivore .ace_marker-layer .ace_selection {\ + background: #454545;\ +}\ +\ +.ace-merbivore .ace_marker-layer .ace_step {\ + background: rgb(198, 219, 174);\ +}\ +\ +.ace-merbivore .ace_marker-layer .ace_bracket {\ + margin: -1px 0 0 -1px;\ + border: 1px solid #404040;\ +}\ +\ +.ace-merbivore .ace_marker-layer .ace_active_line {\ + background: #333435;\ +}\ +\ +.ace-merbivore .ace_marker-layer .ace_selected_word {\ + border: 1px solid #454545;\ +}\ + \ +.ace-merbivore .ace_invisible {\ + color: #404040;\ +}\ +\ +.ace-merbivore .ace_keyword {\ + color:#FC6F09;\ +}\ +\ +.ace-merbivore .ace_constant {\ + color:#1EDAFB;\ +}\ +\ +.ace-merbivore .ace_constant.ace_language {\ + color:#FDC251;\ +}\ +\ +.ace-merbivore .ace_constant.ace_library {\ + color:#8DFF0A;\ +}\ +\ +.ace-merbivore .ace_constant.ace_numeric {\ + color:#58C554;\ +}\ +\ +.ace-merbivore .ace_invalid {\ + color:#FFFFFF;\ +background-color:#990000;\ +}\ +\ +.ace-merbivore .ace_fold {\ + background-color: #FC6F09;\ + border-color: #E6E1DC;\ +}\ +\ +.ace-merbivore .ace_support.ace_function {\ + color:#FC6F09;\ +}\ +\ +.ace-merbivore .ace_string {\ + color:#8DFF0A;\ +}\ +\ +.ace-merbivore .ace_comment {\ + font-style:italic;\ +color:#AD2EA4;\ +}\ +\ +.ace-merbivore .ace_meta.ace_tag {\ + color:#FC6F09;\ +}\ +\ +.ace-merbivore .ace_entity.ace_other.ace_attribute-name {\ + color:#FFFF89;\ +}\ +\ +.ace-merbivore .ace_markup.ace_underline {\ + text-decoration:underline;\ +}"; + + var dom = require("ace/lib/dom"); + dom.importCssString(exports.cssText); +}); + diff --git a/chrome/content/ace++/res/ace/theme-merbivore_soft.js b/chrome/content/ace++/res/ace/theme-merbivore_soft.js index bb03e4c..081f71b 100644 --- a/chrome/content/ace++/res/ace/theme-merbivore_soft.js +++ b/chrome/content/ace++/res/ace/theme-merbivore_soft.js @@ -1 +1,131 @@ -define("ace/theme/merbivore_soft",["require","exports","module"],function(a,b,c){b.cssText=".ace-merbivore-soft .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-merbivore-soft .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-merbivore-soft .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-merbivore-soft .ace_gutter-layer { width: 100%; text-align: right;}.ace-merbivore-soft .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-merbivore-soft .ace_print_margin { width: 1px; background: #e8e8e8;}.ace-merbivore-soft .ace_scroller { background-color: #1C1C1C;}.ace-merbivore-soft .ace_text-layer { cursor: text; color: #E6E1DC;}.ace-merbivore-soft .ace_cursor { border-left: 2px solid #FFFFFF;}.ace-merbivore-soft .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #FFFFFF;} .ace-merbivore-soft .ace_marker-layer .ace_selection { background: #494949;}.ace-merbivore-soft .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-merbivore-soft .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid #FCE94F;}.ace-merbivore-soft .ace_marker-layer .ace_active_line { background: #333435;} .ace-merbivore-soft .ace_invisible { color: #404040;}.ace-merbivore-soft .ace_keyword { color:#FC803A;}.ace-merbivore-soft .ace_keyword.ace_operator { }.ace-merbivore-soft .ace_constant { color:#68C1D8;}.ace-merbivore-soft .ace_constant.ace_language { color:#E1C582;}.ace-merbivore-soft .ace_constant.ace_library { color:#8EC65F;}.ace-merbivore-soft .ace_constant.ace_numeric { color:#7FC578;}.ace-merbivore-soft .ace_invalid { color:#FFFFFF;background-color:#FE3838;}.ace-merbivore-soft .ace_invalid.ace_illegal { }.ace-merbivore-soft .ace_invalid.ace_deprecated { color:#FFFFFF; background-color:#FE3838;}.ace-merbivore-soft .ace_support { }.ace-merbivore-soft .ace_support.ace_function { color:#FC803A;}.ace-merbivore-soft .ace_function.ace_buildin { }.ace-merbivore-soft .ace_string { color:#8EC65F;}.ace-merbivore-soft .ace_string.ace_regexp { }.ace-merbivore-soft .ace_comment { color:#AC4BB8;}.ace-merbivore-soft .ace_comment.ace_doc { }.ace-merbivore-soft .ace_comment.ace_doc.ace_tag { }.ace-merbivore-soft .ace_variable { }.ace-merbivore-soft .ace_variable.ace_language { }.ace-merbivore-soft .ace_xml_pe { }.ace-merbivore-soft .ace_meta { }.ace-merbivore-soft .ace_meta.ace_tag { color:#FC803A;}.ace-merbivore-soft .ace_meta.ace_tag.ace_input { }.ace-merbivore-soft .ace_entity.ace_other.ace_attribute-name { color:#EAF1A3;}.ace-merbivore-soft .ace_markup.ace_underline { text-decoration:underline;}.ace-merbivore-soft .ace_markup.ace_heading { }.ace-merbivore-soft .ace_markup.ace_heading.ace_1 { }.ace-merbivore-soft .ace_markup.ace_heading.ace_2 { }.ace-merbivore-soft .ace_markup.ace_heading.ace_3 { }.ace-merbivore-soft .ace_markup.ace_heading.ace_4 { }.ace-merbivore-soft .ace_markup.ace_heading.ace_5 { }.ace-merbivore-soft .ace_markup.ace_heading.ace_6 { }.ace-merbivore-soft .ace_markup.ace_list { }.ace-merbivore-soft .ace_collab.ace_user1 { }",b.cssClass="ace-merbivore-soft"}) \ No newline at end of file +define("ace/theme/merbivore_soft",[], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-merbivore-soft"; +exports.cssText = "\ +.ace-merbivore-soft .ace_editor {\ + border: 2px solid rgb(159, 159, 159);\ +}\ +\ +.ace-merbivore-soft .ace_editor.ace_focus {\ + border: 2px solid #327fbd;\ +}\ +\ +.ace-merbivore-soft .ace_gutter {\ + background: #e8e8e8;\ + color: #333;\ +}\ +\ +.ace-merbivore-soft .ace_print_margin {\ + width: 1px;\ + background: #e8e8e8;\ +}\ +\ +.ace-merbivore-soft .ace_scroller {\ + background-color: #1C1C1C;\ +}\ +\ +.ace-merbivore-soft .ace_text-layer {\ + cursor: text;\ + color: #E6E1DC;\ +}\ +\ +.ace-merbivore-soft .ace_cursor {\ + border-left: 2px solid #FFFFFF;\ +}\ +\ +.ace-merbivore-soft .ace_cursor.ace_overwrite {\ + border-left: 0px;\ + border-bottom: 1px solid #FFFFFF;\ +}\ + \ +.ace-merbivore-soft .ace_marker-layer .ace_selection {\ + background: #494949;\ +}\ +\ +.ace-merbivore-soft .ace_marker-layer .ace_step {\ + background: rgb(198, 219, 174);\ +}\ +\ +.ace-merbivore-soft .ace_marker-layer .ace_bracket {\ + margin: -1px 0 0 -1px;\ + border: 1px solid #404040;\ +}\ +\ +.ace-merbivore-soft .ace_marker-layer .ace_active_line {\ + background: #333435;\ +}\ +\ +.ace-merbivore-soft .ace_marker-layer .ace_selected_word {\ + border: 1px solid #494949;\ +}\ + \ +.ace-merbivore-soft .ace_invisible {\ + color: #404040;\ +}\ +\ +.ace-merbivore-soft .ace_keyword {\ + color:#FC803A;\ +}\ +\ +.ace-merbivore-soft .ace_constant {\ + color:#68C1D8;\ +}\ +\ +.ace-merbivore-soft .ace_constant.ace_language {\ + color:#E1C582;\ +}\ +\ +.ace-merbivore-soft .ace_constant.ace_library {\ + color:#8EC65F;\ +}\ +\ +.ace-merbivore-soft .ace_constant.ace_numeric {\ + color:#7FC578;\ +}\ +\ +.ace-merbivore-soft .ace_invalid {\ + color:#FFFFFF;\ +background-color:#FE3838;\ +}\ +\ +.ace-merbivore-soft .ace_invalid.ace_deprecated {\ + color:#FFFFFF;\ +background-color:#FE3838;\ +}\ +\ +.ace-merbivore-soft .ace_fold {\ + background-color: #FC803A;\ + border-color: #E6E1DC;\ +}\ +\ +.ace-merbivore-soft .ace_string {\ + color:#8EC65F;\ +}\ +\ +.ace-merbivore-soft .ace_comment {\ + font-style:italic;\ +color:#AC4BB8;\ +}\ +\ +.ace-merbivore-soft .ace_meta {\ + font-style:italic;\ +color:#AC4BB8;\ +}\ +\ +.ace-merbivore-soft .ace_meta.ace_tag {\ + color:#FC803A;\ +}\ +\ +.ace-merbivore-soft .ace_entity.ace_other.ace_attribute-name {\ + color:#EAF1A3;\ +}\ +\ +.ace-merbivore-soft .ace_markup.ace_underline {\ + text-decoration:underline;\ +}"; + + var dom = require("ace/lib/dom"); + dom.importCssString(exports.cssText); +}); + diff --git a/chrome/content/ace++/res/ace/theme-mono_industrial.js b/chrome/content/ace++/res/ace/theme-mono_industrial.js index c9a245e..5575e7e 100644 --- a/chrome/content/ace++/res/ace/theme-mono_industrial.js +++ b/chrome/content/ace++/res/ace/theme-mono_industrial.js @@ -1 +1,125 @@ -define("ace/theme/mono_industrial",["require","exports","module"],function(a,b,c){b.cssText=".ace-mono-industrial .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-mono-industrial .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-mono-industrial .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-mono-industrial .ace_gutter-layer { width: 100%; text-align: right;}.ace-mono-industrial .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-mono-industrial .ace_print_margin { width: 1px; background: #e8e8e8;}.ace-mono-industrial .ace_scroller { background-color: #222C28;}.ace-mono-industrial .ace_text-layer { cursor: text; color: #FFFFFF;}.ace-mono-industrial .ace_cursor { border-left: 2px solid #FFFFFF;}.ace-mono-industrial .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #FFFFFF;} .ace-mono-industrial .ace_marker-layer .ace_selection { background: rgba(145, 153, 148, 0.40);}.ace-mono-industrial .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-mono-industrial .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgba(102, 108, 104, 0.50);}.ace-mono-industrial .ace_marker-layer .ace_active_line { background: rgba(12, 13, 12, 0.25);} .ace-mono-industrial .ace_invisible { color: rgba(102, 108, 104, 0.50);}.ace-mono-industrial .ace_keyword { color:#A39E64;}.ace-mono-industrial .ace_keyword.ace_operator { color:#A8B3AB;}.ace-mono-industrial .ace_constant { color:#E98800;}.ace-mono-industrial .ace_constant.ace_language { }.ace-mono-industrial .ace_constant.ace_library { }.ace-mono-industrial .ace_constant.ace_numeric { color:#E98800;}.ace-mono-industrial .ace_invalid { color:#FFFFFF;background-color:rgba(153, 0, 0, 0.68);}.ace-mono-industrial .ace_invalid.ace_illegal { }.ace-mono-industrial .ace_invalid.ace_deprecated { }.ace-mono-industrial .ace_support { }.ace-mono-industrial .ace_support.ace_function { color:#588E60;}.ace-mono-industrial .ace_function.ace_buildin { }.ace-mono-industrial .ace_string { }.ace-mono-industrial .ace_string.ace_regexp { }.ace-mono-industrial .ace_comment { color:#666C68;background-color:#151C19;}.ace-mono-industrial .ace_comment.ace_doc { }.ace-mono-industrial .ace_comment.ace_doc.ace_tag { }.ace-mono-industrial .ace_variable { }.ace-mono-industrial .ace_variable.ace_language { color:#648BD2;}.ace-mono-industrial .ace_xml_pe { }.ace-mono-industrial .ace_meta { }.ace-mono-industrial .ace_meta.ace_tag { }.ace-mono-industrial .ace_meta.ace_tag.ace_input { }.ace-mono-industrial .ace_entity.ace_other.ace_attribute-name { color:#909993;}.ace-mono-industrial .ace_entity.ace_name { color:#5778B6;}.ace-mono-industrial .ace_entity.ace_name.ace_function { color:#A8B3AB;}.ace-mono-industrial .ace_markup.ace_underline { text-decoration:underline;}.ace-mono-industrial .ace_markup.ace_heading { }.ace-mono-industrial .ace_markup.ace_heading.ace_1 { }.ace-mono-industrial .ace_markup.ace_heading.ace_2 { }.ace-mono-industrial .ace_markup.ace_heading.ace_3 { }.ace-mono-industrial .ace_markup.ace_heading.ace_4 { }.ace-mono-industrial .ace_markup.ace_heading.ace_5 { }.ace-mono-industrial .ace_markup.ace_heading.ace_6 { }.ace-mono-industrial .ace_markup.ace_list { }.ace-mono-industrial .ace_collab.ace_user1 { }",b.cssClass="ace-mono-industrial"}) \ No newline at end of file +define("ace/theme/mono_industrial",[], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-mono-industrial"; +exports.cssText = "\ +.ace-mono-industrial .ace_editor {\ + border: 2px solid rgb(159, 159, 159);\ +}\ +\ +.ace-mono-industrial .ace_editor.ace_focus {\ + border: 2px solid #327fbd;\ +}\ +\ +.ace-mono-industrial .ace_gutter {\ + background: #e8e8e8;\ + color: #333;\ +}\ +\ +.ace-mono-industrial .ace_print_margin {\ + width: 1px;\ + background: #e8e8e8;\ +}\ +\ +.ace-mono-industrial .ace_scroller {\ + background-color: #222C28;\ +}\ +\ +.ace-mono-industrial .ace_text-layer {\ + cursor: text;\ + color: #FFFFFF;\ +}\ +\ +.ace-mono-industrial .ace_cursor {\ + border-left: 2px solid #FFFFFF;\ +}\ +\ +.ace-mono-industrial .ace_cursor.ace_overwrite {\ + border-left: 0px;\ + border-bottom: 1px solid #FFFFFF;\ +}\ + \ +.ace-mono-industrial .ace_marker-layer .ace_selection {\ + background: rgba(145, 153, 148, 0.40);\ +}\ +\ +.ace-mono-industrial .ace_marker-layer .ace_step {\ + background: rgb(198, 219, 174);\ +}\ +\ +.ace-mono-industrial .ace_marker-layer .ace_bracket {\ + margin: -1px 0 0 -1px;\ + border: 1px solid rgba(102, 108, 104, 0.50);\ +}\ +\ +.ace-mono-industrial .ace_marker-layer .ace_active_line {\ + background: rgba(12, 13, 12, 0.25);\ +}\ +\ +.ace-mono-industrial .ace_marker-layer .ace_selected_word {\ + border: 1px solid rgba(145, 153, 148, 0.40);\ +}\ + \ +.ace-mono-industrial .ace_invisible {\ + color: rgba(102, 108, 104, 0.50);\ +}\ +\ +.ace-mono-industrial .ace_keyword {\ + color:#A39E64;\ +}\ +\ +.ace-mono-industrial .ace_keyword.ace_operator {\ + color:#A8B3AB;\ +}\ +\ +.ace-mono-industrial .ace_constant {\ + color:#E98800;\ +}\ +\ +.ace-mono-industrial .ace_constant.ace_numeric {\ + color:#E98800;\ +}\ +\ +.ace-mono-industrial .ace_invalid {\ + color:#FFFFFF;\ +background-color:rgba(153, 0, 0, 0.68);\ +}\ +\ +.ace-mono-industrial .ace_fold {\ + background-color: #A8B3AB;\ + border-color: #FFFFFF;\ +}\ +\ +.ace-mono-industrial .ace_support.ace_function {\ + color:#588E60;\ +}\ +\ +.ace-mono-industrial .ace_comment {\ + color:#666C68;\ +background-color:#151C19;\ +}\ +\ +.ace-mono-industrial .ace_variable.ace_language {\ + color:#648BD2;\ +}\ +\ +.ace-mono-industrial .ace_entity.ace_other.ace_attribute-name {\ + color:#909993;\ +}\ +\ +.ace-mono-industrial .ace_entity.ace_name {\ + color:#5778B6;\ +}\ +\ +.ace-mono-industrial .ace_entity.ace_name.ace_function {\ + color:#A8B3AB;\ +}\ +\ +.ace-mono-industrial .ace_markup.ace_underline {\ + text-decoration:underline;\ +}"; + + var dom = require("ace/lib/dom"); + dom.importCssString(exports.cssText); +}); + diff --git a/chrome/content/ace++/res/ace/theme-monokai.js b/chrome/content/ace++/res/ace/theme-monokai.js index 1b0afbc..31c1038 100644 --- a/chrome/content/ace++/res/ace/theme-monokai.js +++ b/chrome/content/ace++/res/ace/theme-monokai.js @@ -1 +1,121 @@ -define("ace/theme/monokai",["require","exports","module"],function(a,b,c){b.cssText=".ace-monokai .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-monokai .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-monokai .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-monokai .ace_gutter-layer { width: 100%; text-align: right;}.ace-monokai .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-monokai .ace_print_margin { width: 1px; background: #e8e8e8;}.ace-monokai .ace_scroller { background-color: #272822;}.ace-monokai .ace_text-layer { cursor: text; color: #F8F8F2;}.ace-monokai .ace_cursor { border-left: 2px solid #F8F8F0;}.ace-monokai .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #F8F8F0;} .ace-monokai .ace_marker-layer .ace_selection { background: #49483E;}.ace-monokai .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-monokai .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid #49483E;}.ace-monokai .ace_marker-layer .ace_active_line { background: #49483E;} .ace-monokai .ace_invisible { color: #49483E;}.ace-monokai .ace_keyword { color:#F92672;}.ace-monokai .ace_keyword.ace_operator { }.ace-monokai .ace_constant { }.ace-monokai .ace_constant.ace_language { color:#AE81FF;}.ace-monokai .ace_constant.ace_library { }.ace-monokai .ace_constant.ace_numeric { color:#AE81FF;}.ace-monokai .ace_invalid { color:#F8F8F0;background-color:#F92672;}.ace-monokai .ace_invalid.ace_illegal { }.ace-monokai .ace_invalid.ace_deprecated { color:#F8F8F0;background-color:#AE81FF;}.ace-monokai .ace_support { }.ace-monokai .ace_support.ace_function { color:#66D9EF;}.ace-monokai .ace_function.ace_buildin { }.ace-monokai .ace_string { color:#E6DB74;}.ace-monokai .ace_string.ace_regexp { }.ace-monokai .ace_comment { color:#75715E;}.ace-monokai .ace_comment.ace_doc { }.ace-monokai .ace_comment.ace_doc.ace_tag { }.ace-monokai .ace_variable { }.ace-monokai .ace_variable.ace_language { }.ace-monokai .ace_xml_pe { }.ace-monokai .ace_meta { }.ace-monokai .ace_meta.ace_tag { }.ace-monokai .ace_meta.ace_tag.ace_input { }.ace-monokai .ace_entity.ace_other.ace_attribute-name { color:#A6E22E;}.ace-monokai .ace_entity.ace_name { }.ace-monokai .ace_entity.ace_name.ace_function { color:#A6E22E;}.ace-monokai .ace_markup.ace_underline { text-decoration:underline;}.ace-monokai .ace_markup.ace_heading { }.ace-monokai .ace_markup.ace_heading.ace_1 { }.ace-monokai .ace_markup.ace_heading.ace_2 { }.ace-monokai .ace_markup.ace_heading.ace_3 { }.ace-monokai .ace_markup.ace_heading.ace_4 { }.ace-monokai .ace_markup.ace_heading.ace_5 { }.ace-monokai .ace_markup.ace_heading.ace_6 { }.ace-monokai .ace_markup.ace_list { }.ace-monokai .ace_collab.ace_user1 { }",b.cssClass="ace-monokai"}) \ No newline at end of file +define("ace/theme/monokai",[], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-monokai"; +exports.cssText = "\ +.ace-monokai .ace_editor {\ + border: 2px solid rgb(159, 159, 159);\ +}\ +\ +.ace-monokai .ace_editor.ace_focus {\ + border: 2px solid #327fbd;\ +}\ +\ +.ace-monokai .ace_gutter {\ + background: #e8e8e8;\ + color: #333;\ +}\ +\ +.ace-monokai .ace_print_margin {\ + width: 1px;\ + background: #e8e8e8;\ +}\ +\ +.ace-monokai .ace_scroller {\ + background-color: #272822;\ +}\ +\ +.ace-monokai .ace_text-layer {\ + cursor: text;\ + color: #F8F8F2;\ +}\ +\ +.ace-monokai .ace_cursor {\ + border-left: 2px solid #F8F8F0;\ +}\ +\ +.ace-monokai .ace_cursor.ace_overwrite {\ + border-left: 0px;\ + border-bottom: 1px solid #F8F8F0;\ +}\ + \ +.ace-monokai .ace_marker-layer .ace_selection {\ + background: #49483E;\ +}\ +\ +.ace-monokai .ace_marker-layer .ace_step {\ + background: rgb(198, 219, 174);\ +}\ +\ +.ace-monokai .ace_marker-layer .ace_bracket {\ + margin: -1px 0 0 -1px;\ + border: 1px solid #49483E;\ +}\ +\ +.ace-monokai .ace_marker-layer .ace_active_line {\ + background: #49483E;\ +}\ +\ +.ace-monokai .ace_marker-layer .ace_selected_word {\ + border: 1px solid #49483E;\ +}\ + \ +.ace-monokai .ace_invisible {\ + color: #49483E;\ +}\ +\ +.ace-monokai .ace_keyword {\ + color:#F92672;\ +}\ +\ +.ace-monokai .ace_constant.ace_language {\ + color:#AE81FF;\ +}\ +\ +.ace-monokai .ace_constant.ace_numeric {\ + color:#AE81FF;\ +}\ +\ +.ace-monokai .ace_invalid {\ + color:#F8F8F0;\ +background-color:#F92672;\ +}\ +\ +.ace-monokai .ace_invalid.ace_deprecated {\ + color:#F8F8F0;\ +background-color:#AE81FF;\ +}\ +\ +.ace-monokai .ace_fold {\ + background-color: #A6E22E;\ + border-color: #F8F8F2;\ +}\ +\ +.ace-monokai .ace_support.ace_function {\ + color:#66D9EF;\ +}\ +\ +.ace-monokai .ace_string {\ + color:#E6DB74;\ +}\ +\ +.ace-monokai .ace_comment {\ + color:#75715E;\ +}\ +\ +.ace-monokai .ace_entity.ace_other.ace_attribute-name {\ + color:#A6E22E;\ +}\ +\ +.ace-monokai .ace_entity.ace_name.ace_function {\ + color:#A6E22E;\ +}\ +\ +.ace-monokai .ace_markup.ace_underline {\ + text-decoration:underline;\ +}"; + + var dom = require("ace/lib/dom"); + dom.importCssString(exports.cssText); +}); + diff --git a/chrome/content/ace++/res/ace/theme-pastel_on_dark.js b/chrome/content/ace++/res/ace/theme-pastel_on_dark.js index 0c4fec8..bcb4f3a 100644 --- a/chrome/content/ace++/res/ace/theme-pastel_on_dark.js +++ b/chrome/content/ace++/res/ace/theme-pastel_on_dark.js @@ -1 +1,143 @@ -define("ace/theme/pastel_on_dark",["require","exports","module"],function(a,b,c){b.cssText=".ace-pastel-on-dark .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-pastel-on-dark .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-pastel-on-dark .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-pastel-on-dark .ace_gutter-layer { width: 100%; text-align: right;}.ace-pastel-on-dark .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-pastel-on-dark .ace_print_margin { width: 1px; background: #e8e8e8;}.ace-pastel-on-dark .ace_scroller { background-color: #2c2828;}.ace-pastel-on-dark .ace_text-layer { cursor: text; color: #8f938f;}.ace-pastel-on-dark .ace_cursor { border-left: 2px solid #A7A7A7;}.ace-pastel-on-dark .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #A7A7A7;} .ace-pastel-on-dark .ace_marker-layer .ace_selection { background: rgba(221, 240, 255, 0.20);}.ace-pastel-on-dark .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-pastel-on-dark .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgba(255, 255, 255, 0.25);}.ace-pastel-on-dark .ace_marker-layer .ace_active_line { background: rgba(255, 255, 255, 0.031);} .ace-pastel-on-dark .ace_invisible { color: rgba(255, 255, 255, 0.25);}.ace-pastel-on-dark .ace_keyword { color:#757ad8;}.ace-pastel-on-dark .ace_keyword.ace_operator { color:#797878;}.ace-pastel-on-dark .ace_constant { color:#4fb7c5;}.ace-pastel-on-dark .ace_constant.ace_language { }.ace-pastel-on-dark .ace_constant.ace_library { }.ace-pastel-on-dark .ace_constant.ace_numeric { }.ace-pastel-on-dark .ace_invalid { }.ace-pastel-on-dark .ace_invalid.ace_illegal { color:#F8F8F8;background-color:rgba(86, 45, 86, 0.75);}.ace-pastel-on-dark .ace_invalid.ace_deprecated { text-decoration:underline;font-style:italic;color:#D2A8A1;}.ace-pastel-on-dark .ace_support { color:#9a9a9a;}.ace-pastel-on-dark .ace_support.ace_function { color:#aeb2f8;}.ace-pastel-on-dark .ace_function.ace_buildin { }.ace-pastel-on-dark .ace_string { color:#66a968;}.ace-pastel-on-dark .ace_string.ace_regexp { color:#E9C062;}.ace-pastel-on-dark .ace_comment { color:#656865;}.ace-pastel-on-dark .ace_comment.ace_doc { color:A6C6FF;}.ace-pastel-on-dark .ace_comment.ace_doc.ace_tag { color:A6C6FF;}.ace-pastel-on-dark .ace_variable { color:#bebf55;}.ace-pastel-on-dark .ace_variable.ace_language { color:#bebf55;}.ace-pastel-on-dark .ace_markup.ace_underline { text-decoration:underline;}.ace-pastel-on-dark .ace_xml_pe { color:#494949;}",b.cssClass="ace-pastel-on-dark"}) \ No newline at end of file +define("ace/theme/pastel_on_dark",[], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-pastel-on-dark"; +exports.cssText = "\ +.ace-pastel-on-dark .ace_editor {\ + border: 2px solid rgb(159, 159, 159);\ +}\ +\ +.ace-pastel-on-dark .ace_editor.ace_focus {\ + border: 2px solid #327fbd;\ +}\ +\ +.ace-pastel-on-dark .ace_gutter {\ + background: #e8e8e8;\ + color: #333;\ +}\ +\ +.ace-pastel-on-dark .ace_print_margin {\ + width: 1px;\ + background: #e8e8e8;\ +}\ +\ +.ace-pastel-on-dark .ace_scroller {\ + background-color: #2C2828;\ +}\ +\ +.ace-pastel-on-dark .ace_text-layer {\ + cursor: text;\ + color: #8F938F;\ +}\ +\ +.ace-pastel-on-dark .ace_cursor {\ + border-left: 2px solid #A7A7A7;\ +}\ +\ +.ace-pastel-on-dark .ace_cursor.ace_overwrite {\ + border-left: 0px;\ + border-bottom: 1px solid #A7A7A7;\ +}\ + \ +.ace-pastel-on-dark .ace_marker-layer .ace_selection {\ + background: rgba(221, 240, 255, 0.20);\ +}\ +\ +.ace-pastel-on-dark .ace_marker-layer .ace_step {\ + background: rgb(198, 219, 174);\ +}\ +\ +.ace-pastel-on-dark .ace_marker-layer .ace_bracket {\ + margin: -1px 0 0 -1px;\ + border: 1px solid rgba(255, 255, 255, 0.25);\ +}\ +\ +.ace-pastel-on-dark .ace_marker-layer .ace_active_line {\ + background: rgba(255, 255, 255, 0.031);\ +}\ +\ +.ace-pastel-on-dark .ace_marker-layer .ace_selected_word {\ + border: 1px solid rgba(221, 240, 255, 0.20);\ +}\ + \ +.ace-pastel-on-dark .ace_invisible {\ + color: rgba(255, 255, 255, 0.25);\ +}\ +\ +.ace-pastel-on-dark .ace_keyword {\ + color:#757aD8;\ +}\ +\ +.ace-pastel-on-dark .ace_keyword.ace_operator {\ + color:#797878;\ +}\ +\ +.ace-pastel-on-dark .ace_constant {\ + color:#4FB7C5;\ +}\ +\ +.ace-pastel-on-dark .ace_constant.ace_language {\ + color:#DE8E30;\ +}\ +\ +.ace-pastel-on-dark .ace_constant.ace_numeric {\ + color:#CCCCCC;\ +}\ +\ +.ace-pastel-on-dark .ace_invalid {\ + color:#F8F8F8;\ +background-color:rgba(86, 45, 86, 0.75);\ +}\ +\ +.ace-pastel-on-dark .ace_invalid.ace_illegal {\ + color:#F8F8F8;\ +background-color:rgba(86, 45, 86, 0.75);\ +}\ +\ +.ace-pastel-on-dark .ace_invalid.ace_deprecated {\ + text-decoration:underline;\ +font-style:italic;\ +color:#D2A8A1;\ +}\ +\ +.ace-pastel-on-dark .ace_fold {\ + background-color: #757aD8;\ + border-color: #8F938F;\ +}\ +\ +.ace-pastel-on-dark .ace_support.ace_function {\ + color:#AEB2F8;\ +}\ +\ +.ace-pastel-on-dark .ace_string {\ + color:#66A968;\ +}\ +\ +.ace-pastel-on-dark .ace_string.ace_regexp {\ + color:#E9C062;\ +}\ +\ +.ace-pastel-on-dark .ace_comment {\ + color:#A6C6FF;\ +}\ +\ +.ace-pastel-on-dark .ace_variable {\ + color:#BEBF55;\ +}\ +\ +.ace-pastel-on-dark .ace_variable.ace_language {\ + color:#C1C144;\ +}\ +\ +.ace-pastel-on-dark .ace_xml_pe {\ + color:#494949;\ +}\ +\ +.ace-pastel-on-dark .ace_markup.ace_underline {\ + text-decoration:underline;\ +}"; + + var dom = require("ace/lib/dom"); + dom.importCssString(exports.cssText); +}); + diff --git a/chrome/content/ace++/res/ace/theme-solarized_dark.js b/chrome/content/ace++/res/ace/theme-solarized_dark.js index ec4e192..883b0d9 100644 --- a/chrome/content/ace++/res/ace/theme-solarized_dark.js +++ b/chrome/content/ace++/res/ace/theme-solarized_dark.js @@ -1 +1,120 @@ -define("ace/theme/solarized_dark",["require","exports","module"],function(a,b,c){b.cssText=".ace-solarized-dark .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-solarized-dark .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-solarized-dark .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-solarized-dark .ace_gutter-layer { width: 100%; text-align: right;}.ace-solarized-dark .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-solarized-dark .ace_print_margin { width: 1px; background: #e8e8e8;}.ace-solarized-dark .ace_scroller { background-color: #002B36;}.ace-solarized-dark .ace_text-layer { cursor: text; color: #93A1A1;}.ace-solarized-dark .ace_cursor { border-left: 2px solid #D30102;}.ace-solarized-dark .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #D30102;} .ace-solarized-dark .ace_marker-layer .ace_selection { background: #073642;}.ace-solarized-dark .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-solarized-dark .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgba(147, 161, 161, 0.50);}.ace-solarized-dark .ace_marker-layer .ace_active_line { background: #073642;} .ace-solarized-dark .ace_invisible { color: rgba(147, 161, 161, 0.50);}.ace-solarized-dark .ace_keyword { color:#859900;}.ace-solarized-dark .ace_keyword.ace_operator { }.ace-solarized-dark .ace_constant { }.ace-solarized-dark .ace_constant.ace_language { color:#B58900;}.ace-solarized-dark .ace_constant.ace_library { }.ace-solarized-dark .ace_constant.ace_numeric { color:#D33682;}.ace-solarized-dark .ace_invalid { }.ace-solarized-dark .ace_invalid.ace_illegal { }.ace-solarized-dark .ace_invalid.ace_deprecated { }.ace-solarized-dark .ace_support { }.ace-solarized-dark .ace_support.ace_function { color:#268BD2;}.ace-solarized-dark .ace_function.ace_buildin { }.ace-solarized-dark .ace_string { color:#2AA198;}.ace-solarized-dark .ace_string.ace_regexp { color:#D30102;}.ace-solarized-dark .ace_comment { font-style:italic;color:#657B83;}.ace-solarized-dark .ace_comment.ace_doc { }.ace-solarized-dark .ace_comment.ace_doc.ace_tag { }.ace-solarized-dark .ace_variable { }.ace-solarized-dark .ace_variable.ace_language { color:#268BD2;}.ace-solarized-dark .ace_xml_pe { }.ace-solarized-dark .ace_meta { }.ace-solarized-dark .ace_meta.ace_tag { }.ace-solarized-dark .ace_meta.ace_tag.ace_input { }.ace-solarized-dark .ace_entity.ace_other.ace_attribute-name { color:#93A1A1;}.ace-solarized-dark .ace_entity.ace_name { }.ace-solarized-dark .ace_entity.ace_name.ace_function { color:#268BD2;}.ace-solarized-dark .ace_markup.ace_underline { text-decoration:underline;}.ace-solarized-dark .ace_markup.ace_heading { }.ace-solarized-dark .ace_markup.ace_heading.ace_1 { }.ace-solarized-dark .ace_markup.ace_heading.ace_2 { }.ace-solarized-dark .ace_markup.ace_heading.ace_3 { }.ace-solarized-dark .ace_markup.ace_heading.ace_4 { }.ace-solarized-dark .ace_markup.ace_heading.ace_5 { }.ace-solarized-dark .ace_markup.ace_heading.ace_6 { }.ace-solarized-dark .ace_markup.ace_list { }.ace-solarized-dark .ace_collab.ace_user1 { }",b.cssClass="ace-solarized-dark"}) \ No newline at end of file +define("ace/theme/solarized_dark",[], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-solarized-dark"; +exports.cssText = "\ +.ace-solarized-dark .ace_editor {\ + border: 2px solid rgb(159, 159, 159);\ +}\ +\ +.ace-solarized-dark .ace_editor.ace_focus {\ + border: 2px solid #327fbd;\ +}\ +\ +.ace-solarized-dark .ace_gutter {\ + background: #e8e8e8;\ + color: #333;\ +}\ +\ +.ace-solarized-dark .ace_print_margin {\ + width: 1px;\ + background: #e8e8e8;\ +}\ +\ +.ace-solarized-dark .ace_scroller {\ + background-color: #002B36;\ +}\ +\ +.ace-solarized-dark .ace_text-layer {\ + cursor: text;\ + color: #93A1A1;\ +}\ +\ +.ace-solarized-dark .ace_cursor {\ + border-left: 2px solid #D30102;\ +}\ +\ +.ace-solarized-dark .ace_cursor.ace_overwrite {\ + border-left: 0px;\ + border-bottom: 1px solid #D30102;\ +}\ + \ +.ace-solarized-dark .ace_marker-layer .ace_selection {\ + background: #073642;\ +}\ +\ +.ace-solarized-dark .ace_marker-layer .ace_step {\ + background: rgb(198, 219, 174);\ +}\ +\ +.ace-solarized-dark .ace_marker-layer .ace_bracket {\ + margin: -1px 0 0 -1px;\ + border: 1px solid rgba(147, 161, 161, 0.50);\ +}\ +\ +.ace-solarized-dark .ace_marker-layer .ace_active_line {\ + background: #073642;\ +}\ +\ +.ace-solarized-dark .ace_marker-layer .ace_selected_word {\ + border: 1px solid #073642;\ +}\ + \ +.ace-solarized-dark .ace_invisible {\ + color: rgba(147, 161, 161, 0.50);\ +}\ +\ +.ace-solarized-dark .ace_keyword {\ + color:#859900;\ +}\ +\ +.ace-solarized-dark .ace_constant.ace_language {\ + color:#B58900;\ +}\ +\ +.ace-solarized-dark .ace_constant.ace_numeric {\ + color:#D33682;\ +}\ +\ +.ace-solarized-dark .ace_fold {\ + background-color: #268BD2;\ + border-color: #93A1A1;\ +}\ +\ +.ace-solarized-dark .ace_support.ace_function {\ + color:#268BD2;\ +}\ +\ +.ace-solarized-dark .ace_string {\ + color:#2AA198;\ +}\ +\ +.ace-solarized-dark .ace_string.ace_regexp {\ + color:#D30102;\ +}\ +\ +.ace-solarized-dark .ace_comment {\ + font-style:italic;\ +color:#657B83;\ +}\ +\ +.ace-solarized-dark .ace_variable.ace_language {\ + color:#268BD2;\ +}\ +\ +.ace-solarized-dark .ace_entity.ace_other.ace_attribute-name {\ + color:#93A1A1;\ +}\ +\ +.ace-solarized-dark .ace_entity.ace_name.ace_function {\ + color:#268BD2;\ +}\ +\ +.ace-solarized-dark .ace_markup.ace_underline {\ + text-decoration:underline;\ +}"; + + var dom = require("ace/lib/dom"); + dom.importCssString(exports.cssText); +}); + diff --git a/chrome/content/ace++/res/ace/theme-solarized_light.js b/chrome/content/ace++/res/ace/theme-solarized_light.js index e003c6d..456c321 100644 --- a/chrome/content/ace++/res/ace/theme-solarized_light.js +++ b/chrome/content/ace++/res/ace/theme-solarized_light.js @@ -1 +1,119 @@ -define("ace/theme/solarized_light",["require","exports","module"],function(a,b,c){b.cssText=".ace-solarized-light .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-solarized-light .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-solarized-light .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-solarized-light .ace_gutter-layer { width: 100%; text-align: right;}.ace-solarized-light .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-solarized-light .ace_print_margin { width: 1px; background: #e8e8e8;}.ace-solarized-light .ace_scroller { background-color: #FDF6E3;}.ace-solarized-light .ace_text-layer { cursor: text; color: #586E75;}.ace-solarized-light .ace_cursor { border-left: 2px solid #000000;}.ace-solarized-light .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #000000;} .ace-solarized-light .ace_marker-layer .ace_selection { background: #073642;}.ace-solarized-light .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-solarized-light .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgba(147, 161, 161, 0.50);}.ace-solarized-light .ace_marker-layer .ace_active_line { background: #EEE8D5;} .ace-solarized-light .ace_invisible { color: rgba(147, 161, 161, 0.50);}.ace-solarized-light .ace_keyword { color:#859900;}.ace-solarized-light .ace_keyword.ace_operator { }.ace-solarized-light .ace_constant { }.ace-solarized-light .ace_constant.ace_language { color:#B58900;}.ace-solarized-light .ace_constant.ace_library { }.ace-solarized-light .ace_constant.ace_numeric { color:#D33682;}.ace-solarized-light .ace_invalid { }.ace-solarized-light .ace_invalid.ace_illegal { }.ace-solarized-light .ace_invalid.ace_deprecated { }.ace-solarized-light .ace_support { }.ace-solarized-light .ace_support.ace_function { color:#268BD2;}.ace-solarized-light .ace_function.ace_buildin { }.ace-solarized-light .ace_string { color:#2AA198;}.ace-solarized-light .ace_string.ace_regexp { color:#D30102;}.ace-solarized-light .ace_comment { color:#93A1A1;}.ace-solarized-light .ace_comment.ace_doc { }.ace-solarized-light .ace_comment.ace_doc.ace_tag { }.ace-solarized-light .ace_variable { }.ace-solarized-light .ace_variable.ace_language { color:#268BD2;}.ace-solarized-light .ace_xml_pe { }.ace-solarized-light .ace_meta { }.ace-solarized-light .ace_meta.ace_tag { }.ace-solarized-light .ace_meta.ace_tag.ace_input { }.ace-solarized-light .ace_entity.ace_other.ace_attribute-name { color:#93A1A1;}.ace-solarized-light .ace_entity.ace_name { }.ace-solarized-light .ace_entity.ace_name.ace_function { color:#268BD2;}.ace-solarized-light .ace_markup.ace_underline { text-decoration:underline;}.ace-solarized-light .ace_markup.ace_heading { }.ace-solarized-light .ace_markup.ace_heading.ace_1 { }.ace-solarized-light .ace_markup.ace_heading.ace_2 { }.ace-solarized-light .ace_markup.ace_heading.ace_3 { }.ace-solarized-light .ace_markup.ace_heading.ace_4 { }.ace-solarized-light .ace_markup.ace_heading.ace_5 { }.ace-solarized-light .ace_markup.ace_heading.ace_6 { }.ace-solarized-light .ace_markup.ace_list { }.ace-solarized-light .ace_collab.ace_user1 { }",b.cssClass="ace-solarized-light"}) \ No newline at end of file +define("ace/theme/solarized_light",[], function(require, exports, module) { + +exports.isDark = false; +exports.cssClass = "ace-solarized-light"; +exports.cssText = "\ +.ace-solarized-light .ace_editor {\ + border: 2px solid rgb(159, 159, 159);\ +}\ +\ +.ace-solarized-light .ace_editor.ace_focus {\ + border: 2px solid #327fbd;\ +}\ +\ +.ace-solarized-light .ace_gutter {\ + background: #e8e8e8;\ + color: #333;\ +}\ +\ +.ace-solarized-light .ace_print_margin {\ + width: 1px;\ + background: #e8e8e8;\ +}\ +\ +.ace-solarized-light .ace_scroller {\ + background-color: #FDF6E3;\ +}\ +\ +.ace-solarized-light .ace_text-layer {\ + cursor: text;\ + color: #586E75;\ +}\ +\ +.ace-solarized-light .ace_cursor {\ + border-left: 2px solid #000000;\ +}\ +\ +.ace-solarized-light .ace_cursor.ace_overwrite {\ + border-left: 0px;\ + border-bottom: 1px solid #000000;\ +}\ + \ +.ace-solarized-light .ace_marker-layer .ace_selection {\ + background: #073642;\ +}\ +\ +.ace-solarized-light .ace_marker-layer .ace_step {\ + background: rgb(198, 219, 174);\ +}\ +\ +.ace-solarized-light .ace_marker-layer .ace_bracket {\ + margin: -1px 0 0 -1px;\ + border: 1px solid rgba(147, 161, 161, 0.50);\ +}\ +\ +.ace-solarized-light .ace_marker-layer .ace_active_line {\ + background: #EEE8D5;\ +}\ +\ +.ace-solarized-light .ace_marker-layer .ace_selected_word {\ + border: 1px solid #073642;\ +}\ + \ +.ace-solarized-light .ace_invisible {\ + color: rgba(147, 161, 161, 0.50);\ +}\ +\ +.ace-solarized-light .ace_keyword {\ + color:#859900;\ +}\ +\ +.ace-solarized-light .ace_constant.ace_language {\ + color:#B58900;\ +}\ +\ +.ace-solarized-light .ace_constant.ace_numeric {\ + color:#D33682;\ +}\ +\ +.ace-solarized-light .ace_fold {\ + background-color: #268BD2;\ + border-color: #586E75;\ +}\ +\ +.ace-solarized-light .ace_support.ace_function {\ + color:#268BD2;\ +}\ +\ +.ace-solarized-light .ace_string {\ + color:#2AA198;\ +}\ +\ +.ace-solarized-light .ace_string.ace_regexp {\ + color:#D30102;\ +}\ +\ +.ace-solarized-light .ace_comment {\ + color:#93A1A1;\ +}\ +\ +.ace-solarized-light .ace_variable.ace_language {\ + color:#268BD2;\ +}\ +\ +.ace-solarized-light .ace_entity.ace_other.ace_attribute-name {\ + color:#93A1A1;\ +}\ +\ +.ace-solarized-light .ace_entity.ace_name.ace_function {\ + color:#268BD2;\ +}\ +\ +.ace-solarized-light .ace_markup.ace_underline {\ + text-decoration:underline;\ +}"; + + var dom = require("ace/lib/dom"); + dom.importCssString(exports.cssText); +}); + diff --git a/chrome/content/ace++/res/ace/theme-tomorrow.js b/chrome/content/ace++/res/ace/theme-tomorrow.js index 0791069..a210195 100644 --- a/chrome/content/ace++/res/ace/theme-tomorrow.js +++ b/chrome/content/ace++/res/ace/theme-tomorrow.js @@ -1 +1,141 @@ -define("ace/theme/tomorrow",["require","exports","module"],function(a,b,c){b.cssText=".ace-tomorrow .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-tomorrow .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-tomorrow .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-tomorrow .ace_gutter-layer { width: 100%; text-align: right;}.ace-tomorrow .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-tomorrow .ace_print_margin { width: 1px; background: #e8e8e8;}.ace-tomorrow .ace_scroller { background-color: #FFFFFF;}.ace-tomorrow .ace_text-layer { cursor: text; color: #4D4D4C;}.ace-tomorrow .ace_cursor { border-left: 2px solid #AEAFAD;}.ace-tomorrow .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #AEAFAD;} .ace-tomorrow .ace_marker-layer .ace_selection { background: #D6D6D6;}.ace-tomorrow .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-tomorrow .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid #D1D1D1;}.ace-tomorrow .ace_marker-layer .ace_active_line { background: #EFEFEF;} .ace-tomorrow .ace_invisible { color: #D1D1D1;}.ace-tomorrow .ace_keyword { color:#8959A8;}.ace-tomorrow .ace_keyword.ace_operator { color:#3E999F;}.ace-tomorrow .ace_constant { }.ace-tomorrow .ace_constant.ace_language { color:#F5871F;}.ace-tomorrow .ace_constant.ace_library { }.ace-tomorrow .ace_constant.ace_numeric { color:#F5871F;}.ace-tomorrow .ace_invalid { color:#FFFFFF;background-color:#C82829;}.ace-tomorrow .ace_invalid.ace_illegal { }.ace-tomorrow .ace_invalid.ace_deprecated { color:#FFFFFF;background-color:#8959A8;}.ace-tomorrow .ace_support { }.ace-tomorrow .ace_support.ace_function { color:#4271AE;}.ace-tomorrow .ace_function.ace_buildin { }.ace-tomorrow .ace_string { color:#718C00;}.ace-tomorrow .ace_string.ace_regexp { color:#C82829;}.ace-tomorrow .ace_comment { color:#8E908C;}.ace-tomorrow .ace_comment.ace_doc { }.ace-tomorrow .ace_comment.ace_doc.ace_tag { }.ace-tomorrow .ace_variable { color:#C82829;}.ace-tomorrow .ace_variable.ace_language { }.ace-tomorrow .ace_xml_pe { }.ace-tomorrow .ace_meta { }.ace-tomorrow .ace_meta.ace_tag { color:#C82829;}.ace-tomorrow .ace_meta.ace_tag.ace_input { }.ace-tomorrow .ace_entity.ace_other.ace_attribute-name { color:#C82829;}.ace-tomorrow .ace_entity.ace_name { }.ace-tomorrow .ace_entity.ace_name.ace_function { color:#4271AE;}.ace-tomorrow .ace_markup.ace_underline { text-decoration:underline;}.ace-tomorrow .ace_markup.ace_heading { color:#718C00;}.ace-tomorrow .ace_markup.ace_heading.ace_1 { }.ace-tomorrow .ace_markup.ace_heading.ace_2 { }.ace-tomorrow .ace_markup.ace_heading.ace_3 { }.ace-tomorrow .ace_markup.ace_heading.ace_4 { }.ace-tomorrow .ace_markup.ace_heading.ace_5 { }.ace-tomorrow .ace_markup.ace_heading.ace_6 { }.ace-tomorrow .ace_markup.ace_list { }.ace-tomorrow .ace_collab.ace_user1 { }",b.cssClass="ace-tomorrow"}) \ No newline at end of file +define("ace/theme/tomorrow",[], function(require, exports, module) { + +exports.isDark = false; +exports.cssClass = "ace-tomorrow"; +exports.cssText = "\ +.ace-tomorrow .ace_editor {\ + border: 2px solid rgb(159, 159, 159);\ +}\ +\ +.ace-tomorrow .ace_editor.ace_focus {\ + border: 2px solid #327fbd;\ +}\ +\ +.ace-tomorrow .ace_gutter {\ + background: #e8e8e8;\ + color: #333;\ +}\ +\ +.ace-tomorrow .ace_print_margin {\ + width: 1px;\ + background: #e8e8e8;\ +}\ +\ +.ace-tomorrow .ace_scroller {\ + background-color: #FFFFFF;\ +}\ +\ +.ace-tomorrow .ace_text-layer {\ + cursor: text;\ + color: #4D4D4C;\ +}\ +\ +.ace-tomorrow .ace_cursor {\ + border-left: 2px solid #AEAFAD;\ +}\ +\ +.ace-tomorrow .ace_cursor.ace_overwrite {\ + border-left: 0px;\ + border-bottom: 1px solid #AEAFAD;\ +}\ + \ +.ace-tomorrow .ace_marker-layer .ace_selection {\ + background: #D6D6D6;\ +}\ +\ +.ace-tomorrow .ace_marker-layer .ace_step {\ + background: rgb(198, 219, 174);\ +}\ +\ +.ace-tomorrow .ace_marker-layer .ace_bracket {\ + margin: -1px 0 0 -1px;\ + border: 1px solid #D1D1D1;\ +}\ +\ +.ace-tomorrow .ace_marker-layer .ace_active_line {\ + background: #EFEFEF;\ +}\ +\ +.ace-tomorrow .ace_marker-layer .ace_selected_word {\ + border: 1px solid #D6D6D6;\ +}\ + \ +.ace-tomorrow .ace_invisible {\ + color: #D1D1D1;\ +}\ +\ +.ace-tomorrow .ace_keyword {\ + color:#8959A8;\ +}\ +\ +.ace-tomorrow .ace_keyword.ace_operator {\ + color:#3E999F;\ +}\ +\ +.ace-tomorrow .ace_constant.ace_language {\ + color:#F5871F;\ +}\ +\ +.ace-tomorrow .ace_constant.ace_numeric {\ + color:#F5871F;\ +}\ +\ +.ace-tomorrow .ace_invalid {\ + color:#FFFFFF;\ +background-color:#C82829;\ +}\ +\ +.ace-tomorrow .ace_invalid.ace_deprecated {\ + color:#FFFFFF;\ +background-color:#8959A8;\ +}\ +\ +.ace-tomorrow .ace_fold {\ + background-color: #4271AE;\ + border-color: #4D4D4C;\ +}\ +\ +.ace-tomorrow .ace_support.ace_function {\ + color:#4271AE;\ +}\ +\ +.ace-tomorrow .ace_string {\ + color:#718C00;\ +}\ +\ +.ace-tomorrow .ace_string.ace_regexp {\ + color:#C82829;\ +}\ +\ +.ace-tomorrow .ace_comment {\ + color:#8E908C;\ +}\ +\ +.ace-tomorrow .ace_variable {\ + color:#C82829;\ +}\ +\ +.ace-tomorrow .ace_meta.ace_tag {\ + color:#C82829;\ +}\ +\ +.ace-tomorrow .ace_entity.ace_other.ace_attribute-name {\ + color:#C82829;\ +}\ +\ +.ace-tomorrow .ace_entity.ace_name.ace_function {\ + color:#4271AE;\ +}\ +\ +.ace-tomorrow .ace_markup.ace_underline {\ + text-decoration:underline;\ +}\ +\ +.ace-tomorrow .ace_markup.ace_heading {\ + color:#718C00;\ +}"; + + var dom = require("ace/lib/dom"); + dom.importCssString(exports.cssText); +}); + diff --git a/chrome/content/ace++/res/ace/theme-tomorrow_night.js b/chrome/content/ace++/res/ace/theme-tomorrow_night.js index fa4d3cd..427e1f4 100644 --- a/chrome/content/ace++/res/ace/theme-tomorrow_night.js +++ b/chrome/content/ace++/res/ace/theme-tomorrow_night.js @@ -1 +1,141 @@ -define("ace/theme/tomorrow_night",["require","exports","module"],function(a,b,c){b.cssText=".ace-tomorrow-night .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-tomorrow-night .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-tomorrow-night .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-tomorrow-night .ace_gutter-layer { width: 100%; text-align: right;}.ace-tomorrow-night .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-tomorrow-night .ace_print_margin { width: 1px; background: #e8e8e8;}.ace-tomorrow-night .ace_scroller { background-color: #1D1F21;}.ace-tomorrow-night .ace_text-layer { cursor: text; color: #C5C8C6;}.ace-tomorrow-night .ace_cursor { border-left: 2px solid #AEAFAD;}.ace-tomorrow-night .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #AEAFAD;} .ace-tomorrow-night .ace_marker-layer .ace_selection { background: #373B41;}.ace-tomorrow-night .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-tomorrow-night .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid #4B4E55;}.ace-tomorrow-night .ace_marker-layer .ace_active_line { background: #282A2E;} .ace-tomorrow-night .ace_invisible { color: #4B4E55;}.ace-tomorrow-night .ace_keyword { color:#B294BB;}.ace-tomorrow-night .ace_keyword.ace_operator { color:#8ABEB7;}.ace-tomorrow-night .ace_constant { }.ace-tomorrow-night .ace_constant.ace_language { color:#DE935F;}.ace-tomorrow-night .ace_constant.ace_library { }.ace-tomorrow-night .ace_constant.ace_numeric { color:#DE935F;}.ace-tomorrow-night .ace_invalid { color:#CED2CF;background-color:#DF5F5F;}.ace-tomorrow-night .ace_invalid.ace_illegal { }.ace-tomorrow-night .ace_invalid.ace_deprecated { color:#CED2CF;background-color:#B798BF;}.ace-tomorrow-night .ace_support { }.ace-tomorrow-night .ace_support.ace_function { color:#81A2BE;}.ace-tomorrow-night .ace_function.ace_buildin { }.ace-tomorrow-night .ace_string { color:#B5BD68;}.ace-tomorrow-night .ace_string.ace_regexp { color:#CC6666;}.ace-tomorrow-night .ace_comment { color:#969896;}.ace-tomorrow-night .ace_comment.ace_doc { }.ace-tomorrow-night .ace_comment.ace_doc.ace_tag { }.ace-tomorrow-night .ace_variable { color:#CC6666;}.ace-tomorrow-night .ace_variable.ace_language { }.ace-tomorrow-night .ace_xml_pe { }.ace-tomorrow-night .ace_meta { }.ace-tomorrow-night .ace_meta.ace_tag { color:#CC6666;}.ace-tomorrow-night .ace_meta.ace_tag.ace_input { }.ace-tomorrow-night .ace_entity.ace_other.ace_attribute-name { color:#CC6666;}.ace-tomorrow-night .ace_entity.ace_name { }.ace-tomorrow-night .ace_entity.ace_name.ace_function { color:#81A2BE;}.ace-tomorrow-night .ace_markup.ace_underline { text-decoration:underline;}.ace-tomorrow-night .ace_markup.ace_heading { color:#B5BD68;}.ace-tomorrow-night .ace_markup.ace_heading.ace_1 { }.ace-tomorrow-night .ace_markup.ace_heading.ace_2 { }.ace-tomorrow-night .ace_markup.ace_heading.ace_3 { }.ace-tomorrow-night .ace_markup.ace_heading.ace_4 { }.ace-tomorrow-night .ace_markup.ace_heading.ace_5 { }.ace-tomorrow-night .ace_markup.ace_heading.ace_6 { }.ace-tomorrow-night .ace_markup.ace_list { }.ace-tomorrow-night .ace_collab.ace_user1 { }",b.cssClass="ace-tomorrow-night"}) \ No newline at end of file +define("ace/theme/tomorrow_night",[], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-tomorrow-night"; +exports.cssText = "\ +.ace-tomorrow-night .ace_editor {\ + border: 2px solid rgb(159, 159, 159);\ +}\ +\ +.ace-tomorrow-night .ace_editor.ace_focus {\ + border: 2px solid #327fbd;\ +}\ +\ +.ace-tomorrow-night .ace_gutter {\ + background: #e8e8e8;\ + color: #333;\ +}\ +\ +.ace-tomorrow-night .ace_print_margin {\ + width: 1px;\ + background: #e8e8e8;\ +}\ +\ +.ace-tomorrow-night .ace_scroller {\ + background-color: #1D1F21;\ +}\ +\ +.ace-tomorrow-night .ace_text-layer {\ + cursor: text;\ + color: #C5C8C6;\ +}\ +\ +.ace-tomorrow-night .ace_cursor {\ + border-left: 2px solid #AEAFAD;\ +}\ +\ +.ace-tomorrow-night .ace_cursor.ace_overwrite {\ + border-left: 0px;\ + border-bottom: 1px solid #AEAFAD;\ +}\ + \ +.ace-tomorrow-night .ace_marker-layer .ace_selection {\ + background: #373B41;\ +}\ +\ +.ace-tomorrow-night .ace_marker-layer .ace_step {\ + background: rgb(198, 219, 174);\ +}\ +\ +.ace-tomorrow-night .ace_marker-layer .ace_bracket {\ + margin: -1px 0 0 -1px;\ + border: 1px solid #4B4E55;\ +}\ +\ +.ace-tomorrow-night .ace_marker-layer .ace_active_line {\ + background: #282A2E;\ +}\ +\ +.ace-tomorrow-night .ace_marker-layer .ace_selected_word {\ + border: 1px solid #373B41;\ +}\ + \ +.ace-tomorrow-night .ace_invisible {\ + color: #4B4E55;\ +}\ +\ +.ace-tomorrow-night .ace_keyword {\ + color:#B294BB;\ +}\ +\ +.ace-tomorrow-night .ace_keyword.ace_operator {\ + color:#8ABEB7;\ +}\ +\ +.ace-tomorrow-night .ace_constant.ace_language {\ + color:#DE935F;\ +}\ +\ +.ace-tomorrow-night .ace_constant.ace_numeric {\ + color:#DE935F;\ +}\ +\ +.ace-tomorrow-night .ace_invalid {\ + color:#CED2CF;\ +background-color:#DF5F5F;\ +}\ +\ +.ace-tomorrow-night .ace_invalid.ace_deprecated {\ + color:#CED2CF;\ +background-color:#B798BF;\ +}\ +\ +.ace-tomorrow-night .ace_fold {\ + background-color: #81A2BE;\ + border-color: #C5C8C6;\ +}\ +\ +.ace-tomorrow-night .ace_support.ace_function {\ + color:#81A2BE;\ +}\ +\ +.ace-tomorrow-night .ace_string {\ + color:#B5BD68;\ +}\ +\ +.ace-tomorrow-night .ace_string.ace_regexp {\ + color:#CC6666;\ +}\ +\ +.ace-tomorrow-night .ace_comment {\ + color:#969896;\ +}\ +\ +.ace-tomorrow-night .ace_variable {\ + color:#CC6666;\ +}\ +\ +.ace-tomorrow-night .ace_meta.ace_tag {\ + color:#CC6666;\ +}\ +\ +.ace-tomorrow-night .ace_entity.ace_other.ace_attribute-name {\ + color:#CC6666;\ +}\ +\ +.ace-tomorrow-night .ace_entity.ace_name.ace_function {\ + color:#81A2BE;\ +}\ +\ +.ace-tomorrow-night .ace_markup.ace_underline {\ + text-decoration:underline;\ +}\ +\ +.ace-tomorrow-night .ace_markup.ace_heading {\ + color:#B5BD68;\ +}"; + + var dom = require("ace/lib/dom"); + dom.importCssString(exports.cssText); +}); + diff --git a/chrome/content/ace++/res/ace/theme-tomorrow_night_blue.js b/chrome/content/ace++/res/ace/theme-tomorrow_night_blue.js index ff6bcff..5448801 100644 --- a/chrome/content/ace++/res/ace/theme-tomorrow_night_blue.js +++ b/chrome/content/ace++/res/ace/theme-tomorrow_night_blue.js @@ -1 +1,141 @@ -define("ace/theme/tomorrow_night_blue",["require","exports","module"],function(a,b,c){b.cssText=".ace-tomorrow-night-blue .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-tomorrow-night-blue .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-tomorrow-night-blue .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-tomorrow-night-blue .ace_gutter-layer { width: 100%; text-align: right;}.ace-tomorrow-night-blue .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-tomorrow-night-blue .ace_print_margin { width: 1px; background: #e8e8e8;}.ace-tomorrow-night-blue .ace_scroller { background-color: #002451;}.ace-tomorrow-night-blue .ace_text-layer { cursor: text; color: #FFFFFF;}.ace-tomorrow-night-blue .ace_cursor { border-left: 2px solid #FFFFFF;}.ace-tomorrow-night-blue .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #FFFFFF;} .ace-tomorrow-night-blue .ace_marker-layer .ace_selection { background: #003F8E;}.ace-tomorrow-night-blue .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-tomorrow-night-blue .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid #404F7D;}.ace-tomorrow-night-blue .ace_marker-layer .ace_active_line { background: #00346E;} .ace-tomorrow-night-blue .ace_invisible { color: #404F7D;}.ace-tomorrow-night-blue .ace_keyword { color:#EBBBFF;}.ace-tomorrow-night-blue .ace_keyword.ace_operator { color:#99FFFF;}.ace-tomorrow-night-blue .ace_constant { }.ace-tomorrow-night-blue .ace_constant.ace_language { color:#FFC58F;}.ace-tomorrow-night-blue .ace_constant.ace_library { }.ace-tomorrow-night-blue .ace_constant.ace_numeric { color:#FFC58F;}.ace-tomorrow-night-blue .ace_invalid { color:#FFFFFF;background-color:#F99DA5;}.ace-tomorrow-night-blue .ace_invalid.ace_illegal { }.ace-tomorrow-night-blue .ace_invalid.ace_deprecated { color:#FFFFFF;background-color:#EBBBFF;}.ace-tomorrow-night-blue .ace_support { }.ace-tomorrow-night-blue .ace_support.ace_function { color:#BBDAFF;}.ace-tomorrow-night-blue .ace_function.ace_buildin { }.ace-tomorrow-night-blue .ace_string { color:#D1F1A9;}.ace-tomorrow-night-blue .ace_string.ace_regexp { color:#FF9DA4;}.ace-tomorrow-night-blue .ace_comment { color:#7285B7;}.ace-tomorrow-night-blue .ace_comment.ace_doc { }.ace-tomorrow-night-blue .ace_comment.ace_doc.ace_tag { }.ace-tomorrow-night-blue .ace_variable { color:#FF9DA4;}.ace-tomorrow-night-blue .ace_variable.ace_language { }.ace-tomorrow-night-blue .ace_xml_pe { }.ace-tomorrow-night-blue .ace_meta { }.ace-tomorrow-night-blue .ace_meta.ace_tag { color:#FF9DA4;}.ace-tomorrow-night-blue .ace_meta.ace_tag.ace_input { }.ace-tomorrow-night-blue .ace_entity.ace_other.ace_attribute-name { color:#FF9DA4;}.ace-tomorrow-night-blue .ace_entity.ace_name { }.ace-tomorrow-night-blue .ace_entity.ace_name.ace_function { color:#BBDAFF;}.ace-tomorrow-night-blue .ace_markup.ace_underline { text-decoration:underline;}.ace-tomorrow-night-blue .ace_markup.ace_heading { color:#D1F1A9;}.ace-tomorrow-night-blue .ace_markup.ace_heading.ace_1 { }.ace-tomorrow-night-blue .ace_markup.ace_heading.ace_2 { }.ace-tomorrow-night-blue .ace_markup.ace_heading.ace_3 { }.ace-tomorrow-night-blue .ace_markup.ace_heading.ace_4 { }.ace-tomorrow-night-blue .ace_markup.ace_heading.ace_5 { }.ace-tomorrow-night-blue .ace_markup.ace_heading.ace_6 { }.ace-tomorrow-night-blue .ace_markup.ace_list { }.ace-tomorrow-night-blue .ace_collab.ace_user1 { }",b.cssClass="ace-tomorrow-night-blue"}) \ No newline at end of file +define("ace/theme/tomorrow_night_blue",[], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-tomorrow-night-blue"; +exports.cssText = "\ +.ace-tomorrow-night-blue .ace_editor {\ + border: 2px solid rgb(159, 159, 159);\ +}\ +\ +.ace-tomorrow-night-blue .ace_editor.ace_focus {\ + border: 2px solid #327fbd;\ +}\ +\ +.ace-tomorrow-night-blue .ace_gutter {\ + background: #e8e8e8;\ + color: #333;\ +}\ +\ +.ace-tomorrow-night-blue .ace_print_margin {\ + width: 1px;\ + background: #e8e8e8;\ +}\ +\ +.ace-tomorrow-night-blue .ace_scroller {\ + background-color: #002451;\ +}\ +\ +.ace-tomorrow-night-blue .ace_text-layer {\ + cursor: text;\ + color: #FFFFFF;\ +}\ +\ +.ace-tomorrow-night-blue .ace_cursor {\ + border-left: 2px solid #FFFFFF;\ +}\ +\ +.ace-tomorrow-night-blue .ace_cursor.ace_overwrite {\ + border-left: 0px;\ + border-bottom: 1px solid #FFFFFF;\ +}\ + \ +.ace-tomorrow-night-blue .ace_marker-layer .ace_selection {\ + background: #003F8E;\ +}\ +\ +.ace-tomorrow-night-blue .ace_marker-layer .ace_step {\ + background: rgb(198, 219, 174);\ +}\ +\ +.ace-tomorrow-night-blue .ace_marker-layer .ace_bracket {\ + margin: -1px 0 0 -1px;\ + border: 1px solid #404F7D;\ +}\ +\ +.ace-tomorrow-night-blue .ace_marker-layer .ace_active_line {\ + background: #00346E;\ +}\ +\ +.ace-tomorrow-night-blue .ace_marker-layer .ace_selected_word {\ + border: 1px solid #003F8E;\ +}\ + \ +.ace-tomorrow-night-blue .ace_invisible {\ + color: #404F7D;\ +}\ +\ +.ace-tomorrow-night-blue .ace_keyword {\ + color:#EBBBFF;\ +}\ +\ +.ace-tomorrow-night-blue .ace_keyword.ace_operator {\ + color:#99FFFF;\ +}\ +\ +.ace-tomorrow-night-blue .ace_constant.ace_language {\ + color:#FFC58F;\ +}\ +\ +.ace-tomorrow-night-blue .ace_constant.ace_numeric {\ + color:#FFC58F;\ +}\ +\ +.ace-tomorrow-night-blue .ace_invalid {\ + color:#FFFFFF;\ +background-color:#F99DA5;\ +}\ +\ +.ace-tomorrow-night-blue .ace_invalid.ace_deprecated {\ + color:#FFFFFF;\ +background-color:#EBBBFF;\ +}\ +\ +.ace-tomorrow-night-blue .ace_fold {\ + background-color: #BBDAFF;\ + border-color: #FFFFFF;\ +}\ +\ +.ace-tomorrow-night-blue .ace_support.ace_function {\ + color:#BBDAFF;\ +}\ +\ +.ace-tomorrow-night-blue .ace_string {\ + color:#D1F1A9;\ +}\ +\ +.ace-tomorrow-night-blue .ace_string.ace_regexp {\ + color:#FF9DA4;\ +}\ +\ +.ace-tomorrow-night-blue .ace_comment {\ + color:#7285B7;\ +}\ +\ +.ace-tomorrow-night-blue .ace_variable {\ + color:#FF9DA4;\ +}\ +\ +.ace-tomorrow-night-blue .ace_meta.ace_tag {\ + color:#FF9DA4;\ +}\ +\ +.ace-tomorrow-night-blue .ace_entity.ace_other.ace_attribute-name {\ + color:#FF9DA4;\ +}\ +\ +.ace-tomorrow-night-blue .ace_entity.ace_name.ace_function {\ + color:#BBDAFF;\ +}\ +\ +.ace-tomorrow-night-blue .ace_markup.ace_underline {\ + text-decoration:underline;\ +}\ +\ +.ace-tomorrow-night-blue .ace_markup.ace_heading {\ + color:#D1F1A9;\ +}"; + + var dom = require("ace/lib/dom"); + dom.importCssString(exports.cssText); +}); + diff --git a/chrome/content/ace++/res/ace/theme-tomorrow_night_bright.js b/chrome/content/ace++/res/ace/theme-tomorrow_night_bright.js index 38a2126..e911a6b 100644 --- a/chrome/content/ace++/res/ace/theme-tomorrow_night_bright.js +++ b/chrome/content/ace++/res/ace/theme-tomorrow_night_bright.js @@ -1 +1,141 @@ -define("ace/theme/tomorrow_night_bright",["require","exports","module"],function(a,b,c){b.cssText=".ace-tomorrow-night-bright .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-tomorrow-night-bright .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-tomorrow-night-bright .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-tomorrow-night-bright .ace_gutter-layer { width: 100%; text-align: right;}.ace-tomorrow-night-bright .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-tomorrow-night-bright .ace_print_margin { width: 1px; background: #e8e8e8;}.ace-tomorrow-night-bright .ace_scroller { background-color: #000000;}.ace-tomorrow-night-bright .ace_text-layer { cursor: text; color: #DEDEDE;}.ace-tomorrow-night-bright .ace_cursor { border-left: 2px solid #9F9F9F;}.ace-tomorrow-night-bright .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #9F9F9F;} .ace-tomorrow-night-bright .ace_marker-layer .ace_selection { background: #424242;}.ace-tomorrow-night-bright .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-tomorrow-night-bright .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid #343434;}.ace-tomorrow-night-bright .ace_marker-layer .ace_active_line { background: #2A2A2A;} .ace-tomorrow-night-bright .ace_invisible { color: #343434;}.ace-tomorrow-night-bright .ace_keyword { color:#C397D8;}.ace-tomorrow-night-bright .ace_keyword.ace_operator { color:#70C0B1;}.ace-tomorrow-night-bright .ace_constant { }.ace-tomorrow-night-bright .ace_constant.ace_language { color:#E78C45;}.ace-tomorrow-night-bright .ace_constant.ace_library { }.ace-tomorrow-night-bright .ace_constant.ace_numeric { color:#E78C45;}.ace-tomorrow-night-bright .ace_invalid { color:#CED2CF;background-color:#DF5F5F;}.ace-tomorrow-night-bright .ace_invalid.ace_illegal { }.ace-tomorrow-night-bright .ace_invalid.ace_deprecated { color:#CED2CF;background-color:#B798BF;}.ace-tomorrow-night-bright .ace_support { }.ace-tomorrow-night-bright .ace_support.ace_function { color:#7AA6DA;}.ace-tomorrow-night-bright .ace_function.ace_buildin { }.ace-tomorrow-night-bright .ace_string { color:#B9CA4A;}.ace-tomorrow-night-bright .ace_string.ace_regexp { color:#D54E53;}.ace-tomorrow-night-bright .ace_comment { color:#969896;}.ace-tomorrow-night-bright .ace_comment.ace_doc { }.ace-tomorrow-night-bright .ace_comment.ace_doc.ace_tag { }.ace-tomorrow-night-bright .ace_variable { color:#D54E53;}.ace-tomorrow-night-bright .ace_variable.ace_language { }.ace-tomorrow-night-bright .ace_xml_pe { }.ace-tomorrow-night-bright .ace_meta { }.ace-tomorrow-night-bright .ace_meta.ace_tag { color:#D54E53;}.ace-tomorrow-night-bright .ace_meta.ace_tag.ace_input { }.ace-tomorrow-night-bright .ace_entity.ace_other.ace_attribute-name { color:#D54E53;}.ace-tomorrow-night-bright .ace_entity.ace_name { }.ace-tomorrow-night-bright .ace_entity.ace_name.ace_function { color:#7AA6DA;}.ace-tomorrow-night-bright .ace_markup.ace_underline { text-decoration:underline;}.ace-tomorrow-night-bright .ace_markup.ace_heading { color:#B9CA4A;}.ace-tomorrow-night-bright .ace_markup.ace_heading.ace_1 { }.ace-tomorrow-night-bright .ace_markup.ace_heading.ace_2 { }.ace-tomorrow-night-bright .ace_markup.ace_heading.ace_3 { }.ace-tomorrow-night-bright .ace_markup.ace_heading.ace_4 { }.ace-tomorrow-night-bright .ace_markup.ace_heading.ace_5 { }.ace-tomorrow-night-bright .ace_markup.ace_heading.ace_6 { }.ace-tomorrow-night-bright .ace_markup.ace_list { }.ace-tomorrow-night-bright .ace_collab.ace_user1 { }",b.cssClass="ace-tomorrow-night-bright"}) \ No newline at end of file +define("ace/theme/tomorrow_night_bright",[], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-tomorrow-night-bright"; +exports.cssText = "\ +.ace-tomorrow-night-bright .ace_editor {\ + border: 2px solid rgb(159, 159, 159);\ +}\ +\ +.ace-tomorrow-night-bright .ace_editor.ace_focus {\ + border: 2px solid #327fbd;\ +}\ +\ +.ace-tomorrow-night-bright .ace_gutter {\ + background: #e8e8e8;\ + color: #333;\ +}\ +\ +.ace-tomorrow-night-bright .ace_print_margin {\ + width: 1px;\ + background: #e8e8e8;\ +}\ +\ +.ace-tomorrow-night-bright .ace_scroller {\ + background-color: #000000;\ +}\ +\ +.ace-tomorrow-night-bright .ace_text-layer {\ + cursor: text;\ + color: #DEDEDE;\ +}\ +\ +.ace-tomorrow-night-bright .ace_cursor {\ + border-left: 2px solid #9F9F9F;\ +}\ +\ +.ace-tomorrow-night-bright .ace_cursor.ace_overwrite {\ + border-left: 0px;\ + border-bottom: 1px solid #9F9F9F;\ +}\ + \ +.ace-tomorrow-night-bright .ace_marker-layer .ace_selection {\ + background: #424242;\ +}\ +\ +.ace-tomorrow-night-bright .ace_marker-layer .ace_step {\ + background: rgb(198, 219, 174);\ +}\ +\ +.ace-tomorrow-night-bright .ace_marker-layer .ace_bracket {\ + margin: -1px 0 0 -1px;\ + border: 1px solid #343434;\ +}\ +\ +.ace-tomorrow-night-bright .ace_marker-layer .ace_active_line {\ + background: #2A2A2A;\ +}\ +\ +.ace-tomorrow-night-bright .ace_marker-layer .ace_selected_word {\ + border: 1px solid #424242;\ +}\ + \ +.ace-tomorrow-night-bright .ace_invisible {\ + color: #343434;\ +}\ +\ +.ace-tomorrow-night-bright .ace_keyword {\ + color:#C397D8;\ +}\ +\ +.ace-tomorrow-night-bright .ace_keyword.ace_operator {\ + color:#70C0B1;\ +}\ +\ +.ace-tomorrow-night-bright .ace_constant.ace_language {\ + color:#E78C45;\ +}\ +\ +.ace-tomorrow-night-bright .ace_constant.ace_numeric {\ + color:#E78C45;\ +}\ +\ +.ace-tomorrow-night-bright .ace_invalid {\ + color:#CED2CF;\ +background-color:#DF5F5F;\ +}\ +\ +.ace-tomorrow-night-bright .ace_invalid.ace_deprecated {\ + color:#CED2CF;\ +background-color:#B798BF;\ +}\ +\ +.ace-tomorrow-night-bright .ace_fold {\ + background-color: #7AA6DA;\ + border-color: #DEDEDE;\ +}\ +\ +.ace-tomorrow-night-bright .ace_support.ace_function {\ + color:#7AA6DA;\ +}\ +\ +.ace-tomorrow-night-bright .ace_string {\ + color:#B9CA4A;\ +}\ +\ +.ace-tomorrow-night-bright .ace_string.ace_regexp {\ + color:#D54E53;\ +}\ +\ +.ace-tomorrow-night-bright .ace_comment {\ + color:#969896;\ +}\ +\ +.ace-tomorrow-night-bright .ace_variable {\ + color:#D54E53;\ +}\ +\ +.ace-tomorrow-night-bright .ace_meta.ace_tag {\ + color:#D54E53;\ +}\ +\ +.ace-tomorrow-night-bright .ace_entity.ace_other.ace_attribute-name {\ + color:#D54E53;\ +}\ +\ +.ace-tomorrow-night-bright .ace_entity.ace_name.ace_function {\ + color:#7AA6DA;\ +}\ +\ +.ace-tomorrow-night-bright .ace_markup.ace_underline {\ + text-decoration:underline;\ +}\ +\ +.ace-tomorrow-night-bright .ace_markup.ace_heading {\ + color:#B9CA4A;\ +}"; + + var dom = require("ace/lib/dom"); + dom.importCssString(exports.cssText); +}); + diff --git a/chrome/content/ace++/res/ace/theme-tomorrow_night_eighties.js b/chrome/content/ace++/res/ace/theme-tomorrow_night_eighties.js index 200d763..71d9cc9 100644 --- a/chrome/content/ace++/res/ace/theme-tomorrow_night_eighties.js +++ b/chrome/content/ace++/res/ace/theme-tomorrow_night_eighties.js @@ -1 +1,137 @@ -define("ace/theme/tomorrow_night_eighties",["require","exports","module"],function(a,b,c){b.cssText=".ace-tomorrow-night-eighties .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-tomorrow-night-eighties .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-tomorrow-night-eighties .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-tomorrow-night-eighties .ace_gutter-layer { width: 100%; text-align: right;}.ace-tomorrow-night-eighties .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-tomorrow-night-eighties .ace_print_margin { width: 1px; background: #e8e8e8;}.ace-tomorrow-night-eighties .ace_scroller { background-color: #2D2D2D;}.ace-tomorrow-night-eighties .ace_text-layer { cursor: text; color: #CCCCCC;}.ace-tomorrow-night-eighties .ace_cursor { border-left: 2px solid #CCCCCC;}.ace-tomorrow-night-eighties .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #CCCCCC;} .ace-tomorrow-night-eighties .ace_marker-layer .ace_selection { background: #515151;}.ace-tomorrow-night-eighties .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-tomorrow-night-eighties .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid #6A6A6A;}.ace-tomorrow-night-eighties .ace_marker-layer .ace_active_line { background: #393939;} .ace-tomorrow-night-eighties .ace_invisible { color: #6A6A6A;}.ace-tomorrow-night-eighties .ace_keyword { color:#CC99CC;}.ace-tomorrow-night-eighties .ace_keyword.ace_operator { color:#66CCCC;}.ace-tomorrow-night-eighties .ace_constant { }.ace-tomorrow-night-eighties .ace_constant.ace_language { color:#F99157;}.ace-tomorrow-night-eighties .ace_constant.ace_library { }.ace-tomorrow-night-eighties .ace_constant.ace_numeric { color:#F99157;}.ace-tomorrow-night-eighties .ace_invalid { color:#CDCDCD;background-color:#F2777A;}.ace-tomorrow-night-eighties .ace_invalid.ace_illegal { }.ace-tomorrow-night-eighties .ace_invalid.ace_deprecated { color:#CDCDCD;background-color:#CC99CC;}.ace-tomorrow-night-eighties .ace_support { }.ace-tomorrow-night-eighties .ace_support.ace_function { color:#6699CC;}.ace-tomorrow-night-eighties .ace_function.ace_buildin { }.ace-tomorrow-night-eighties .ace_string { color:#99CC99;}.ace-tomorrow-night-eighties .ace_string.ace_regexp { }.ace-tomorrow-night-eighties .ace_comment { color:#999999;}.ace-tomorrow-night-eighties .ace_comment.ace_doc { }.ace-tomorrow-night-eighties .ace_comment.ace_doc.ace_tag { }.ace-tomorrow-night-eighties .ace_variable { color:#F2777A;}.ace-tomorrow-night-eighties .ace_variable.ace_language { }.ace-tomorrow-night-eighties .ace_xml_pe { }.ace-tomorrow-night-eighties .ace_meta { }.ace-tomorrow-night-eighties .ace_meta.ace_tag { color:#F2777A;}.ace-tomorrow-night-eighties .ace_meta.ace_tag.ace_input { }.ace-tomorrow-night-eighties .ace_entity.ace_other.ace_attribute-name { color:#F2777A;}.ace-tomorrow-night-eighties .ace_entity.ace_name { }.ace-tomorrow-night-eighties .ace_entity.ace_name.ace_function { color:#6699CC;}.ace-tomorrow-night-eighties .ace_markup.ace_underline { text-decoration:underline;}.ace-tomorrow-night-eighties .ace_markup.ace_heading { color:#99CC99;}.ace-tomorrow-night-eighties .ace_markup.ace_heading.ace_1 { }.ace-tomorrow-night-eighties .ace_markup.ace_heading.ace_2 { }.ace-tomorrow-night-eighties .ace_markup.ace_heading.ace_3 { }.ace-tomorrow-night-eighties .ace_markup.ace_heading.ace_4 { }.ace-tomorrow-night-eighties .ace_markup.ace_heading.ace_5 { }.ace-tomorrow-night-eighties .ace_markup.ace_heading.ace_6 { }.ace-tomorrow-night-eighties .ace_markup.ace_list { }.ace-tomorrow-night-eighties .ace_collab.ace_user1 { }",b.cssClass="ace-tomorrow-night-eighties"}) \ No newline at end of file +define("ace/theme/tomorrow_night_eighties",[], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-tomorrow-night-eighties"; +exports.cssText = "\ +.ace-tomorrow-night-eighties .ace_editor {\ + border: 2px solid rgb(159, 159, 159);\ +}\ +\ +.ace-tomorrow-night-eighties .ace_editor.ace_focus {\ + border: 2px solid #327fbd;\ +}\ +\ +.ace-tomorrow-night-eighties .ace_gutter {\ + background: #e8e8e8;\ + color: #333;\ +}\ +\ +.ace-tomorrow-night-eighties .ace_print_margin {\ + width: 1px;\ + background: #e8e8e8;\ +}\ +\ +.ace-tomorrow-night-eighties .ace_scroller {\ + background-color: #2D2D2D;\ +}\ +\ +.ace-tomorrow-night-eighties .ace_text-layer {\ + cursor: text;\ + color: #CCCCCC;\ +}\ +\ +.ace-tomorrow-night-eighties .ace_cursor {\ + border-left: 2px solid #CCCCCC;\ +}\ +\ +.ace-tomorrow-night-eighties .ace_cursor.ace_overwrite {\ + border-left: 0px;\ + border-bottom: 1px solid #CCCCCC;\ +}\ + \ +.ace-tomorrow-night-eighties .ace_marker-layer .ace_selection {\ + background: #515151;\ +}\ +\ +.ace-tomorrow-night-eighties .ace_marker-layer .ace_step {\ + background: rgb(198, 219, 174);\ +}\ +\ +.ace-tomorrow-night-eighties .ace_marker-layer .ace_bracket {\ + margin: -1px 0 0 -1px;\ + border: 1px solid #6A6A6A;\ +}\ +\ +.ace-tomorrow-night-eighties .ace_marker-layer .ace_active_line {\ + background: #393939;\ +}\ +\ +.ace-tomorrow-night-eighties .ace_marker-layer .ace_selected_word {\ + border: 1px solid #515151;\ +}\ + \ +.ace-tomorrow-night-eighties .ace_invisible {\ + color: #6A6A6A;\ +}\ +\ +.ace-tomorrow-night-eighties .ace_keyword {\ + color:#CC99CC;\ +}\ +\ +.ace-tomorrow-night-eighties .ace_keyword.ace_operator {\ + color:#66CCCC;\ +}\ +\ +.ace-tomorrow-night-eighties .ace_constant.ace_language {\ + color:#F99157;\ +}\ +\ +.ace-tomorrow-night-eighties .ace_constant.ace_numeric {\ + color:#F99157;\ +}\ +\ +.ace-tomorrow-night-eighties .ace_invalid {\ + color:#CDCDCD;\ +background-color:#F2777A;\ +}\ +\ +.ace-tomorrow-night-eighties .ace_invalid.ace_deprecated {\ + color:#CDCDCD;\ +background-color:#CC99CC;\ +}\ +\ +.ace-tomorrow-night-eighties .ace_fold {\ + background-color: #6699CC;\ + border-color: #CCCCCC;\ +}\ +\ +.ace-tomorrow-night-eighties .ace_support.ace_function {\ + color:#6699CC;\ +}\ +\ +.ace-tomorrow-night-eighties .ace_string {\ + color:#99CC99;\ +}\ +\ +.ace-tomorrow-night-eighties .ace_comment {\ + color:#999999;\ +}\ +\ +.ace-tomorrow-night-eighties .ace_variable {\ + color:#F2777A;\ +}\ +\ +.ace-tomorrow-night-eighties .ace_meta.ace_tag {\ + color:#F2777A;\ +}\ +\ +.ace-tomorrow-night-eighties .ace_entity.ace_other.ace_attribute-name {\ + color:#F2777A;\ +}\ +\ +.ace-tomorrow-night-eighties .ace_entity.ace_name.ace_function {\ + color:#6699CC;\ +}\ +\ +.ace-tomorrow-night-eighties .ace_markup.ace_underline {\ + text-decoration:underline;\ +}\ +\ +.ace-tomorrow-night-eighties .ace_markup.ace_heading {\ + color:#99CC99;\ +}"; + + var dom = require("ace/lib/dom"); + dom.importCssString(exports.cssText); +}); + diff --git a/chrome/content/ace++/res/ace/theme-twilight.js b/chrome/content/ace++/res/ace/theme-twilight.js index fa76e5a..887b458 100644 --- a/chrome/content/ace++/res/ace/theme-twilight.js +++ b/chrome/content/ace++/res/ace/theme-twilight.js @@ -1 +1,143 @@ -define("ace/theme/twilight",["require","exports","module"],function(a,b,c){b.cssClass="ace-twilight",b.cssText=".ace-twilight .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-twilight .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-twilight .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-twilight .ace_gutter-layer { width: 100%; text-align: right;}.ace-twilight .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-twilight .ace_print_margin { width: 1px; background: #e8e8e8;}.ace-twilight .ace_scroller { background-color: #141414;}.ace-twilight .ace_text-layer { cursor: text; color: #F8F8F8;}.ace-twilight .ace_cursor { border-left: 2px solid #A7A7A7;}.ace-twilight .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #A7A7A7;} .ace-twilight .ace_marker-layer .ace_selection { background: rgba(221, 240, 255, 0.20);}.ace-twilight .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-twilight .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgba(255, 255, 255, 0.25);}.ace-twilight .ace_marker-layer .ace_active_line { background: rgba(255, 255, 255, 0.031);} .ace-twilight .ace_invisible { color: rgba(255, 255, 255, 0.25);}.ace-twilight .ace_keyword { color:#CDA869;}.ace-twilight .ace_keyword.ace_operator { }.ace-twilight .ace_constant { color:#CF6A4C;}.ace-twilight .ace_constant.ace_language { }.ace-twilight .ace_constant.ace_library { }.ace-twilight .ace_constant.ace_numeric { }.ace-twilight .ace_invalid { }.ace-twilight .ace_invalid.ace_illegal { color:#F8F8F8;background-color:rgba(86, 45, 86, 0.75);}.ace-twilight .ace_invalid.ace_deprecated { text-decoration:underline;font-style:italic;color:#D2A8A1;}.ace-twilight .ace_support { color:#9B859D;}.ace-twilight .ace_support.ace_function { color:#DAD085;}.ace-twilight .ace_function.ace_buildin { }.ace-twilight .ace_string { color:#8F9D6A;}.ace-twilight .ace_string.ace_regexp { color:#E9C062;}.ace-twilight .ace_comment { font-style:italic;color:#5F5A60;}.ace-twilight .ace_comment.ace_doc { }.ace-twilight .ace_comment.ace_doc.ace_tag { }.ace-twilight .ace_variable { color:#7587A6;}.ace-twilight .ace_variable.ace_language { }.ace-twilight .ace_xml_pe { color:#494949;}.ace-twilight .ace_meta { }.ace-twilight .ace_meta.ace_tag { color:#AC885B;}.ace-twilight .ace_meta.ace_tag.ace_input { }.ace-twilight .ace_entity.ace_other.ace_attribute-name { }.ace-twilight .ace_entity.ace_name { }.ace-twilight .ace_entity.ace_name.ace_function { color:#AC885B;}.ace-twilight .ace_markup.ace_underline { text-decoration:underline;}.ace-twilight .ace_markup.ace_heading { color:#CF6A4C;}.ace-twilight .ace_markup.ace_heading.ace_1 { }.ace-twilight .ace_markup.ace_heading.ace_2 { }.ace-twilight .ace_markup.ace_heading.ace_3 { }.ace-twilight .ace_markup.ace_heading.ace_4 { }.ace-twilight .ace_markup.ace_heading.ace_5 { }.ace-twilight .ace_markup.ace_heading.ace_6 { }.ace-twilight .ace_markup.ace_list { color:#F9EE98;}.ace-twilight .ace_collab.ace_user1 { }"}) \ No newline at end of file +define("ace/theme/twilight",[], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-twilight"; +exports.cssText = "\ +.ace-twilight .ace_editor {\ + border: 2px solid rgb(159, 159, 159);\ +}\ +\ +.ace-twilight .ace_editor.ace_focus {\ + border: 2px solid #327fbd;\ +}\ +\ +.ace-twilight .ace_gutter {\ + background: #e8e8e8;\ + color: #333;\ +}\ +\ +.ace-twilight .ace_print_margin {\ + width: 1px;\ + background: #e8e8e8;\ +}\ +\ +.ace-twilight .ace_scroller {\ + background-color: #141414;\ +}\ +\ +.ace-twilight .ace_text-layer {\ + cursor: text;\ + color: #F8F8F8;\ +}\ +\ +.ace-twilight .ace_cursor {\ + border-left: 2px solid #A7A7A7;\ +}\ +\ +.ace-twilight .ace_cursor.ace_overwrite {\ + border-left: 0px;\ + border-bottom: 1px solid #A7A7A7;\ +}\ + \ +.ace-twilight .ace_marker-layer .ace_selection {\ + background: rgba(221, 240, 255, 0.20);\ +}\ +\ +.ace-twilight .ace_marker-layer .ace_step {\ + background: rgb(198, 219, 174);\ +}\ +\ +.ace-twilight .ace_marker-layer .ace_bracket {\ + margin: -1px 0 0 -1px;\ + border: 1px solid rgba(255, 255, 255, 0.25);\ +}\ +\ +.ace-twilight .ace_marker-layer .ace_active_line {\ + background: rgba(255, 255, 255, 0.031);\ +}\ +\ +.ace-twilight .ace_marker-layer .ace_selected_word {\ + border: 1px solid rgba(221, 240, 255, 0.20);\ +}\ + \ +.ace-twilight .ace_invisible {\ + color: rgba(255, 255, 255, 0.25);\ +}\ +\ +.ace-twilight .ace_keyword {\ + color:#CDA869;\ +}\ +\ +.ace-twilight .ace_constant {\ + color:#CF6A4C;\ +}\ +\ +.ace-twilight .ace_invalid.ace_illegal {\ + color:#F8F8F8;\ +background-color:rgba(86, 45, 86, 0.75);\ +}\ +\ +.ace-twilight .ace_invalid.ace_deprecated {\ + text-decoration:underline;\ +font-style:italic;\ +color:#D2A8A1;\ +}\ +\ +.ace-twilight .ace_support {\ + color:#9B859D;\ +}\ +\ +.ace-twilight .ace_fold {\ + background-color: #AC885B;\ + border-color: #F8F8F8;\ +}\ +\ +.ace-twilight .ace_support.ace_function {\ + color:#DAD085;\ +}\ +\ +.ace-twilight .ace_string {\ + color:#8F9D6A;\ +}\ +\ +.ace-twilight .ace_string.ace_regexp {\ + color:#E9C062;\ +}\ +\ +.ace-twilight .ace_comment {\ + font-style:italic;\ +color:#5F5A60;\ +}\ +\ +.ace-twilight .ace_variable {\ + color:#7587A6;\ +}\ +\ +.ace-twilight .ace_xml_pe {\ + color:#494949;\ +}\ +\ +.ace-twilight .ace_meta.ace_tag {\ + color:#AC885B;\ +}\ +\ +.ace-twilight .ace_entity.ace_name.ace_function {\ + color:#AC885B;\ +}\ +\ +.ace-twilight .ace_markup.ace_underline {\ + text-decoration:underline;\ +}\ +\ +.ace-twilight .ace_markup.ace_heading {\ + color:#CF6A4C;\ +}\ +\ +.ace-twilight .ace_markup.ace_list {\ + color:#F9EE98;\ +}"; + + var dom = require("ace/lib/dom"); + dom.importCssString(exports.cssText); +}); + diff --git a/chrome/content/ace++/res/ace/theme-vibrant_ink.js b/chrome/content/ace++/res/ace/theme-vibrant_ink.js index efe0a67..a7152f1 100644 --- a/chrome/content/ace++/res/ace/theme-vibrant_ink.js +++ b/chrome/content/ace++/res/ace/theme-vibrant_ink.js @@ -1 +1,126 @@ -define("ace/theme/vibrant_ink",["require","exports","module"],function(a,b,c){b.cssText=".ace-vibrant-ink .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-vibrant-ink .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-vibrant-ink .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-vibrant-ink .ace_gutter-layer { width: 100%; text-align: right;}.ace-vibrant-ink .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-vibrant-ink .ace_print_margin { width: 1px; background: #e8e8e8;}.ace-vibrant-ink .ace_scroller { background-color: #0F0F0F;}.ace-vibrant-ink .ace_text-layer { cursor: text; color: #FFFFFF;}.ace-vibrant-ink .ace_cursor { border-left: 2px solid #FFFFFF;}.ace-vibrant-ink .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #FFFFFF;} .ace-vibrant-ink .ace_marker-layer .ace_selection { background: #6699CC;}.ace-vibrant-ink .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-vibrant-ink .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid #99CC99;}.ace-vibrant-ink .ace_marker-layer .ace_active_line { background: #333333;} .ace-vibrant-ink .ace_invisible { color: #404040;}.ace-vibrant-ink .ace_keyword { color:#FF6600;}.ace-vibrant-ink .ace_keyword.ace_operator { }.ace-vibrant-ink .ace_constant { }.ace-vibrant-ink .ace_constant.ace_language { color:#339999;}.ace-vibrant-ink .ace_constant.ace_library { }.ace-vibrant-ink .ace_constant.ace_numeric { color:#99CC99;}.ace-vibrant-ink .ace_invalid { color:#CCFF33; background-color:#000000;}.ace-vibrant-ink .ace_invalid.ace_illegal { }.ace-vibrant-ink .ace_invalid.ace_deprecated { color:#CCFF33; background-color:#000000;}.ace-vibrant-ink .ace_support { }.ace-vibrant-ink .ace_support.ace_function { color:#FFCC00;}.ace-vibrant-ink .ace_function.ace_buildin { }.ace-vibrant-ink .ace_string { color:#66FF00;}.ace-vibrant-ink .ace_string.ace_regexp { color:#44B4CC;}.ace-vibrant-ink .ace_comment { color:#9933CC;}.ace-vibrant-ink .ace_comment.ace_doc { }.ace-vibrant-ink .ace_comment.ace_doc.ace_tag { }.ace-vibrant-ink .ace_variable { }.ace-vibrant-ink .ace_variable.ace_language { }.ace-vibrant-ink .ace_xml_pe { }.ace-vibrant-ink .ace_meta { }.ace-vibrant-ink .ace_meta.ace_tag { }.ace-vibrant-ink .ace_meta.ace_tag.ace_input { }.ace-vibrant-ink .ace_entity.ace_other.ace_attribute-name { font-style:italic;color:#99CC99;}.ace-vibrant-ink .ace_entity.ace_name { }.ace-vibrant-ink .ace_entity.ace_name.ace_function { color:#FFCC00;}.ace-vibrant-ink .ace_markup.ace_underline { text-decoration:underline;}.ace-vibrant-ink .ace_markup.ace_heading { }.ace-vibrant-ink .ace_markup.ace_heading.ace_1 { }.ace-vibrant-ink .ace_markup.ace_heading.ace_2 { }.ace-vibrant-ink .ace_markup.ace_heading.ace_3 { }.ace-vibrant-ink .ace_markup.ace_heading.ace_4 { }.ace-vibrant-ink .ace_markup.ace_heading.ace_5 { }.ace-vibrant-ink .ace_markup.ace_heading.ace_6 { }.ace-vibrant-ink .ace_markup.ace_list { }.ace-vibrant-ink .ace_collab.ace_user1 { }",b.cssClass="ace-vibrant-ink"}) \ No newline at end of file +define("ace/theme/vibrant_ink",[], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-vibrant-ink"; +exports.cssText = "\ +.ace-vibrant-ink .ace_editor {\ + border: 2px solid rgb(159, 159, 159);\ +}\ +\ +.ace-vibrant-ink .ace_editor.ace_focus {\ + border: 2px solid #327fbd;\ +}\ +\ +.ace-vibrant-ink .ace_gutter {\ + background: #e8e8e8;\ + color: #333;\ +}\ +\ +.ace-vibrant-ink .ace_print_margin {\ + width: 1px;\ + background: #e8e8e8;\ +}\ +\ +.ace-vibrant-ink .ace_scroller {\ + background-color: #0F0F0F;\ +}\ +\ +.ace-vibrant-ink .ace_text-layer {\ + cursor: text;\ + color: #FFFFFF;\ +}\ +\ +.ace-vibrant-ink .ace_cursor {\ + border-left: 2px solid #FFFFFF;\ +}\ +\ +.ace-vibrant-ink .ace_cursor.ace_overwrite {\ + border-left: 0px;\ + border-bottom: 1px solid #FFFFFF;\ +}\ + \ +.ace-vibrant-ink .ace_marker-layer .ace_selection {\ + background: #6699CC;\ +}\ +\ +.ace-vibrant-ink .ace_marker-layer .ace_step {\ + background: rgb(198, 219, 174);\ +}\ +\ +.ace-vibrant-ink .ace_marker-layer .ace_bracket {\ + margin: -1px 0 0 -1px;\ + border: 1px solid #404040;\ +}\ +\ +.ace-vibrant-ink .ace_marker-layer .ace_active_line {\ + background: #333333;\ +}\ +\ +.ace-vibrant-ink .ace_marker-layer .ace_selected_word {\ + border: 1px solid #6699CC;\ +}\ + \ +.ace-vibrant-ink .ace_invisible {\ + color: #404040;\ +}\ +\ +.ace-vibrant-ink .ace_keyword {\ + color:#FF6600;\ +}\ +\ +.ace-vibrant-ink .ace_constant {\ + color:#339999;\ +}\ +\ +.ace-vibrant-ink .ace_constant.ace_numeric {\ + color:#99CC99;\ +}\ +\ +.ace-vibrant-ink .ace_invalid {\ + color:#CCFF33;\ +background-color:#000000;\ +}\ +\ +.ace-vibrant-ink .ace_invalid.ace_deprecated {\ + color:#CCFF33;\ +background-color:#000000;\ +}\ +\ +.ace-vibrant-ink .ace_fold {\ + background-color: #FFCC00;\ + border-color: #FFFFFF;\ +}\ +\ +.ace-vibrant-ink .ace_support.ace_function {\ + color:#FFCC00;\ +}\ +\ +.ace-vibrant-ink .ace_string {\ + color:#66FF00;\ +}\ +\ +.ace-vibrant-ink .ace_string.ace_regexp {\ + color:#44B4CC;\ +}\ +\ +.ace-vibrant-ink .ace_comment {\ + color:#9933CC;\ +}\ +\ +.ace-vibrant-ink .ace_entity.ace_other.ace_attribute-name {\ + font-style:italic;\ +color:#99CC99;\ +}\ +\ +.ace-vibrant-ink .ace_entity.ace_name.ace_function {\ + color:#FFCC00;\ +}\ +\ +.ace-vibrant-ink .ace_markup.ace_underline {\ + text-decoration:underline;\ +}"; + + var dom = require("ace/lib/dom"); + dom.importCssString(exports.cssText); +}); + diff --git a/chrome/content/ace++/scrollbar.js b/chrome/content/ace++/scrollbar.js index 325ac96..e69de29 100644 --- a/chrome/content/ace++/scrollbar.js +++ b/chrome/content/ace++/scrollbar.js @@ -1,212 +0,0 @@ -define("ace/scrollbar", function(require, exports, module) { - -var oop = require("ace/lib/oop"); -var dom = require("ace/lib/dom"); -var event = require("ace/lib/event"); -var EventEmitter = require("ace/lib/event_emitter").EventEmitter; - - -dom.importCssString( -'.ace_editor>.ace_sb {\ - position: absolute;\ - overflow: hidden!important;\ - right: 0;\ - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAHCAIAAABPxRC5AAAAPElEQVQImVWLwRGAMBCElou5/vuLtQQfPoz8GAbutWb3Ncacs7tLTaJSpVaSJIB7AwXkoE5Rv//X3wt4ACQ3F9lopNWrAAAAAElFTkSuQmCC) transparent 50% 0 repeat-y;\ - -moz-border-radius:5px;\ -}\ -\ -.ace_editor>.ace_sb>div {\ - position: absolute; \ - left: 0px; \ - background:#c5c5c4;\ - background: -moz-linear-gradient(left top 0grad, #f9f9f9, #e6e6e6);background:-webkit-gradient(linear, left top, right top, from(#f9f9f9), to(#e6e6e6));\ - -moz-border-radius:4px;\ - border:1px solid #d3d2d2;\ - -moz-box-shadow:0 1px 1px rgba(0,0,0,0.1);\ -}' - - -) - - -var ScrollBar = function(parent) { - this.element = document.createElement("div"); - this.element.className = "ace_sb"; - - this.inner = document.createElement("div"); - this.element.appendChild(this.inner); - - parent.appendChild(this.element); - - this.width = dom.scrollbarWidth(document); - this.element.style.width = this.width + 'px'; - this.buttonSize = Math.max(this.width-4, 4) - - this.inner.style.width = this.buttonSize +'px'; - this.inner.style.left = '1px' - - var scrollButton=this.inner.cloneNode(false) - scrollButton.style.top = '0px' - scrollButton.style.height = this.buttonSize-2 +'px' - this.element.appendChild(scrollButton); - - scrollButton=this.inner.cloneNode(false) - scrollButton.style.bottom = '0px' - scrollButton.style.height = this.buttonSize-2 +'px' - this.element.appendChild(scrollButton); - - event.addListener(this.element, "mousedown", this.onMouseDown.bind(this)); - - event.addMultiMouseDownListener(this.element, 0, 2, 500, this.onMouseDoubleClick.bind(this)); - -}; - -(function() { - oop.implement(this, EventEmitter); - - this.onMouseDown = function(e) { - if (event.getButton(e) != 0 || e.detail == 2) { - return; - } - - if (e.target == this.inner) { - this.onMouseDown2(e) - return; - } - - var self = this; - var mouseY = e.clientY; - - var correction = this.element.getBoundingClientRect().top+this.buttonSize - - - var onMouseMove = function(e) { - mouseY = e.clientY; - }; - - var onMouseUp = function() { - clearInterval(timerId); - }; - - var onScrollInterval = function() { - if (mouseY === undefined) - return; - var desiredPos = mouseY-correction-self.thumbHeight/2 - var delta = desiredPos - self.thumbTop - var speed = 2 - if(delta > speed) - desiredPos = self.thumbTop + speed - else if(delta<-speed) - desiredPos = self.thumbTop - speed - else - desiredPos = self.thumbTop - - var scrollTop = self.scrollTopFromThumbTop(desiredPos) - if(scrollTop==self.scrollTop) - return - self._dispatchEvent("scroll", {data: scrollTop}); - }; - - event.capture(this.inner, onMouseMove, onMouseUp); - var timerId = setInterval(onScrollInterval, 20); - - return event.preventDefault(e); - }; - - this.onMouseDown2 = function(e) { - var startY = e.clientY; - var startTop = this.thumbTop; - - var self = this; - var mousePageY; - - var onMouseMove = function(e) { - mousePageY = e.clientY; - }; - - var onMouseUp = function() { - clearInterval(timerId); - }; - - var onScrollInterval = function() { - if (mousePageY === undefined) - return; - var scrollTop = self.scrollTopFromThumbTop(startTop+mousePageY-startY) - if(scrollTop==self.scrollTop) - return - self._dispatchEvent("scroll", {data: scrollTop}); - }; - - event.capture(this.inner, onMouseMove, onMouseUp); - var timerId = setInterval(onScrollInterval, 20); - - return event.preventDefault(e); - }; - - this.onMouseDoubleClick = function(e) { - var top = e.clientY - this.element.getBoundingClientRect().top-this.buttonSize - if(top>this.thumbTop+this.thumbHeight) - top-=this.thumbHeight - this._dispatchEvent("scroll", {data: this.scrollTopFromThumbTop(top)}); - }; - - this.getWidth = function() { - return this.width; - }; - - this.scrollTopFromThumbTop = function(thumbTop) { - var scrollTop = thumbTop*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight) - scrollTop=scrollTop>>0 - if(scrollTop<0) - scrollTop = 0 - else if(scrollTop > this.pageHeight-this.viewHeight) - scrollTop = this.pageHeight-this.viewHeight; - return scrollTop - }; - - this.setHeight = function(height) { - this.height=Math.max(0, height ) - this.element.style.height = this.height + "px"; - this.slideHeight = this.height - 2*this.buttonSize - this.viewHeight=this.height - - // force setInnerHeight updating - // this.pageHeight = -1 - this.setInnerHeight(this.pageHeight, true) - }; - - this.setInnerHeight = function(height, force) { - if(this.pageHeight == height && !force) - return - this.pageHeight = height - this.thumbHeight = this.slideHeight * this.viewHeight/this.pageHeight - - if(this.thumbHeight < this.buttonSize) - this.thumbHeight = this.buttonSize - else if(this.thumbHeight > this.slideHeight) - this.thumbHeight = this.slideHeight - - this.inner.style.height=this.thumbHeight + "px"; - - if(this.scrollTop>(this.pageHeight-this.viewHeight+2)){ - this.scrollTop=(this.pageHeight-this.viewHeight) - if(this.scrollTop<0)this.scrollTop = 0 - this._dispatchEvent("scroll", {data: this.scrollTop}); - } - - - }; - - this.setScrollTop = function(scrollTop) { - // if(this.scrollTop == scrollTop) - // return - this.scrollTop = scrollTop - if(scrollTop<0)scrollTop=0 - this.thumbTop=scrollTop*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight) - this.inner.style.top=(this.thumbTop+this.buttonSize)+"px"; - }; - -}).call(ScrollBar.prototype); - -exports.ScrollBar = ScrollBar; -}); \ No newline at end of file diff --git a/chrome/content/ace++/startup.js b/chrome/content/ace++/startup.js index 8894d9f..36aab2b 100644 --- a/chrome/content/ace++/startup.js +++ b/chrome/content/ace++/startup.js @@ -76,120 +76,6 @@ exports.HashHandler = HashHandler; }); -/************************************************************************************/ -define('ace/layer/gutter', function(require, exports, module) { -var dom = require("ace/lib/dom"); - -var Gutter = function(parentEl) { - this.element = dom.createElement("div"); - this.element.className = "ace_layer ace_gutter-layer"; - parentEl.appendChild(this.element); - - this.$breakpoints = []; - this.$annotations = []; - this.$decorations = []; -}; - -(function() { - - this.setSession = function(session) { - this.session = session; - }; - - this.addGutterDecoration = function(row, className){ - if (!this.$decorations[row]) - this.$decorations[row] = ""; - this.$decorations[row] += " ace_" + className; - } - - this.removeGutterDecoration = function(row, className){ - this.$decorations[row] = this.$decorations[row].replace(" ace_" + className, ""); - }; - - this.setBreakpoints = function(rows) { - }; - - this.setAnnotations = function(annotations) { - // iterate over sparse array - this.$annotations = []; - for (var row in annotations) if (annotations.hasOwnProperty(row)) { - var rowAnnotations = annotations[row]; - if (!rowAnnotations) - continue; - - var rowInfo = this.$annotations[row] = { - text: [] - }; - for (var i=0; i foldStart) { - i = fold.end.row + 1; - fold = this.session.getNextFoldLine(i); - foldStart = fold ?fold.start.row :Infinity; - } - if(i > lastRow) - break; - - var annotation = this.$annotations[i] || emptyAnno; - html.push("
" - ); - if (this.session.isLineFoldable(i)){ - html.push( - "", i, "" - ) - } else - html.push(i) - - var wrappedRowLength = this.session.getRowLength(i) - 1; - while (wrappedRowLength--) { - html.push("
¦"); - } - - html.push("
"); - - i++; - } - this.element = dom.setInnerHtml(this.element, html.join("")); - this.element.style.height = config.minHeight + "px"; - }; - -}).call(Gutter.prototype); - -exports.Gutter = Gutter; - -}); - /************************************************************************************/ define('fbace/startup', function(require, exports, module) { @@ -213,15 +99,6 @@ exports.launch = function(env, options) { /**************************** breakpoint handler *********************************************/ function CStyleFolding() { - this.isLineFoldable = function(row) { - if (this.foldWidgets[row] != null) - return this.foldWidgets[row] - else { - return this.foldWidgets[row] = this.getLine(row).search(/(\{|\[)\s*(\/\/.*)?$/) != -1 || - (this.getState(row).isHeader == 1 && row + 1 < env.editor.session.getLength()) - } - } - this.setBreakpointsAtRows = function(rows) { this.$breakpoints = []; for (var i=0; i